Social post is a social media management platform for Facebook and Instagram, made for agencies that run several client brands at once. In this post I'll walk through the problem, how a post moves through the system, the technology behind it, and a few decisions I'm proud of. I'll also be honest about what isn't finished.

Dashboard of a test account

1. The problem

An agency running social media for several brands needs one place to create posts, get them approved by the right people, schedule them and publish them. Without that, captions live in chats, nobody is sure what has been approved, and a wrong post on a client's account is public and hard to undo.

SocialPost puts that whole workflow in one system.

2. How a post moves through the system

  1. A creator writes a draft with media, a caption for each platform, and an optional first comment.
  2. They submit it, and it goes to audit review, which needs approvals from N of M distinct auditors.
  3. If the client requires it, an admin approves next, then the client can approve too.
  4. Once approved, it has a scheduled time, and the scheduler publishes it.
  5. It ends as posted, partially posted or failed. Any reviewer can reject it along the way.

The approval rules are set per client. When a post is submitted, the rules are copied onto it, so a post already in review keeps its rules even if the client's approval flow is edited later.

Published Post page of a test account

3. What it does

  • Content calendar with month and week views and rescheduling
  • Post composer with per-platform captions, first comments, Reels and Instagram collaborators
  • Media library per client, with tags and reuse
  • Customisable approval flow per client
  • Automatic scheduled publishing, with retry for a failed destination
  • Internal discussion on each post, with @mentions and full revision history
  • Reading and moderating Facebook and Instagram comments
  • Daily-synced analytics and insights
  • In-app notifications and queued emails
  • Invitations, password reset and bulk actions
  • Optional AI writing helpers, and an MCP server for AI assistants (more on that below)

4. Many clients, one platform

SocialPost is multi-tenant. There are five roles: creator, auditor, admin, super admin and client. Every client-scoped request has to declare which client it is for, and the backend refuses it unless the person is allowed to act for that client. Method-level permission rules back this up in the service layer, so they hold no matter which screen or API call triggers an action.

5. The technology

  • Backend: Java 17, Spring Boot 3.5, Spring Security, Spring Data JPA
  • Data: PostgreSQL 16 with Flyway, and Redis 7
  • Media: Cloudflare R2 and Cloudinary
  • Frontend: React 19 with Vite, React Router and Recharts
  • Delivery: Docker, GitHub Actions, Nginx, and Sentry for monitoring. I wrote about the pipeline in my CI/CD article.

6. Engineering decisions I'm proud of

Never publish twice. Publishing a post is split into three steps: claim the job, call Meta, record the result. Each step is committed separately, and no database transaction stays open while calling Meta. If a job's outcome is unclear, for example after a timeout, it goes to manual review and is never retried automatically. A person occasionally has to check a post, and that's a deliberate trade-off against ever publishing the same post twice.

One backend instance, on purpose. A single backend container runs the scheduler. Running two side by side would risk double publishing, so I accepted a short restart gap on each deploy.

Migrations only add. A rollback restores the old app but not the old database, so migrations may only add things, and CI enforces it. Renaming or dropping a column takes two or three releases.

People stay in charge of AI. The MCP server lets assistants like Claude read the calendar, plan content and create drafts. Assistants run as the signed-in person through the same services the web app uses, are limited by that person's role, and have no tools to publish, approve or delete. MCP clients need Client ID Metadata Documents, which Spring Authorization Server didn't support, so I built my own OAuth 2.1 server with PKCE required, short-lived tokens, and refresh tokens that rotate.

7. Problems that taught me the most

  • Surviving crashes. Jobs stuck in processing are recovered after 15 minutes, and a circuit breaker stops calling a platform that keeps failing.
  • Facebook Stories. Meta says Story media can't have been used before, without defining what counts, so the fix re-encodes a separate copy for the Story.
  • OAuth connect flows. The state value is single-use, tied to a browser cookie and consumed atomically. If Redis is down, the flow fails closed.
  • Token health. Social account tokens are checked daily, and the app warns before publishing starts failing.

8. By the numbers

  • 53 database migrations and about 40 tables
  • 37 REST controllers and 13 scheduled jobs
  • 43 frontend pages
  • Over 1,600 backend tests and 438 frontend unit tests
  • 128 commits since April

9. What isn't finished

  • There are no end-to-end tests yet, and no coverage tool.
  • The client approval view is read-only for now, and a "changes requested" outcome doesn't exist yet.
  • Encryption key rotation is designed but not done.
  • Facebook Stories made from a Feed post still need confirming on a real page.

What I'm working on next

I'm exploring a WhatsApp channel for drafting and approvals, with the plan of using Meta's official API. After that I want to let clients connect their own AI assistants.

If you've built a scheduling system or a multi-tenant app, I'd like to hear what you'd do differently. You can find me on X and GitHub.