AI-assisted X growth and monetization platform.
xtweetly helps creators and teams connect multiple X accounts, generate strategy-aware tweet drafts with AI, automate posting flows, and optimize for measurable growth and revenue over time.
apps/web- Vite + React landing/admin frontendapps/api- Fastify API (/api/v1/*) for auth, accounts, preview, posting, and job triggersapps/worker- tweet orchestration worker (run-once) with policy checks and strategy execution
packages/shared- shared types and schemaspackages/db- Drizzle + SQLite schema and repositories
- Connect one or more X accounts.
- Configure account-level strategy (static or AI-assisted).
- Generate previews and publish/schedule tweets.
- Run orchestration (
run-onceor cron) to execute eligible posts. - Track attempts and iterate toward higher engagement and conversion.
- Node.js 20+
- pnpm 10+
- Install dependencies
pnpm install- Configure environment files
cp apps/api/.env.example apps/api/.env
cp apps/worker/.env.example apps/worker/.env- Set required values in
.env
INTERNAL_API_KEYX_CLIENT_IDX_CLIENT_SECRETX_REDIRECT_URIOPENROUTER_API_KEYSQLITE_PATH(if you want a custom location)
- Run apps in development
pnpm --filter @xtweetly/api dev
pnpm --filter @xtweetly/web dev
pnpm --filter @xtweetly/worker devOr run the whole monorepo in parallel:
pnpm devpnpm build
pnpm typecheckBase path: /api/v1
GET /auth/x/startGET /auth/x/callbackGET /accountsPOST /accountsPATCH /accounts/:username/strategyPOST /accounts/:username/previewPOST /accounts/:username/tweetsPOST /jobs/run-onceGET /attempts
Protected endpoints require:
Authorization: Bearer <INTERNAL_API_KEY>- Executes orchestrator once per run (
run-once) - Applies anti-spam controls (daily limit, cooldown, duplicate prevention)
- Supports
staticandaistrategies - Use cron/systemd with
node dist/app/run-once.jsfor production scheduling
- Frontend style and system notes:
apps/web/DESIGN.md - Landing page messaging is focused on account growth + monetization via AI automation
- Architecture overview:
docs/architecture.md
- Never commit
.envfiles or API keys. - Rotate
INTERNAL_API_KEYand provider keys regularly. - Restrict callback URLs and API origins in production.