Skip to content

Latest commit

Β 

History

56 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Xcel

AI-powered automation for X (Twitter).

Generate, schedule, and publish AI-generated tweets from topics that matter to you.

Built with Bun, Express, Drizzle ORM, BullMQ, PostgreSQL, Gemini AI, Tavily Search, and Buffer API.


Landing page

The Xcel landing page introduces the complete Twitter automation workflow: create posts manually, schedule them for later, or use query-driven web research to generate and publish trend-based content automatically.

Xcel landing page


Documentation

Document Description
API Reference All REST endpoints β€” request/response shapes, params, and examples
Architecture System design, request lifecycle, worker flows, and layer responsibilities
Database Schema reference β€” tables, columns, enums, indexes, and ER diagram

What is Xcel?

Xcel is an AI-powered automation platform for X (formerly Twitter) that automates the entire content publishing workflow.

Instead of manually writing tweets every day, Xcel continuously searches the web for relevant information, generates context-aware tweets using Gemini AI, schedules them according to your preferred posting times, and publishes them automatically through Buffer.

The goal is simple:

Stay consistent on X without spending hours creating content.


Project Status

Personal Project

Xcel is currently designed for personal use.

  • βœ… Backend automation engine is production-ready.
  • βœ… Frontend dashboard and public landing page are complete.
  • πŸ”’ Authentication and OAuth are intentionally not implemented.
  • πŸ‘€ The current version supports a single-user workflow.

If you want to use Xcel for your own account or extend it into a multi-user SaaS, simply fork the repository and implement your preferred authentication provider.


Features

Automation

  • AI tweet generation
  • Automated publishing through Buffer
  • Web search powered content discovery
  • Topic-based content generation
  • Dynamic posting schedules
  • Dynamic automation schedules

Tweet Management

  • Draft tweets
  • Custom tweets
  • Automated tweets
  • Scheduled tweets
  • Post history
  • Failed tweet retry support

Backend

  • Queue-based architecture
  • Background workers
  • Scheduled jobs
  • Typed API
  • Request validation
  • Centralized error handling

AI

  • Gemini AI for tweet generation
  • Tavily Search for real-time web search
  • Structured JSON responses
  • Prompt-driven generation

System Architecture

                              Xcel

                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚   Frontend   β”‚
                         β”‚   Next.js    β”‚
                         β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                        REST API Requests
                                β”‚
                                β–Ό
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚  Express + Bun API  β”‚
                     β”‚   /api/v1/*         β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β–Ό               β–Ό                      β–Ό              β–Ό
   Controllers      Services              Validators      Middleware
        β”‚               β”‚
        └───────────────┼────────────────────────────────────┐
                        β–Ό                                    β–Ό
                 Business Logic                     Queue Scheduler
                        β”‚                                    β”‚
                        β–Ό                                    β–Ό
                  Drizzle ORM                         BullMQ Workers
                        β”‚                                    β”‚
                        β–Ό                                    β–Ό
                 PostgreSQL DB                  Automation / Posting
                        β”‚                                    β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β–Ό
                               External Services
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚ GeminiAI β”‚ Tavily   β”‚ Buffer   β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
                                       β–Ό
                                 X (Twitter)

Tweet Automation Flow

User Topics
     β”‚
     β–Ό
Queries Table
     β”‚
     β–Ό
Automation Worker
     β”‚
     β–Ό
Tavily Search
     β”‚
     β–Ό
Gemini AI
     β”‚
     β–Ό
Generated Tweet
     β”‚
     β–Ό
Tweets Table
     β”‚
     β–Ό
Posting Scheduler
     β”‚
     β–Ό
Posting Worker
     β”‚
     β–Ό
Buffer API
     β”‚
     β–Ό
X (Twitter)

Database Schema

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          queries           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ id (uuidv7) PK            β”‚
β”‚ query                     β”‚
β”‚ active                    β”‚
β”‚ created_at                β”‚
β”‚ updated_at                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β”‚ query
               β”‚
               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          tweets            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ id (uuidv7) PK            β”‚
β”‚ content                   β”‚
β”‚ hashtags[]                β”‚
β”‚ query                     β”‚
β”‚ type                      β”‚
β”‚ status                    β”‚
β”‚ scheduled_for             β”‚
β”‚ posted_at                 β”‚
β”‚ created_at                β”‚
β”‚ updated_at                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜


β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         settings           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ id (uuidv7) PK            β”‚
β”‚ automation_enabled        β”‚
β”‚ posting_times (jsonb)     β”‚
β”‚ automation_times (jsonb)  β”‚
β”‚ timezone                  β”‚
β”‚ created_at                β”‚
β”‚ updated_at                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Project Structure

Xcel/
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ db/
β”‚   β”‚   β”œβ”€β”€ jobs/
β”‚   β”‚   β”œβ”€β”€ middlewares/
β”‚   β”‚   β”œβ”€β”€ prompts/
β”‚   β”‚   β”œβ”€β”€ queues/
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ validators/
β”‚   β”‚   └── workers/
β”‚   β”‚
β”‚   └── drizzle/
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ providers/
β”‚   β”‚   β”œβ”€β”€ constants/
β”‚   β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   └── types/
β”‚   β”‚
β”‚   └── public/
β”‚
└── README.md

Backend Architecture

Routes
   β”‚
   β–Ό
Controllers
   β”‚
   β–Ό
Services
   β”‚
   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ί Gemini AI
   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ί Tavily Search
   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ί Buffer API
   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ί BullMQ
   β”‚
   β–Ό
Drizzle ORM
   β”‚
   β–Ό
PostgreSQL

API Routes

Tweets

Method Endpoint Description
GET /api/v1/tweets Get all tweets (paginated, filterable)
POST /api/v1/tweets Create a custom tweet
PATCH /api/v1/tweets/:tweetId Update a tweet
DELETE /api/v1/tweets/:tweetId Delete a tweet
POST /api/v1/tweets/enhance AI-enhance tweet content via Gemini

Queries

Method Endpoint Description
GET /api/v1/queries Get all topics
POST /api/v1/queries Add a new topic
PATCH /api/v1/queries/:id Toggle active / update
DELETE /api/v1/queries/:id Delete a topic

Dashboard

Method Endpoint Description
GET /api/v1/dashboard Aggregate stats

Settings

Method Endpoint Description
GET /api/v1/settings Get current settings
PATCH /api/v1/settings/:settingId Update settings

Automation

Method Endpoint Description
POST /api/v1/automation/run Manually trigger an automation cycle

Tech Stack

Frontend

Technology Version Purpose
Next.js 16.2.10 React Framework
React 19.2.4 UI Library
TypeScript ^5 Type Safety
Tailwind CSS ^4 Styling
shadcn/ui 4.13.0 UI Components
TanStack Query 5.101.2 Server State Management
Axios 1.18.1 API Client
React Hook Form 7.81.0 Forms
Zod 4.4.3 Validation
Sonner 2.0.7 Toast Notifications
Lucide React 1.24.0 Icons
Motion 13.2.0 Landing page animations

Backend

Technology Version Purpose
Bun Latest JavaScript Runtime
Express 5.2.1 REST API
TypeScript ^5 Type Safety
Drizzle ORM 1.0.0-rc.4 ORM
Drizzle Kit 1.0.0-rc.4 Migrations
PostgreSQL Latest Database
BullMQ 5.80.0 Background Jobs
ioredis 5.10.1 Redis Client
Pino 10.3.1 Logging
Zod 4.4.3 Request Validation
Dotenv 17.4.2 Environment Variables

AI & External APIs

Service Purpose
Gemini API AI Tweet Generation
Tavily Search API Real-time Web Search
Buffer API Tweet Publishing
Neon PostgreSQL Cloud Database
Upstash Redis Queue Storage
Render Deployment

Development Phases

βœ… Phase 1 β€” Backend Foundation (Completed)

  • Express + Bun backend
  • Drizzle ORM setup
  • PostgreSQL integration
  • Redis connection
  • Logging
  • Error handling
  • Validation
  • Environment configuration

βœ… Phase 2 β€” AI Automation Engine (Completed)

  • Gemini AI integration
  • Tavily Search integration
  • AI tweet generation
  • Prompt engineering
  • Structured JSON responses
  • Topic-based automation

βœ… Phase 3 β€” Scheduling System (Completed)

  • BullMQ queues
  • Automation worker
  • Posting worker
  • Dynamic posting schedules
  • Dynamic automation schedules
  • Retry support

βœ… Phase 4 β€” Tweet Management (Completed)

  • Create custom tweets
  • Draft tweets
  • Scheduled tweets
  • Pending queue
  • Failed tweets
  • Dashboard APIs

βœ… Phase 5 β€” Frontend Dashboard (Completed)

  • Dashboard UI
  • Tweet management
  • Query management
  • Settings page
  • Analytics cards
  • Responsive layout
  • Landing page with animated hero, bento features, workflow, CTA, and footer
  • Dashboard-to-landing-page navigation

πŸ“‹ Phase 6 β€” Future Plans

  • User Authentication
  • OAuth
  • Multi-user support
  • Thread generation
  • AI tweet enhancement
  • Tweet analytics
  • Multiple X accounts
  • LinkedIn automation
  • Instagram automation
  • YouTube Shorts automation
  • Email notifications
  • Webhooks
  • Docker support
  • CI/CD pipeline

Current Progress

Module Status
Backend βœ… Complete
REST API βœ… Complete
AI Integration βœ… Complete
Automation Engine βœ… Complete
Queue Workers βœ… Complete
Scheduler βœ… Complete
Database βœ… Complete
Frontend βœ… Complete
Authentication ⏳ Planned
OAuth ⏳ Planned
Analytics ⏳ Planned
Multi Platform Support ⏳ Planned

Running Locally

Clone the repository

git clone https://github.com/Anos714/Xcel.git

cd Xcel

Backend

cd backend

bun install

cp .env.example .env

bun run db:generate
bun run db:migrate

bun run dev

Frontend

cd frontend

bun install

bun run dev

The frontend will be available at:

http://localhost:3000

The backend will be available at:

http://localhost:8080

Environment Variables

Backend

# Server
PORT=8080
NODE_ENV=development
FRONTEND_URL=http://localhost:3000

# Database (Neon PostgreSQL)
DATABASE_URL=<your_neon_connection_string>

# Redis (Upstash)
UPSTASH_REDIS_URL=<your_upstash_redis_url>

# AI
GEMINI_API_KEY=<your_gemini_api_key>
TAVILY_API_KEY=<your_tavily_api_key>

# Publishing
BUFFER_ACCESS_TOKEN=<your_buffer_access_token>
BUFFER_CHANNEL_ID=<your_buffer_channel_id>

Frontend

NEXT_PUBLIC_API_URL=http://localhost:8080

Contributing

Contributions are welcome.

If you'd like to improve Xcel, you can:

  • Build the frontend
  • Add authentication
  • Add OAuth
  • Improve AI prompts
  • Support additional social media platforms
  • Improve scheduling
  • Optimize worker performance
  • Report bugs
  • Submit feature requests
  1. Fork the repository
  2. Create a feature branch
git checkout -b feature/amazing-feature
  1. Commit your changes
git commit -m "feat: add amazing feature"
  1. Push the branch
git push origin feature/amazing-feature
  1. Open a Pull Request

Acknowledgements

Xcel is built using several amazing open-source projects.

  • Bun
  • Next.js
  • Express
  • Drizzle ORM
  • BullMQ
  • PostgreSQL
  • Redis
  • Gemini AI
  • Tavily Search
  • Buffer API

Huge thanks to the maintainers and contributors of these projects.


License

MIT License

Feel free to fork, modify, and build upon this project.

About

An AI-powered X (Twitter) automation engine built with Bun, Next.js, and Express. Automates content discovery via Tavily Search, generates context-aware tweets using Gemini AI, and schedules/publishes automatically using BullMQ queues and Buffer API.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages