A NestJS-powered social media content generator that automates tweet draft creation from your GitHub activity.
- Automated GitHub Activity Fetching: Pulls your public GitHub events (commits, PRs, releases)
- AI-Powered Tweet Generation: Uses Hugging Face Inference API (Mistral-7B) to generate engaging tweet drafts
- Discord Integration: Delivers tweet drafts via rich Discord embeds
- Scheduled Runs: Daily cron job at 9:00 AM (configurable)
- Beautiful Dashboard: Monitor your drafts, activity, and system health at
/dashboard
- NestJS with TypeScript
- Hugging Face Inference API (free tier)
- GitHub REST API (public, no auth required)
- @nestjs/schedule with node-cron
- Discord Webhook
- Tailwind CSS + Lucide Icons (dashboard)
-
Install dependencies:
pnpm install
-
Configure environment variables: Create a
.envfile in the root:GITHUB_USERNAME=your_github_username HF_API_TOKEN=your_huggingface_token DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/... PORT=3000 NODE_ENV=development
-
Get a Hugging Face Token:
- Sign up at https://huggingface.co
- Go to Settings → Access Tokens
- Create a new token with "read" permissions
-
Create a Discord Webhook:
- Open your Discord server settings
- Go to Integrations → Webhooks
- Create a new webhook and copy the URL
# Development
pnpm run start:dev
# Production
pnpm run build
pnpm run start:prodThe dashboard will be available at http://localhost:3000/dashboard
GET /api/stats- Get dashboard statisticsGET /api/drafts- Get recent tweet draftsGET /api/activity- Get recent GitHub activityGET /api/health- Get system health statusPOST /api/trigger- Manually trigger the pipelinePOST /api/drafts/:id/copy- Track copy count
# Unit tests
pnpm run test
# E2E tests
pnpm run test:e2e
# Test coverage
pnpm run test:cov# Build and run with docker-compose
docker-compose up -d
# Or build manually
docker build -t tweetforge .
docker run -p 3000:3000 --env-file .env tweetforgesrc/
├── github/ # GitHub API integration
├── twitter/ # Tweet generation with AI
├── discord/ # Discord webhook delivery
├── scheduler/ # Cron scheduling & pipeline
├── dashboard/ # Dashboard serving
├── common/ # Shared utilities & filters
└── config/ # Environment configuration
MIT