Content
# SocialPost 🛫
**One API call to post on every social platform.** A full-stack social media publishing platform — post videos, photos, text and documents to **22 networks** (TikTok, Instagram, YouTube, LinkedIn, Facebook, X, Threads, Pinterest, Reddit, Bluesky, Mastodon, Telegram, Discord, Slack, Dev.to, Hashnode, WordPress and more) from a single REST API, dashboard, SDK, or AI agent.
     

## Features
- **One API call, every platform** — `POST /api/upload` (video), `/api/upload_video` (alias), `/api/upload_photos`, `/api/upload_text`, `/api/uploadposts/upload-document` (LinkedIn docs)
- **Auto-adapts content per platform** — grapheme-aware truncation (emoji count correctly 🚀), hashtags → first comment on Instagram, X weighted 280, per-platform `<platform>_title` overrides
- **Scheduling & automation** — ISO-8601 scheduling, per-profile posting queues (timezone, active days, slots), calendar (month/week/day), recurring **content pipelines**, in-process 30s scheduler
- **Analytics & metrics API** — followers/reach/impressions/engagement per platform, time-series charts (Recharts), CSV export, per-post metrics
- **Whitelabel** — profiles API (`user` param), JWT connect-links so your customers link accounts under your brand
- **Full API management** — named API keys (hashed, shown once), request logging, per-plan quotas (429), FFmpeg processing quota, idempotency keys
- **Auth** — Google OAuth + email magic-link/OTP (passwordless), like modern SaaS
- **AI copy assistant** — captions + hashtags (uses `ANTHROPIC_API_KEY` if set, offline heuristic otherwise)
- **Dark/light theme**, sidebar dashboard, notifications, team management, simulated billing with invoices
> Platform connectors are **simulated** behind a clean `publish()` adapter (`src/lib/platforms.ts`) — drop in each network's real API call to go live. Everything else (auth, quotas, scheduling, queues, pipelines, analytics storage, whitelabel JWTs) is fully functional.
## Quick start
```bash
npm install
npx prisma migrate dev # creates prisma/dev.db
npx prisma db seed # demo + admin accounts, sample data
npm run dev # http://localhost:3000
```
**Sign in:** enter your email on `/login` → in dev mode the 6-digit code is shown on screen (no SMTP needed). Seeded accounts: `demo@example.com` and `angch@tertiaryinfotech.com` (admin).
## The lead magnet
```bash
curl \
-H 'Authorization: Apikey your-api-key-here' \
-F 'video=@/path/to/your/video.mp4' \
-F 'title="Your Awesome Title 🚀"' \
-F 'user="your_profile_user"' \
-F 'platform[]=tiktok' \
-F 'platform[]=instagram' \
-F 'platform[]=youtube' \
-X POST http://localhost:3000/api/upload
```
Response: per-platform results with live post URLs. Add `scheduled_date` to schedule, `first_comment` for an auto first comment, `autogenerate=true` for AI copy.
## API surface
| Area | Endpoints |
|------|-----------|
| Upload | `POST /api/upload` · `/api/upload_video` · `/api/upload_photos` · `/api/upload_text` · `/api/uploadposts/upload-document` |
| Manage | `GET /api/uploadposts/status` · `GET /api/uploadposts/history` · `GET/PATCH/DELETE /api/uploadposts/schedule` |
| Queue | `GET/PUT /api/uploadposts/queue/settings` · `POST /api/uploadposts/add_to_queue` |
| Analytics | `GET /api/analytics/{profile}` · `GET /api/uploadposts/post-analytics/{id}` · `GET /api/uploadposts/platform-metrics` · `GET /api/uploadposts/media` |
| Whitelabel | `GET /api/uploadposts/me` · `POST/GET/DELETE /api/uploadposts/users` · `POST .../users/generate-jwt` · `GET .../users/validate-jwt` |
| Processing | `POST /api/uploadposts/ffmpeg/job` · `GET /api/uploadposts/ffmpeg/usage` |
Full docs with parameter tables live at **`/docs`** in the app.
## SDKs & integrations (`sdks/`)
| Package | What it is |
|---------|------------|
| [`sdks/python`](sdks/python) | Python SDK (`pip install -e sdks/python`) — `SocialPostClient` |
| [`sdks/node`](sdks/node) | Node.js SDK (zero-dependency, Node ≥18) — `socialpost-sdk` |
| [`sdks/n8n`](sdks/n8n) | n8n community node + credentials |
| [`sdks/vscode`](sdks/vscode) | VS Code extension — post a selection or file from the editor |
| [`sdks/mcp`](sdks/mcp) | MCP server — lets **GitHub Copilot, Claude, Cursor** post for you |
## Project structure
```
src/
app/ # Next.js App Router
api/ # Public API + auth + internal dashboard routes
(dashboard)/ # users, upload, pipelines, calendar(+queue), history,
# analytics, api-keys, pricing, profile(+invoices),
# team, support, docs, connected-apps
login/ connect/ # passwordless login · whitelabel connect page
page.tsx # landing page (curl lead magnet)
lib/ # platforms registry/adapters, publish engine, queue,
# scheduler, sessions, apikeys, plans, AI copy
components/ # sidebar nav, theme toggle, platform icons, etc.
prisma/ # schema, migrations, seed
sdks/ # python · node · n8n · vscode · mcp
tests/post-course.test.mjs # e2e test: post a course announcement to LinkedIn+Facebook
design-system/ # persisted UI design system (MASTER.md)
```
## Testing
```bash
npm run dev & # start the server
node tests/post-course.test.mjs # 9 end-to-end assertions
```
## Acknowledgements
- Feature set inspired by multi-platform posting APIs; UI is an original design (dark-first, emerald "code" theme, Space Grotesk + JetBrains Mono)
- Built with [Next.js](https://nextjs.org), [Prisma](https://prisma.io), [Tailwind CSS](https://tailwindcss.com), [Recharts](https://recharts.org)
---
Powered by [Tertiary Infotech Academy Pte Ltd](https://www.tertiaryinfotech.com/)