CodingIdeas.ai
← Browse All Ideas

Build Guide

How to Build a Social Media App

You do not need to build the next Twitter — a niche social app for 10,000 users in one vertical is more valuable and 100× more achievable.

Advanced2–4 weeks

Social apps are the most architecturally complex consumer products: feeds, follows, notifications, media upload, and moderation all interact in non-obvious ways. Build a minimal version and you'll understand how every platform at scale actually works.

Data model

The core tables you'll need before writing any UI.

Userid, username, bio, avatar_url, follower_count, following_count, created_at
Postid, user_id, content, media_urls[], like_count, comment_count, created_at, deleted_at
Followfollower_id, following_id, created_at
Likeuser_id, post_id, created_at
Commentid, post_id, user_id, content, parent_id (for threads), created_at
Notificationid, user_id, type (like/comment/follow/mention), actor_id, post_id, read, created_at

Build order

The sequence that minimises rewrites — build in this order.

1

User profiles and auth

Set up Supabase Auth. Create user profiles with username, bio, and avatar. Add a profile page that shows the user's posts. Build follow/unfollow — a simple join table between two user IDs.

2

Post creation

Build a post composer: text input, image upload (to Supabase Storage or Cloudinary), submit button. On submit: insert the post, update the user's post count, fan out to followers' feeds.

3

Feed — chronological first

Build the home feed as a simple query: SELECT posts WHERE user_id IN (following list) ORDER BY created_at DESC LIMIT 20. Get this working before any algorithm. Pagination via cursor (last post ID), not offset.

4

Likes and comments

Add like toggle — check if a like exists, insert or delete. Increment/decrement like_count on the post (denormalised for fast reads). Comments are just posts with a parent_id. Support one level of nesting first.

5

Notifications

Create a notifications table. On like: insert a notification for the post owner. On follow: insert a notification. On comment: insert a notification. Show an unread count badge in the nav. Mark all read on open.

6

Media upload

On image select, upload to Supabase Storage. Get back a public URL. Store URLs in the post's media_urls array. Show image previews in the composer before posting. Limit to 4 images per post.

7

Content moderation

Add a report button on posts and profiles. Store reports in a reports table. Build a simple /admin/reports queue that lets you review and delete reported content or ban users.

Build it with AI — Architect Prompt

Paste this into Claude, Cursor, Windsurf, or any AI coding tool. It includes the full context of this guide — data model, build order, and pitfalls — so the AI starts with everything it needs.

ClaudeCursorWindsurfCopilotGemini
architect-prompt.txt
<context>
App: Social Media App
Difficulty: Advanced
Estimated build time: 2–4 weeks

Data model:
  User: id, username, bio, avatar_url, follower_count, following_count, created_at
  Post: id, user_id, content, media_urls[], like_count, comment_count, created_at, deleted_at
  Follow: follower_id, following_id, created_at
  Like: user_id, post_id, created_at
  Comment: id, post_id, user_id, content, parent_id (for threads), created_at
  Notification: id, user_id, type (like/comment/follow/mention), actor_id, post_id, read, created_at

Recommended build order:
  1. User profiles and auth — Set up Supabase Auth. Create user profiles with username, bio, and avatar. Add a profile page that shows the user's posts. Build follow/unfollow — a simple join table between two user IDs.
  2. Post creation — Build a post composer: text input, image upload (to Supabase Storage or Cloudinary), submit button. On submit: insert the post, update the user's post count, fan out to followers' feeds.
  3. Feed — chronological first — Build the home feed as a simple query: SELECT posts WHERE user_id IN (following list) ORDER BY created_at DESC LIMIT 20. Get this working before any algorithm. Pagination via cursor (last post ID), not offset.
  4. Likes and comments — Add like toggle — check if a like exists, insert or delete. Increment/decrement like_count on the post (denormalised for fast reads). Comments are just posts with a parent_id. Support one level of nesting first.
  5. Notifications — Create a notifications table. On like: insert a notification for the post owner. On follow: insert a notification. On comment: insert a notification. Show an unread count badge in the nav. Mark all read on open.
  6. Media upload — On image select, upload to Supabase Storage. Get back a public URL. Store URLs in the post's media_urls array. Show image previews in the composer before posting. Limit to 4 images per post.
  7. Content moderation — Add a report button on posts and profiles. Store reports in a reports table. Build a simple /admin/reports queue that lets you review and delete reported content or ban users.

Known pitfalls to avoid:
  - Building a fan-out-on-write feed for large accounts — if a user has 1 million followers and posts, writing to 1M feed rows is slow. Use a hybrid: fan-out for small accounts, fan-in (query at read time) for accounts above a threshold.
  - Using OFFSET for pagination — page 100 with OFFSET 2000 requires the DB to scan 2000 rows to skip them. Use cursor-based pagination: WHERE id < last_seen_id ORDER BY id DESC LIMIT 20.
  - Storing like counts only in the likes table — counting likes with COUNT(*) on every feed load is slow. Keep a denormalised like_count on the post row and increment/decrement it atomically with each like/unlike.

