A full-stack ERP system built with the MEAN stack (MongoDB, Express.js, Angular, Node.js) and TypeScript β designed to demonstrate full production-grade skills for authentication, role-based access, CRUD operations, Docker, testing, and deployment.
This project is part of my full-stack portfolio β built from scratch step-by-step as a practical guide to creating a real-world small ERP.
- JWT-based auth with refresh tokens
- Role-Based Access Control (RBAC) β Admin / Manager / Employee
- Route guards on backend (Express) and frontend (Angular)
- CRUD operations for Products
- Tracks stock quantity, SKU, price, reorder level
- Pagination & search
- Customers, Orders, Invoices (minimal MVP)
- Order summary and sales tracking
- KPIs: Total sales (30d), low-stock items, recent orders
- Charts & summaries (Angular Material / Chart.js)
| Layer | Technologies Used |
|---|---|
| Frontend | Angular 17+, TypeScript, Angular Material / Tailwind, RxJS |
| Backend | Node.js (LTS), Express.js, Mongoose, JWT, bcrypt, helmet, morgan |
| Database | MongoDB Atlas |
| Auth | JWT (access + refresh tokens), role guards |
| Testing | Jest, Supertest, Karma, Cypress |
| Deployment | Vercel (Frontend), Render (Backend), Docker Compose (local) |
erp-mean/
β
βββ backend/ # Node + Express + MongoDB
β βββ src/
β β βββ controllers/
β β βββ middleware/
β β βββ models/
β β βββ routes/
β β βββ utils/
β β βββ server.js
β βββ .env.example
β βββ Dockerfile
β βββ package.json
β
βββ frontend/ # Angular app
β βββ src/app/
β β βββ core/
β β βββ auth/
β β βββ products/
β β βββ orders/
β β βββ shared/
β βββ angular.json
β
βββ docker-compose.yml
cd backend
npm installCreate a .env file (see .env.example):
PORT=5000
MONGO_URI=mongodb://localhost:27017/erp
JWT_ACCESS_SECRET=replace_with_strong_secret
JWT_REFRESH_SECRET=replace_with_strong_secret
CLIENT_URL=http://localhost:4200npm run devcd frontend
npm installng serveFrontend runs on http://localhost:4200
version: '3.8'
services:
mongo:
image: mongo:8.0
volumes:
- mongo-data:/data/db
backend:
build: ./backend
ports:
- "5000:5000"
environment:
- MONGO_URI=mongodb://mongo:27017/erp
depends_on:
- mongo
volumes:
mongo-data:Run with:
docker compose up --buildnpm run test- Jest + Supertest for integration tests
ng test- Angular TestBed / Karma for unit tests
- Cypress for end-to-end
- HTTPS-ready setup
- Helmet, CORS, rate limiting
- Strong password hashing (bcrypt 12 rounds)
- JWT rotation and short expiry
- Secure cookie handling for refresh tokens
- Input validation with express-validator
- Prevents NoSQL injection and XSS via sanitization
- GitHub Actions or Render auto-deploy
- Run backend tests on push
- Auto build & deploy frontend to Vercel
- Environment variables configured via dashboard
- Deployed on Vercel
- Zero-config Angular build (
ng build --configuration production)
- Deployed on Render
- Environment variables configured in Render Dashboard
- HTTPS, CORS allowed from frontend domain only
- Live URL: coming soon
- Demo Credentials:
- Admin: admin@example.com / admin123
- Manager: manager@example.com / manager123
flowchart TD
A[Angular Frontend] -->|HTTP / JWT| B[Express API]
B --> C[(MongoDB Atlas)]
B --> D[Auth Middleware]
D -->|Access Control| E[Admin/Manager Routes]
- Node.js LTS Schedule
- Angular Documentation
- MongoDB Docs
- OWASP JWT Best Practices
- Render Deployment Docs
- Vercel Angular Guide
Robin Joseph
π§ robinjo1776@gmail.com
π GitHub: RobinJosephDev