How izecrypt/socialautomation works
Purpose and Entry Points
Crypto Pulse is a Next.js application that turns crypto/AI RSS news into reviewed, scheduled social posts for X, Telegram, Instagram, TikTok, and YouTube Shorts. Its operator interface starts at src/app/dashboard/page.tsx; API routes serve cron, Make.com automation, direct publishing, and AI generation under src/app/api/.
Persistence and Domain Backbone
Postgres is the system of record, accessed through Prisma. The schema models RSS sources/items, generated posts, queue/publication state, settings, and logs; seed data establishes initial sources and defaults.
• prisma/schema.prisma
• prisma/seed.ts
• src/lib/db.ts
RSS Intake, Qualification, and Inbox
News enters either through authenticated Make.com webhook delivery or the internal cron fetch endpoint. Ingestion normalizes and persists items, rejects duplicates, detects configured keywords, scores relevance, and applies niche rules before eligible stories enter the content workflow.
• src/app/api/webhooks/rss-item/route.ts
• src/app/api/cron/fetch-rss/route.ts
• src/lib/rss/ingest.ts
• src/lib/rss/fetcher.ts
• src/lib/deduplication/index.ts
• src/lib/scoring/relevance.ts
AI Content and Media Pipeline
A selected RSS item is expanded into platform-specific copy, scripts, and image prompts. The provider layer uses OpenAI when configured and mock content otherwise. Optional media generation produces images, TTS narration, scenes, and ffmpeg-composed video assets for video platforms.
• src/app/api/ai/generate-from-rss/[rssItemId]/route.ts
• src/lib/ai/generator.ts
• src/lib/ai/provider.ts
• src/lib/ai/video.ts
• src/app/api/ai/generate-video/[postId]/route.ts
Review, Queueing, and Scheduling
Generated content receives a risk classification and moves through manual or headless approval into a publishable queue. Queue selection enforces per-platform cadence and configured limits before returning the next eligible post. Dashboard server actions and pages provide the operating surface for inbox, generated content, queue, settings, and logs.
• src/app/api/ai/risk-check/[generatedPostId]/route.ts
• src/app/api/queue/approve/[postId]/route.ts
• src/app/api/queue/next-post/route.ts
• src/lib/queue/selector.ts
• src/lib/scheduling/enforcement.ts
• src/app/dashboard/content-queue/page.tsx
Publication and Automation Boundary
Make.com is the principal external orchestration boundary: it retrieves approved posts, publishes through Buffer/Publer or other configured workflows, then records success/failure or platform callbacks. Telegram and Discord also have direct publish routes backed by platform clients. Shared webhook and rate-limit utilities protect machine-facing endpoints.
• src/app/api/queue/mark-posted/route.ts
• src/app/api/webhooks/platform-response/route.ts
• src/app/api/telegram/publish/[postId]/route.ts
• src/app/api/discord/publish/[postId]/route.ts
• src/lib/security/webhook.ts
Runtime and Deployment
The runtime is Node.js 20+ with Next.js, Prisma/PostgreSQL, and optional OpenAI plus local ffmpeg. Local infrastructure is defined by Docker Compose; production materials indicate PM2/Nginx and a cron caller for RSS fetching. Generated video files are served/stored under the public media tree.
• docker-compose.yml
• ecosystem.config.cjs
• public/media/videos
• docs/deployment.md
Main entry points: schema.prisma Postgres / Prisma · route.ts AI Post Generation · video.ts Video Generation · ingest.ts Ingestion & Qualification
Components 19
Operator Surface
- Dashboard · Operator workspace for inbox, content, queue, settings, and logs.
src/app/dashboard/page.tsx - Content Queue
src/app/dashboard/content-queue/page.tsx
Content Pipeline
- RSS Webhook
src/app/api/webhooks/rss-item/route.ts - RSS Fetch Cron
src/app/api/cron/fetch-rss/route.ts - RSS Fetcher
src/lib/rss/fetcher.ts - Ingestion & Qualification · Normalizes, deduplicates, scores, and qualifies incoming stories.
src/lib/rss/ingest.ts - Relevance Scoring · Applies configured keywords and niche rules.
src/lib/scoring/relevance.ts - AI Post Generation · Expands selected RSS items into platform-specific copy and scripts.
src/app/api/ai/generate-from-rss/[rssItemId]/route.ts - AI Provider · Uses OpenAI when configured, otherwise mock content.
src/lib/ai/provider.ts - Video Generation · Creates images, narration, scenes, and ffmpeg-composed video.
src/lib/ai/video.ts - Risk Check · Classifies generated content risk before approval.
src/app/api/ai/risk-check/[generatedPostId]/route.ts - Approval · Moves reviewed or headlessly approved posts into the queue.
src/app/api/queue/approve/[postId]/route.ts - Queue Selection · Selects the next eligible post under cadence and limit rules.
src/lib/queue/selector.ts
Publishing Automation
- Make.com · Delivers RSS and retrieves or publishes approved posts.
- Publication Status · Records publisher results and platform callbacks.
src/app/api/queue/mark-posted/route.ts - Direct Publishers · Publishes directly to Telegram or Discord.
src/app/api/telegram/publish/[postId]/route.ts
Runtime
- Postgres / Prisma · Stores sources, RSS items, posts, queue state, settings, and logs.
prisma/schema.prisma - Video Media
public/media/videos - Deployment Runtime · Docker locally; PM2, Nginx, and cron in production.
docs/deployment.md
Connections 23
- Make.com → RSS Webhook: RSS delivery
- RSS Webhook → Ingestion & Qualification: ingest item
- RSS Fetch Cron → RSS Fetcher: fetch feeds
- RSS Fetcher → Ingestion & Qualification: feed items
- Ingestion & Qualification → Relevance Scoring: qualify
- Relevance Scoring → Postgres / Prisma: eligible items
- Dashboard → Postgres / Prisma: operate content
- Dashboard → AI Post Generation: generate
- AI Post Generation → AI Provider: copy and scripts
- AI Post Generation → Postgres / Prisma: generated posts
- AI Post Generation → Video Generation: video requests
- Video Generation → Video Media: rendered assets
- Video Generation → Postgres / Prisma: asset metadata
- AI Post Generation → Risk Check: generated content
- Risk Check → Approval: review result
- Content Queue → Approval: manual approval
- Approval → Postgres / Prisma: queue state
- Make.com → Queue Selection: request next post
- Queue Selection → Postgres / Prisma: cadence and limits
- Make.com → Publication Status: publish result
- Direct Publishers → Publication Status: delivery status
- Publication Status → Postgres / Prisma: publication logs
- Deployment Runtime → RSS Fetch Cron: scheduled invocation