Skip to content

kentzu213/auto-post-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Auto-Post Tool

The Ultimate AI-Powered Multi-Platform Social Media Automation Engine

Schedule, generate, and auto-publish content across Facebook, YouTube & TikTok β€” from one dashboard.

TypeScript NestJS Next.js Prisma BullMQ License: MIT CI

Demo Β· Features Β· Architecture Β· API Docs Β· Contributing


🎯 Why Auto-Post Tool?

Building a social media presence across multiple platforms is exhausting. You need to:

  • ✍️ Write platform-optimized captions for each channel
  • πŸ“… Schedule posts at optimal times across timezones
  • 🎬 Re-encode videos for each platform's specs
  • πŸ’¬ Monitor and reply to comments from 3+ dashboards
  • πŸ“Š Track analytics scattered across different apps

Auto-Post Tool solves all of this in one place β€” with AI-powered content generation, intelligent scheduling, and automated multi-platform publishing.


✨ Features

πŸ€– AI Content Engine (3 Providers)

Provider Models Features
Google Gemini gemini-2.0-flash Caption, hashtags, hook generation
OpenAI GPT-4o + Whisper Content + subtitle transcription
Anthropic Claude Claude Sonnet 4 Premium content generation
  • 🌐 i18n Translation β€” Translate posts to any language instantly
  • πŸ’­ Sentiment Analysis β€” Analyze audience tone before publishing
  • 🎯 Platform-Specific Prompts β€” Optimized for Facebook, YouTube, TikTok

πŸ“± Multi-Platform Publishing

Platform Content Types Features
Facebook Feed, Reels, Story Graph API v22.0, 3-phase Reels upload
YouTube Videos, Shorts Resumable Upload, thumbnail support
TikTok Videos Content Posting API, Inbox Draft mode

🎬 Media Pipeline (FFmpeg)

  • Platform-Specific Presets β€” Auto-transcode to each platform's optimal codec/bitrate/resolution
  • Auto-Reframe 9:16 β€” Horizontal β†’ vertical crop for Reels/Shorts/TikTok
  • Long-to-Short β€” Split long videos into viral short clips
  • Whisper Subtitles β€” Auto-generate SRT subtitles from audio

πŸ“Š Analytics & Insights

  • Real-time dashboard with stats grid
  • Platform breakdown charts
  • Publishing heatmap (best times to post)
  • Campaign KPI tracking

πŸ›‘οΈ Enterprise Security

  • πŸ” JWT + refresh token authentication
  • πŸ”’ AES-256-GCM token encryption
  • πŸ›‘οΈ Helmet HTTP security headers
  • ⚑ Rate limiting (100 req/60s)
  • 🚫 CORS whitelist (no wildcards)
  • βœ… Input validation (class-validator)
  • πŸ“„ Swagger protected in production

πŸ—οΈ Architecture

auto-post-tool/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ api/          # NestJS backend (REST API + Swagger)
β”‚   β”œβ”€β”€ web/          # Next.js 14 frontend (App Router)
β”‚   └── worker/       # BullMQ background job processor
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ shared-types/ # Shared TypeScript interfaces
β”‚   └── ui/           # Shared UI components
β”œβ”€β”€ docker/           # Docker configs
└── .github/          # CI/CD workflows

Tech Stack

Layer Technology
Backend NestJS 10 + TypeScript 5
Frontend Next.js 14 + React 18 + Zustand
Database PostgreSQL 16 + Prisma ORM
Queue Redis 7 + BullMQ
AI Gemini + OpenAI + Claude
Media FFmpeg + Whisper API
Monitoring OpenTelemetry + Bull Board
CI/CD GitHub Actions
Package Manager pnpm + Turborepo

πŸš€ Quick Start

Prerequisites

  • Node.js β‰₯ 18
  • pnpm β‰₯ 9
  • Docker & Docker Compose
  • FFmpeg (optional, for media pipeline)

1. Clone & Install

git clone https://github.com/YOUR_USERNAME/auto-post-tool.git
cd auto-post-tool
pnpm install

2. Start Infrastructure

docker compose up -d  # PostgreSQL + Redis + MinIO

3. Configure Environment

cp .env.example .env
# Edit .env with your API keys and credentials

4. Setup Database

cd apps/api
npx prisma db push
npx prisma generate

5. Launch πŸš€

# Terminal 1 β€” API Server
cd apps/api && pnpm run dev

# Terminal 2 β€” Web Frontend
cd apps/web && pnpm run dev
Service URL
🌐 Frontend http://localhost:3005
πŸ”Œ API http://localhost:3001
πŸ“„ Swagger http://localhost:3001/docs
πŸ“Š Bull Board http://localhost:3001/admin/queues
❀️ Health Check http://localhost:3001/health

πŸ“š API Documentation

Full interactive API docs available at /docs when running in development mode.

Key Endpoints

Method Endpoint Description
POST /ai/generate Generate caption, hashtags, hook
POST /ai/translate Translate content (i18n)
POST /ai/sentiment Analyze text sentiment
POST /media/transcode Platform-specific video transcode
POST /media/reframe Auto-reframe 16:9 β†’ 9:16
POST /media/long-to-short Split video into short clips
POST /media/subtitles Generate subtitles (Whisper)
GET /posts List all posts
POST /posts Create & schedule post
GET /analytics/dashboard Dashboard stats
GET /campaigns List campaigns
GET /health Server health check

πŸ§ͺ Testing

# Run all tests
cd apps/api && pnpm test

# Run with coverage
cd apps/api && pnpm test -- --coverage

# Run specific test
npx jest --testPathPattern="ai.service"

Current: 31 tests across 5 suites β€” all passing βœ…


🐳 Docker Deployment

Development

docker compose up -d

Production

docker compose -f docker-compose.prod.yml up -d

πŸ“‚ Environment Variables

See .env.example for all required variables:

Variable Required Description
DATABASE_URL βœ… PostgreSQL connection string
REDIS_HOST βœ… Redis host for BullMQ
JWT_SECRET βœ… JWT signing secret
ENCRYPTION_KEY βœ… AES-256 key for token storage
GEMINI_API_KEY ⬜ Google Gemini API key
OPENAI_API_KEY ⬜ OpenAI API key (GPT + Whisper)
ANTHROPIC_API_KEY ⬜ Anthropic Claude API key
FACEBOOK_CLIENT_ID ⬜ Meta App ID
GOOGLE_CLIENT_ID ⬜ Google OAuth client ID
TIKTOK_CLIENT_KEY ⬜ TikTok App key

πŸ—ΊοΈ Roadmap

  • Multi-platform publishing (Facebook, YouTube, TikTok)
  • AI content generation (Gemini, OpenAI, Claude)
  • Platform-specific FFmpeg presets
  • Long-to-short video pipeline
  • Whisper subtitle generation
  • i18n translation
  • Sentiment analysis
  • Instagram support
  • Smart auto-reframe (face detection)
  • A/B testing for posts
  • Team collaboration & approval workflow UI
  • Mobile app (React Native)
  • Webhook integrations
  • RSS-to-post automation

🀝 Contributing

Contributions are welcome! Please read the ARCHITECTURE.md before submitting PRs.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


Built with ❀️ by NgNghia213

⭐ Star this repo if you find it useful! ⭐

Report Bug Β· Request Feature

About

πŸš€ AI-Powered Multi-Platform Social Media Automation Engine β€” Schedule, generate & auto-publish to Facebook, YouTube & TikTok from one dashboard. Built with NestJS + Next.js + Prisma + BullMQ + 3 AI Providers (Gemini/OpenAI/Claude)

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors