
Cadence
A team workspace for scheduling social posts and publishing them through background jobs that retry when a platform fails
Team
Solo project
My role
Full-Stack Engineering
System Design
Tools
TypeScript
Next.js
NestJS
MongoDB
Redis + BullMQ
Duration
In progress
Overview
Cadence lets a team write posts together, schedule them, and have them published automatically by a background worker that retries when a platform fails. Every attempt is logged, and the dashboard shows each post's status live. Social platforms are mocked in the MVP.
Problem
Small teams that post to social media usually work out of a shared doc and someone's phone, which breaks down in predictable ways:
No shared workflow
Drafts live in different places, with no clear rule for who can edit or publish.
Unreliable publishing
If a platform is down or rate-limits at the scheduled time, the post silently doesn't go out.
No visibility
Nobody can see what's scheduled, what failed, or why without checking each platform by hand.
Goals
The MVP proves a team can schedule posts and trust that they'll publish, or see exactly why they didn't. Real platform integrations, post analytics, and billing are out of scope.
Roles
One workspace, clear permissions
Acme marketing · 3 members
Background worker
Posts publish from a queue, not the API
Launch teaser · 9:00
Retries
Failures retry with backoff
Max 5 attempts
Audit log
Every attempt is on record
Live status
The dashboard updates on its own
Today
Users
The primary user is a content editor on a small marketing team who writes and schedules posts. The workspace owner invites teammates, sets roles, and connects social accounts. Viewers, such as a manager or client, only need to see the schedule and each post's status.
Requirements
The core requirements for the MVP:
- Short-lived JWT access tokens with rotating refresh tokens; reusing an old refresh token revokes the whole token family.
- Every API route checks the caller's role in the target workspace.
- Scheduling a post adds a delayed job; rescheduling replaces it and cancelling removes it.
- Failed publishes retry with exponential backoff, and every attempt is written to an audit log.
- Publishing is idempotent, so a retried job never posts the same content twice.
- The dashboard receives status changes over WebSocket.
Architecture
A Next.js dashboard talks to a NestJS API over REST and WebSocket. The API stores data in MongoDB and adds delayed jobs to a BullMQ queue in Redis. A separate worker process, built from the same codebase, picks up each job, calls the platform, updates the post, and emits a status event. Because the API and worker scale and restart independently, a slow platform never blocks API requests, and Redis runs with append-only persistence so queued jobs survive a restart. A post moves from draft to scheduled to publishing, then to published, or through retrying to failed once its attempts run out.
Success metrics
Proposed targets: 99% of posts start publishing within 5 seconds of their scheduled time, every post recovers when a platform fails fewer times than the retry limit, zero duplicate publishes across retries and worker restarts, and the dashboard reflects a status change in under 2 seconds.
Risks
The biggest risk is a post that publishes twice or not at all without anyone noticing. A worker crash after the platform call can cause a duplicate, so each attempt carries an idempotency key. Using the post id as the job id keeps jobs in sync with edits, and a sweeper re-queues any overdue posts if Redis loses a job.
Next steps
The foundation is done: the monorepo, Docker setup, health checks across MongoDB, Redis, and the queue, a separate worker process, and the web app. Next come auth, workspaces and roles, mock accounts and posts, then scheduling with retries, the live dashboard, media uploads, and deploy.