A Next.js 15 + Prisma + PostgreSQL blog application.
- Secure admin workflow — database-backed sessions, MFA support, and host-scoped auth cookies.
- Rich publishing experience — Markdown posts, code blocks, categories, tags, cover images, related posts, and post navigation.
- Automatic image handling — dynamic OG images, responsive post images, and graceful cover-image fallbacks.
- Built-in stats — post view counts plus an admin visitor dashboard for traffic insight.
- SEO-ready by default — sitemap, robots.txt, JSON-LD, canonical URLs, RSS feed, and ISR for fresh content.
- Fast discovery — command-palette search across posts so readers can find content quickly.
See it live here: https://jp-my-blog.vercel.app/blog
git clone https://github.com/japperJ/JP-MyBlog.git
cd JP-MyBlog
npm install
cp .env.example .env.local # then fill in your values
npm run db:push && npm run db:seed
npm run devOpen http://localhost:3000. Admin login: http://localhost:3000/admin/login (admin@aicodingblog.com / admin123 — change immediately).
| Variable | Local | Vercel | Purpose |
|---|---|---|---|
DATABASE_URL |
Required | Required | PostgreSQL connection string |
NEXT_PUBLIC_APP_URL |
http://localhost:3000 |
Optional (falls back to VERCEL_URL) |
Canonical origin for metadata, sitemap, feed, OG |
MFA_TOKEN_SECRET |
Recommended | Required | Stable HMAC secret for MFA challenge tokens |
| Command | What it does |
|---|---|
npm run dev |
Start the dev server |
npm run typecheck |
Prisma generate + tsc --noEmit |
npm run readiness:preflight |
typecheck, db:validate, db:generate, build |
npm run db:push |
Apply schema to database |
npm run db:seed |
Seed default admin + sample content |
npm run test:smoke:local |
Smoke tests against local server |
npm run test:smoke:hosted |
Smoke tests against a real preview URL |
See Deployment Procedure for the full guide. The short version:
- Import the repo in vercel.com/new.
- Set
DATABASE_URLandMFA_TOKEN_SECRETin Vercel environment variables. - Deploy. The build runs
prisma generate && next buildand requires a reachable database.
- No checked-in Prisma migrations; setup uses
prisma db push. - Vercel-hosted uploads are disabled until object storage is added.
- In-memory rate limiting is acceptable for preview/dev only.
- Preview and production share one database during initial rollout.
- Getting Started — clone, install, run locally in 5 minutes
- Writing Posts — create, edit, publish, and manage blog posts
- Customization — site name, metadata, OG images, theme
- Troubleshooting — symptom-based fixes
- Architecture — system design, invariants, technology choices
- Auth System — session cookies, MFA/TOTP, middleware
- SEO Implementation — JSON-LD, ISR, sitemap, OG images
- Deployment Model — Vercel Hobby constraints, env var contract, build pipeline
- Deployment Procedure — full setup with prerequisites, rollback, verification
- Database Operations — migrations, seed data, backup/restore
- Monitoring — health checks, alerts, incident response