Tech stack (intermediate): Next.js + Supabase (auth + DB + Realtime) + Cloudinary — niche community MVP in 2 weeks
</context>

<role>
You are a Senior Full-Stack Engineer and product architect who has shipped production Social Media Apps before. You know exactly where developers get stuck and how to structure the project to avoid rewrites.
</role>

<task id="step-1-clarify">
Before writing any code or spec, ask me 3–5 clarifying questions that will meaningfully change the architecture. Focus on: scale expectations, auth requirements, platform (web / mobile / both), must-have vs nice-to-have features for the MVP, and any hard constraints (budget, deadline, existing infrastructure).

<example>
BAD: "What tech stack do you want to use?" — too broad, doesn't change architecture decisions.
GOOD: "Do you need real-time sync across devices, or is single-device with periodic refresh acceptable? This decides whether we use WebSockets or simple REST polling and significantly affects infrastructure complexity."
</example>
</task>

<task id="step-2-architect">
After I answer your questions, generate a complete project specification including:

1. Final tech stack with version numbers
2. Full file and folder structure
3. Complete database schema — every table, column, type, index, and foreign key
4. All API routes with request/response shapes and auth requirements
5. Component tree with TypeScript props interfaces
6. Auth and authorisation flow (who can do what)
7. Step-by-step implementation plan in the exact build order from <context> above
8. All environment variables with descriptions

<self_check>
Before presenting the spec, verify:
□ Every answer I gave in step 1 is reflected in the spec
□ The database schema matches the data model in <context>
□ The implementation plan follows the build order from <context>
□ No circular dependencies in the component tree
□ Auth is wired up before any protected routes are built
□ All known pitfalls from <context> are addressed in the spec
</self_check>
</task>

<task id="step-2.5-agents-md">
Generate an AGENTS.md file at the project root. This file is read automatically by Claude Code, Cursor, Windsurf, Sourcegraph Cody, and all major AI coding tools at the start of every session.

Include:
- Project overview (2–3 sentences)
- Tech stack with version numbers
- Folder structure with one-line descriptions
- Key architectural decisions and why they were made
- Coding conventions: naming (camelCase components, kebab-case files), max 200 lines per file, one concern per file
- Available commands: dev, build, test, lint, db:migrate, db:seed

Note in the file: "Cursor users can symlink .cursorrules → AGENTS.md. Claude Code users can symlink CLAUDE.md → AGENTS.md."
</task>

<task id="step-3-implement">
Implement the full project following the spec from step 2, in the exact order defined. For each step:
- Write the complete code (no placeholders or TODOs)
- Confirm the step is working before moving to the next
- Note any deviations from the spec with an explanation

<constraints>
- Max 200 lines per file. WHY: every file must fit in one AI context window for easy review and editing.
- One concern per file. WHY: mixing auth logic into API routes makes it impossible to reuse — extract to lib/auth.ts.
- TypeScript strict mode, no `any` types. WHY: catches data shape mismatches at compile time, not in production at 2am.
- All database queries in server components or API routes only. WHY: keeps credentials server-side, prevents accidental client-side exposure.
- All environment variables documented in .env.example. WHY: the next developer (or your future self) should be able to set up the project in under 5 minutes.
- Comment every non-obvious decision. WHY: AI tools read your comments to understand intent — without them, the next edit will break the pattern you established.
</constraints>
</task>

How to use this prompt

  1. 1.Copy the prompt above
  2. 2.Open Claude, Cursor (Cmd+L), or Windsurf
  3. 3.Paste the prompt and send — the AI will ask 3–5 clarifying questions
  4. 4.Answer the questions, then it generates your full project spec
  5. 5.Continue in the same session to implement step by step

Common mistakes

What trips up most developers building this for the first time.

⚠️

Building a fan-out-on-write feed for large accounts — if a user has 1 million followers and posts, writing to 1M feed rows is slow. Use a hybrid: fan-out for small accounts, fan-in (query at read time) for accounts above a threshold.

⚠️

Using OFFSET for pagination — page 100 with OFFSET 2000 requires the DB to scan 2000 rows to skip them. Use cursor-based pagination: WHERE id < last_seen_id ORDER BY id DESC LIMIT 20.

⚠️

Storing like counts only in the likes table — counting likes with COUNT(*) on every feed load is slow. Keep a denormalised like_count on the post row and increment/decrement it atomically with each like/unlike.

Recommended tech stack

Pick the level that matches your experience.

Intermediate

Next.js + Supabase (auth + DB + Realtime) + Cloudinary — niche community MVP in 2 weeks

