Skip to content
igavdanPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Blog

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)

Quick start (Docker)

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 --build

Open:

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 password

Stop everything with docker compose down (add -v to also wipe the MongoDB volume).

Local development

For working on the code directly, without Docker building the apps.

Setup

  1. Copy .env.example → .env in apps/api, apps/admin, apps/web.
  2. Start MongoDB only:
    docker compose up -d mongo
  3. Install dependencies for all packages (one install at the root, thanks to npm workspaces):
    npm run bootstrap

Run

Run all three apps at once (via Lerna):

npm start

Or run a single app:

cd apps/api;   npm start
cd apps/admin; npm start
cd apps/web;   npm start

URLs

Useful scripts

Run from apps/api:

npm run create-admin -- --username admin --password supersecret123

npm run seed-posts   # seeds 30 mock posts, skips any that already exist

Project structure

apps/
  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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages