A Node.js app with a React frontend to schedule and post tweets using X's API.
- Clone the repo:
git clone <repo-url>
- Install backend dependencies:
npm install
- Install frontend dependencies:
cd client && npm install
- Set up MongoDB and Redis locally or via cloud services.
- Create a
.env
file (see above). - Get X API credentials from https://developer.twitter.com/.
- Start MongoDB:
mongod
- Start Redis:
redis-server
- Run backend:
npm start
- Run worker:
npm run worker
- Run frontend:
cd client && npm start
GET /auth/twitter
: Start OAuth 2.0 flowGET /auth/twitter/callback
: Handle OAuth callbackPOST /api/schedule-tweet
: Schedule a tweetGET /api/scheduled-tweets
: List pending tweetsDELETE /api/scheduled-tweet/:id
: Delete a tweet
- Use Docker for backend/worker.
- Deploy frontend separately (e.g., Vercel).
- Store tokens securely in a database, not
.env
.
- Replace
your-static-verifier
with a secure OAuth 2.0 code verifier. - Test rate limits with
twitter-api-v2
retry logic.