A small full-stack blog platform: a Node/Express + MongoDB API, a React admin panel for managing posts (with image uploads), and a Next.js public-facing blog. Managed as an npm workspaces + Lerna monorepo.
| App | Stack | Purpose |
|---|---|---|
apps/api |
Express + Mongoose | REST API, auth, image uploads |
apps/admin |
React + Vite | Admin panel for managing posts |
apps/web |
Next.js | Public-facing blog (SSR) |
The recommended way to run the whole thing. One command builds and starts MongoDB, the API, the admin panel, the web app, and an nginx reverse proxy — then seeds 30 mock posts automatically.
cp .env.example .env # set a real JWT_SECRET; optionally set ADMIN_USERNAME/ADMIN_PASSWORD to auto-create an admin user
docker compose up -d --buildOpen:
- http://localhost/ — the blog
- http://localhost/admin/ — the admin panel (use login & password from .env file)
Everything runs behind a single nginx entrypoint on port 80:
/→ web (Next.js blog)/admin/→ admin panel/api/and/uploads/→ API
If you didn't set ADMIN_USERNAME/ADMIN_PASSWORD in .env, create an admin user after the stack is up:
docker compose exec api node dist/scripts/create-admin.js --username admin --password passwordStop everything with docker compose down (add -v to also wipe the MongoDB volume).
For working on the code directly, without Docker building the apps.
- Copy
.env.example→.envinapps/api,apps/admin,apps/web. - Start MongoDB only:
docker compose up -d mongo
- Install dependencies for all packages (one install at the root, thanks to npm workspaces):
npm run bootstrap
Run all three apps at once (via Lerna):
npm startOr run a single app:
cd apps/api; npm start
cd apps/admin; npm start
cd apps/web; npm start- http://localhost:5173/ — admin panel
- http://localhost:3000/ — public blog
- http://localhost:4000/ — API
Run from apps/api:
npm run create-admin -- --username admin --password supersecret123
npm run seed-posts # seeds 30 mock posts, skips any that already existapps/
api/ Express + Mongoose REST API
admin/ React + Vite admin panel
web/ Next.js public blog
Dockerfile multi-stage build (targets: api, web, admin)
docker-compose.yml orchestrates mongo + api + web + admin + nginx
nginx/nginx.conf reverse proxy config for the Docker deploy