Advanced

Next.js + Supabase + Redis (feed caching) + BullMQ (notification queue) + Cloudflare R2 (media)

Take it further — related ideas

Each comes with revenue math, a full build guide, and a prompt to paste into Claude or Cursor.

9 ideas in the archive

Ship in:
intermediateNLP & Text AI

HireSignal - NLP Job Posting Intent Classifier That Predicts Which Roles Are Actually Hiring

Recruiters and job seekers waste weeks applying to ghost postings — jobs that are perpetually open because the company is collecting resumes, not hiring. HireSignal runs NLP intent classification on job postings to score the real hiring urgency, detect ghost listings, and surface only roles where a company is actively filling a seat right now.

Time to ship3 weeks
DemandVery High
Revenue8/10
AI quality score7/10
View Details →
beginnerDeveloper Tools

ReleaseVoice - AI Changelog Writer That Actually Sounds Like Your Brand

Every SaaS founder dreads writing the changelog — it either sounds like a GitHub commit dump or a corporate press release. ReleaseVoice takes your merged PRs and Jira tickets, learns your brand voice from past blog posts, and writes a customer-facing changelog that people actually read. Ship features and the announcement in the same deploy.

Time to ship1 week
DemandHigh
Revenue6/10
AI quality score8/10
View Details →
intermediateMCP & Integrations

ReplayIQ - MCP Server That Injects Live PostHog Session Replay Context Into Claude for Instant UX Diagnosis

You can watch session replays in PostHog all day but Claude has no idea what your users are actually doing. ReplayIQ is an MCP server that pulls live PostHog session replay metadata, event sequences, and rage-click hotspots into Claude's context so you can ask it to diagnose UX failures in plain English. It's like giving Claude eyes on your product.

Time to ship2 weeks
DemandHigh
Revenue7/10
AI quality score8/10
View Details →
intermediateNLP & Text AI

ScopeCast - NLP Feedback Intent Classifier That Turns User Emails Into Prioritized Backlog Items

Product teams drown in unstructured user feedback emails, Intercom threads, and App Store reviews — none of which maps cleanly to a backlog. ScopeCast classifies every piece of feedback by intent (bug, feature request, churn signal, praise), extracts the core ask, and pushes a structured ticket to Linear or Jira automatically. Finally, your inbox becomes a roadmap.

Time to ship3 weeks
DemandHigh
Revenue8/10
AI quality score7/10
View Details →
beginnerEducation

FieldPath - Curated Learning Paths for Any Technical Field in 60 Seconds

Developers waste hours stitching together Google Scholar tabs, Reddit threads, and Notion docs just to onboard into a new field. FieldPath takes a topic input and spits out a structured, AI-curated reading list with summaries, community signals, and export-to-Notion — in under a minute. It's the research rabbit hole, minus the hole.

Time to ship2 weeks
DemandVery High
Revenue7/10
AI quality score7/10
View Details →
intermediateMCP & Integrations

PodCraft MCP - Live Podcast Research Context Server for Claude and Cursor

Podcast hosts prep for interviews by spending 3 hours reading old episodes and guest bios. PodCraft is an MCP server that ingests your podcast RSS feed, transcribes episodes, and gives Claude or Cursor instant access to your entire show history as searchable context — so you can ask Claude to write episode briefs, generate guest questions, or find contradictions across 200 episodes in 10 seconds.

Time to ship2 weeks
DemandMedium
Revenue7/10
AI quality score8/10
View Details →
intermediateMobility & Transport

NightRide - Peer Rideshare Matcher for Post-Midnight Commuters

It's 1am, Uber wants $60, and the last train just left. NightRide matches verified strangers heading the same direction after midnight and splits the fare automatically. Carpooling meets trust infrastructure for the late-shift, nightlife, and rural commuter crowd.

Time to ship3 weeks
DemandVery High
Revenue8/10
AI quality score9/10
View Details →
intermediateSaaS

ShiftFill - Self-Service Shift Swap Marketplace for Hourly Retail and Hospitality Teams

Shift managers at retail and restaurant chains spend 2 hours every Sunday texting staff to fill open shifts because their scheduling software has no self-service swap layer. ShiftFill is a mobile-first marketplace where employees post and claim open shifts in real time with manager approval in one tap.

Time to ship3 weeks
DemandVery High
Revenue8/10
AI quality score7/10
View Details →
beginnerAI Agents & RAG

DeckGrade - AI Pitch Deck Structure Grader That Thinks Like a VC Partner

You spent three weeks on your pitch deck and the only feedback you got was 'needs more traction' from a friend who has never raised money. DeckGrade analyzes your deck slide by slide against proven VC narrative frameworks and tells you exactly which slides are killing your chances before you send the cold email.

Time to ship1 week
DemandHigh
Revenue6/10
AI quality score8/10
View Details →