- Provides a web UI to register/login and manage personal notes.
- Persists users and notes in MongoDB with JWT-secured APIs.
- Serves Prometheus-friendly metrics for observability.
- Ships with Docker Compose configs and a Jenkins pipeline for CI/CD.
- Authentication: Email/password signup & login, JWT cookies, Next.js middleware to guard routes.
- Notes CRUD: List, create, edit, delete notes; App Router pages backed by API route proxies.
- API layer: Express routes under
/server/api/*for auth and notes, CORS configured viaCLIENT_URL. - Observability:
/server/metricsviaexpress-prometheus-middleware; prod Compose includes Prometheus, Grafana, Node Exporter, Alertmanager (requires host configs). - Testing & linting: Jest + jsdom for the client; ts-jest + MongoMemoryServer for the server; ESLint configs in both apps.
- Containerization & CI: Dockerfiles per app, root Compose files, Jenkins pipeline that lints/tests, builds/pushes images, runs Snyk/SonarCloud, and deploys via SSH/Compose.
- Frontend: Next.js 15 (App Router), React 19, Tailwind CSS 4, Radix UI primitives, Lucide icons, TypeScript.
- Backend: Node.js/Express 5, MongoDB/Mongoose, JWT, bcrypt, express-prometheus-middleware, TypeScript.
- Tooling: Jest, ESLint, Docker, Jenkins.
The Next.js app renders pages and calls its own API routes (/api/auth/*, /api/notes*), which proxy to the Express server mounted at /server/api/*. The Express server handles auth + notes CRUD and exposes Prometheus metrics; MongoDB stores data.
[Browser]
|
v
[Next.js client] --(API routes)--> [Express server @ /server/api/*] --> [MongoDB]
\-> /server/metrics (Prometheus)
- Prerequisites: Node.js (Dockerfiles use
node:22-slim; Node 20+ recommended), npm, and a MongoDB URI. - Environment variables
- Client:
NEXT_PUBLIC_API_URL(base URL including the/serverprefix, e.g.http://localhost:5000/server). - Server:
MONGODB_URI(required),JWT_SECRET(required),CLIENT_URL(optional CORS origin, defaults tohttp://localhost:3000),PORT(optional, defaults to5000).
- Client:
- Install
cd server && npm install # create server/.env with MONGODB_URI, JWT_SECRET, CLIENT_URL, PORT (optional) cd ../client && npm install # create client/.env or .env.local with NEXT_PUBLIC_API_URL=http://localhost:5000/server
- Run (development)
- Server:
cd server && npm run dev - Client:
cd client && npm run dev(open http://localhost:3000)
- Server:
- Run via Docker Compose (server + client)
# ensure server/.env and client/.env exist with the variables above docker-compose up --build
- Visit http://localhost:3000, register a new account, then sign in.
- Create a note from “Create Note”, edit via the pencil icon, delete via the trash icon.
- Backend APIs (when running locally with the suggested base URL):
POST /server/api/auth/registerPOST /server/api/auth/loginGET /server/api/notes,POST /server/api/notesGET|PUT|DELETE /server/api/notes/:id- Health:
GET /server/ping; Metrics:GET /server/metrics
- Server:
cd server && npm test; lint withnpm run lint. - Client:
cd client && npm test; lint withnpm run lint. - Type-check builds:
npm run buildin each app.
- Docker images: Build locally with
docker build -t notes-app-server ./serveranddocker build -t notes-app-client ./client. - Production Compose:
docker-compose.prod.ymlexpects pre-pushed images (clupai8o0/notes-app-{server,client}:v1.0.${BUILD_NUMBER}) and env filesserver/.env.productionandclient/.env.production; includes Prometheus/Grafana/Alertmanager/Node Exporter (requires host configs at/etc/prometheus/*). - CI/CD:
Jenkinsfilechecks outmain, lints/tests both apps, builds/pushes versioned Docker images, runs SonarCloud + Snyk scans, tags releases, deploys to an EC2 host via SSH + docker-compose, then smoke-tests/server/pingand/server/metrics.
- Author listed in
server/package.json: Clupai8o0.