Skip to content

Commit

Permalink
Merge pull request #6 from PotLock/feat/docs
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
elliotBraem authored Jan 14, 2025
2 parents 7758610 + 28c2b9f commit e1cf914
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 278 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Please follow the existing code style and conventions used in the project.

## Testing

This repository uses playwright tests, which can be found in [/playwright-tests](./playwright-tests/). Ensure that your changes include appropriate tests and that existing tests pass.
This repository uses tests located in the backend's `src/__tests__` directory. Ensure that your changes include appropriate tests and that existing tests pass.

## Submitting Issues

Expand Down
182 changes: 30 additions & 152 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,9 @@
- [Environment Setup](#environment-setup)
- [Running the app](#running-the-app)
- [Building for production](#building-for-production)
- [Deploying to Fly.io](#deploying-to-flyio)
- [Deploying](#deploying)
- [Running tests](#running-tests)
- [Configuration](#configuration)
- [Twitter Setup](#twitter-setup)
- [Admin Configuration](#admin-configuration)
- [Bot Functionality](#bot-functionality)
- [Submission Process](#submission-process)
- [Moderation System](#moderation-system)
- [Rate Limiting](#rate-limiting)
- [Configuration & Usage](#configuration--usage)
- [Contributing](#contributing)

</details>
Expand All @@ -46,9 +40,9 @@ This project uses a monorepo structure managed with [Turborepo](https://turbo.bu
```bash
curation-bot/
├── frontend/ # React frontend application
├── backend/ # Bun-powered backend service
├── package.json # Root package.json for shared dependencies
└── turbo.json # Turborepo configuration
├── backend/ # Bun-powered backend service
├── package.json # Root package.json for shared dependencies
└── turbo.json # Turborepo configuration
```

### Key Components
Expand All @@ -62,34 +56,24 @@ curation-bot/
- Bun runtime for high performance
- Twitter bot functionality
- API endpoints for frontend
- Export services for RSS and Telegram
- Distribution services for RSS and Telegram

### Export Services
### Available Feeds

The platform supports multiple channels for content distribution:
The platform currently supports several curated feeds:

#### RSS Feed

- Automatically generates an RSS feed of approved submissions
- Configurable feed properties (title, description, max items)
- XML-compliant output with proper escaping
- Ideal for content aggregators and RSS readers

#### Telegram Channel

- Posts approved submissions to a configured Telegram channel
- Formatted messages with submission details and source links
- Real-time updates as content is approved
- Requires a Telegram bot token and channel ID



# Futre Features
- Regular posting of information on regular intervals
- Creation of content from these feeds, example blogs, articiles
- Integrating to different channels to post

The export system is extensible - new export types can be added by implementing the ExportService interface in [backend/src/services/exports/types.ts](./backend/src/services/exports/types.ts).
- **Crypto Grant Wire**: Blockchain grant updates
- **This Week in Ethereum**: Ethereum ecosystem updates
- **NEARWEEK**: NEAR Protocol updates
- **AI x Crypto News**: AI and blockchain intersection
- **AI News**: AI updates
- **Crypto News**: General crypto updates
- **Public Goods FM**: Public goods focus
- **REFI DAO**: Regenerative Finance updates
- **DeSci World**: Decentralized Science updates
- **Network State News**: Network states & intentional communities
- **SOL-WEEK**: Solana ecosystem updates
- **Web3 Fundraising**: Fundraising announcements

## Getting Started

Expand Down Expand Up @@ -119,18 +103,11 @@ TWITTER_USERNAME=your_twitter_username
TWITTER_PASSWORD=your_twitter_password
TWITTER_EMAIL=your_twitter_email
# Export Services Configuration
# Distribution Services Configuration
# Telegram (Optional)
TELEGRAM_ENABLED=false # Set to true to enable Telegram export
TELEGRAM_BOT_TOKEN= # Your Telegram bot token
TELEGRAM_CHANNEL_ID= # Target channel ID for posts
# RSS Feed (Optional)
RSS_ENABLED=false # Set to true to enable RSS feed
RSS_TITLE= # Title of your RSS feed
RSS_DESCRIPTION= # Description of your RSS feed
RSS_FEED_PATH= # Path where RSS feed will be generated
RSS_MAX_ITEMS=100 # Maximum number of items to keep in feed
```

### Running the app
Expand All @@ -154,124 +131,25 @@ Build all packages:
bun run build
```

### Deploying to Fly.io

The backend service can be deployed to Fly.io with SQLite support. First, install the Fly CLI:

```bash
# macOS
brew install flyctl

# Windows
powershell -Command "iwr https://fly.io/install.ps1 -useb | iex"

# Linux
curl -L https://fly.io/install.sh | sh
```

Then sign up and authenticate:

```bash
fly auth signup
# or
fly auth login
```

Deploy the application using the provided npm scripts:

```bash
# Initialize Fly.io app
bun run deploy:init

# Create persistent volumes for SQLite and cache
bun run deploy:volumes

# Deploy the application
bun run deploy
```

The deployment configuration includes:
### Deploying

- Persistent storage for SQLite database
- Cache directory support
- Auto-scaling configuration
- HTTPS enabled by default
For deployment instructions, see our [Deployment Guide](./docs/docs/developers/deployment.md).

### Running tests

```bash
bun run test
```

See the full [testing guide](./playwright-tests/README.md).

## Configuration

### Twitter Setup

The bot requires a Twitter account to function. Configure the following in your `.env` file:

```env
TWITTER_USERNAME=your_twitter_username
TWITTER_PASSWORD=your_twitter_password
TWITTER_EMAIL=your_twitter_email
```

It will use these credentials to login and cache cookies via [agent-twitter-client](https://github.com/ai16z/agent-twitter-client).

### Configuration

See the [Configuration Documentation](./docs/docs/developers/configuration.md) for detailed information about:

- Feed configuration and structure
- Stream and recap behavior
- Plugin system
- Message queue handling

### Admin Configuration

Admins are Twitter accounts that have moderation privileges (Twitter handles without @). Configure admin accounts in `backend/src/config/admins.ts`:

```typescript
export const ADMIN_ACCOUNTS: string[] = [
"admin_handle_1",
"admin_handle_2"
// Add admin Twitter handles here (without @)
]
```

Admin accounts are automatically tagged in submission acknowledgements and can:

- Approve submissions using the `#approve` hashtag
- Reject submissions using the `#reject` hashtag

Only the first moderation will be recorded.

## Bot Functionality

### Submission Process

1. **Submit News**: Users can submit news by mentioning the bot with `!submit` in their tweet
2. **Acknowledgment**: The bot responds with a confirmation tweet, tagging the admins for review
3. **Moderation**: Admins will reply to the bot's acknowledgement with either #approve or #reject
4. **Notification**: Users receive a tweet notification about their submission's status

### Moderation System

1. **Queue**: All submissions enter a moderation queue
2. **Admin Review**: Admins can review submissions by replying to the bot's acknowledgment tweet
3. **Actions**:
- Approve: Reply with `#approve` hashtag
- Reject: Reply with `#reject` hashtag
4. **Outcome**: Users receive a notification tweet about the moderation decision
Tests are located in the backend's `src/__tests__` directory. Run them using `bun run test`.

### Rate Limiting
## Configuration & Usage

To maintain quality:
For detailed information about configuration, submission process, and usage, please refer to our documentation:

- Users are limited to 10 submissions per day
- Rate limits reset daily
- Exceeding the limit results in a notification tweet
- [Configuration Guide](./docs/docs/developers/configuration.md): Feed setup, plugins, and system configuration
- [User Guide](./docs/docs/user-guides/social_integration.md): How to submit and moderate content
- [Developer Guide](./docs/docs/developers/): Technical documentation for developers

## Contributing

Expand Down
Loading

0 comments on commit e1cf914

Please sign in to comment.