A minimalist quote-sharing experience with real-time feed, drafts, and image export.
- Next.js App Router
- Prisma + Postgres (Supabase)
- Supabase Storage + Realtime
- Zustand (UI state)
- TanStack Query + axios (server data)
- Tailwind CSS
- Copy env:
cp .env.example .env.local- Create a Supabase project. Add to
.env.local:
DATABASE_URL— session pooler (port 6543,?pgbouncer=true)DIRECT_URL— direct connection (port 5432)NEXT_PUBLIC_SUPABASE_URL,NEXT_PUBLIC_SUPABASE_ANON_KEY,SUPABASE_SERVICE_ROLE_KEY
- In Supabase Dashboard:
- Storage: create public bucket
quote-images - Database → Replication: enable realtime for
quotesandquote_likes
- Push schema and seed:
bun install
bun run db:push
bun run db:seed- Run:
bun dev| Method | Path | Description |
|---|---|---|
| GET | /api/quotes |
List quotes (?category=, ?featured=true) |
| POST | /api/quotes |
Publish quote |
| POST | /api/quotes/[id]/like |
Toggle like |
| GET | /api/drafts |
List your drafts |
| POST | /api/drafts |
Create draft |
| GET/PATCH/DELETE | /api/drafts/[id] |
Draft CRUD |
| POST | /api/upload/quote-image |
Upload background (Supabase Storage) |
All mutating routes require X-Session-Id header (set automatically by lib/api.ts).
app/api/ # Route handlers
lib/
prisma.ts # Singleton client
supabase.ts # Storage + realtime
services/ # DB logic
hooks/ # React Query
store/ # Zustand UI state
prisma/ # Schema + seed