A minimal dark-theme blog in Next.js with:
- a public
/blogendpoint - a private
/dashboardendpoint for writing posts - Neon Postgres storage for posts and subscribers
- Cloudinary image uploads for cover and inline blog images
- Vercel-friendly deployment flow
- Install dependencies:
npm install- Copy
.env.exampleto.env.localand fill in:
DATABASE_URLADMIN_EMAILADMIN_PASSWORDAUTH_SECRETCLOUDINARY_CLOUD_NAMECLOUDINARY_API_KEYCLOUDINARY_API_SECRETCLOUDINARY_FOLDER
- Create a Cloudinary account:
- create a free Cloudinary account
- copy your cloud name, API key, and API secret from the Cloudinary dashboard
- optionally choose a folder name like
systems-notesfor uploaded blog images
- Start the app:
npm run dev- Open:
http://localhost:3000/bloghttp://localhost:3000/dashboard
- Push this repo to GitHub.
- Import the repo into Vercel.
- Add the same values from
.env.localinto the Vercel project environment variables. - Redeploy after any env var change.
- The dashboard is protected by a cookie-backed login using your
ADMIN_EMAILandADMIN_PASSWORD. - Uploaded images are stored in Cloudinary and inserted into posts as public URLs.
- The database tables auto-create on first access, but the SQL is also included in
sql/schema.sql. - For Vercel deployment, set the same env vars in your Vercel project settings and redeploy.
- See
DEPLOY_VERCEL.mdfor the quick deploy path.