Project 3 of 7About 2 weeks, 35-45 hours

Inkwell

A multi-user blog platform with auth, a database and uploads

Build a publishing platform where anyone can sign in with GitHub, write posts in markdown, add images and publish them. It's your first real backend, and its real subject is security: the server checks everything.

What it proves: you can design a schema, protect routes, validate input on the server, and ship a database-backed app — the baseline for every junior full-stack role.

What you're building

Inkwell is a blog platform for many writers. A visitor lands on a feed of the latest published posts, scrolls to load more, searches by keyword, and opens a post at a clean URL like /posts/why-i-love-postgres. A writer signs in with GitHub, opens an editor with markdown on the left and a live preview on the right, drops in a cover image, and watches "Saved" appear every few seconds while they type. When they're ready they press Publish. Until then, the draft is invisible to everyone else, even someone who guesses its URL.

This is the first project where your mistakes can hurt other people. In DevBoard a bug annoyed one user: you. Here a missing check lets a stranger edit someone else's post, and a careless markdown renderer runs an attacker's script in every reader's browser. So the code is only half the work. The other half is a habit: the server trusts nothing the browser sends.

Features

  • Sign in with GitHub; your user row is created the first time you sign in
  • A Postgres schema of users, posts and tags, built around the queries the app runs
  • A post API (create, read, update, delete) where every write checks who you are and whether you own the post
  • A markdown editor with live preview, sanitised output and autosave
  • Cover images and inline images uploaded straight to object storage
  • A feed with cursor pagination, plus full-text search
  • Drafts, published and archived posts, with drafts hidden from every public path
  • Per-post titles, descriptions, generated share images and a sitemap
  • Separate dev and prod environments, with migrations and secrets kept out of git

The stack

PieceUseWhy
FrameworkNext.js App Router with TypeScriptPages, API routes and server code in one project and one deploy.
API styleRoute Handlers (app/api/.../route.ts)Plain HTTP endpoints you can hit with curl and test. Server Actions are the common alternative; they're public endpoints too and need exactly the same checks.
DatabasePostgres: local in Docker for dev, Neon for prodThe most widely used open-source relational database, with full-text search built in. Supabase or any hosted Postgres works the same way.
ORM and migrationsDrizzle ORM and drizzle-kitReads like SQL, so you learn SQL. It also handles the generated search column you'll need later. Prisma is the popular alternative.
AuthAuth.js (next-auth v5) with the GitHub providerOAuth done by a maintained library. Firebase Auth is the managed alternative.
ValidationZodOne schema per request body, checked on the server.
Markdownreact-markdown, remark-gfm, rehype-sanitizeMaintained parsers, and a sanitiser you can point to.
ImagesAn S3 bucket via the AWS SDK presignerThe standard presigned-URL pattern. Cloudflare R2 speaks the same API; UploadThing wraps it for you.
HostingVercelBuilt by the Next.js team, with separate Production and Preview settings.

How it fits together

 browser ──(cookie)──► Next.js on Vercel
   │                     ├─ pages (server components)
   │                     ├─ /api/posts  ──► auth() ─► zod ─► Drizzle ─► Postgres
   │                     ├─ /api/auth/* (Auth.js) ◄──► GitHub OAuth
   │                     └─ /api/uploads ─► signs an upload URL
   │                                              │
   └──────── PUT image bytes directly ───────────►  S3 bucket
                                                (only the URL is saved)

Follow one action: a writer edits a draft and pauses typing. After two seconds the editor sends PATCH /api/posts/42 with the new title and content. The route handler calls auth() to read the session from the cookie and gets the user's id, or rejects the request with 401. It parses the body with a Zod schema that only knows title and content, so a sneaky authorId field is dropped. Then it runs one update scoped to id = 42 AND author_id = <caller>. If no row matches, the caller doesn't own the post and gets a 404. The response comes back, and the editor shows "Saved". Every write in the app follows that same path: who are you, is the input valid, do you own it.

Out of scope

  • Comments, likes and follows. Each is more CRUD of the same kind. Make posts excellent first.
  • Email and password sign-in. Storing passwords safely, resets and verification are a project of their own. OAuth gives you real auth without them.
  • A rich-text (WYSIWYG) editor. A textarea and a preview teach the security lesson. A block editor teaches someone else's API.
  • Roles, admins and moderation. One rule, "you can change only what you own", is enough to learn authorisation properly.
  • Rate limiting and caching layers. They matter in production, and you'll meet them in later projects. Here they'd distract from the basics.
  • Elasticsearch or a search service. Postgres search is good and already running.

How to work through it

  1. Foundations (stack and scaffold, auth, schema): about 10 hours. Deploy the empty scaffold early, so deploying is never scary.
  2. The core (CRUD API, editor, image uploads): about 15 hours. This is where the security habits form.
  3. Reading (pagination and search, drafts and protected routes): about 8 hours.
  4. Shipping (SEO, environments): about 6 hours.

The rule that matters most: every write checks two things on the server, who the caller is and whether they own the thing. Write that check before the feature works, not after. Test every new endpoint once with curl and no cookie. If it does anything except refuse, stop and fix it.

Show it off

Your README should include:

  • A live link, and a GIF of writing a post, uploading an image and publishing it
  • Your schema (the table sketch from the schema milestone) and the three queries it was designed for
  • A "Security" section: how auth works, where validation happens, how markdown is sanitised, and a link to your draft-leak test
  • How to run it locally, with a .env.example that lists every variable and contains no real values
  • How migrations reach production

In your demo, open a terminal and try to edit someone else's post with curl. Show the 401 without a cookie, then the 404 with your own cookie on their post. Few student projects can show that.

Resume bullets to adapt (use your own numbers):

  • "Built a multi-user blog platform in Next.js and Postgres with GitHub OAuth, owner-scoped writes and Zod validation on every endpoint, backed by N automated authorisation tests"
  • "Replaced offset pagination with keyset cursors and Postgres full-text search, keeping feed queries under X ms at Y posts"

The milestones

Do them in order. Each guide explains the concepts and the steps, and ends with a checklist so you know when you're done. You write all the code.

  1. Step 1Choose the stack and scaffold the project· 2-3 hoursGuide →
  2. Step 2Implement authentication with OAuth· 3-5 hoursGuide →
  3. Step 3Design the schema: users, posts, tags· 3-4 hoursGuide →
  4. Step 4Build the post CRUD API with server-side validation· 5-6 hoursGuide →
  5. Step 5Add a markdown editor with live preview· 4-5 hoursGuide →
  6. Step 6Support image uploads for covers and inline images· 4-6 hoursGuide →
  7. Step 7Add pagination and full-text search· 4-5 hoursGuide →
  8. Step 8Draft/publish workflow and protected routes· 3-5 hoursGuide →
  9. Step 9SEO: metadata, OG images, sitemap· 2-3 hoursGuide →
  10. Step 10Deploy with separate dev and prod environments· 3-5 hoursGuide →

Want the thinking behind the design? Read the long-form essay on Inkwell →