A robust, full-stack Mini Enterprise Resource Planning (ERP) system built with Node.js, Express, PostgreSQL, and React. Designed to manage inventory, customers, and orders with role-based access control and transactional data integrity.
- Role-Based Access Control (RBAC): Distinct permissions for Admin and Staff.
- Secure Authentication: JWT-based auth with bcrypt password hashing.
- Inventory Management: Real-time stock tracking with transactional updates.
- Order Processing: Atomic transactions ensure data consistency (no overselling!).
- Customer Management: Maintain a database of customers.
- Reporting Dashboard: aggregated insights on revenue, orders, and products.
- Force Password Change: Security feature requiring staff to update temporary passwords.
- Framework: Node.js & Express.js
- Database: PostgreSQL (Relational Data)
- ORM: Prisma (Type-safe database access)
- Auth: JSON Web Tokens (JWT) & bcrypt
- Framework: React (Vite)
- State Management: Context API (AuthContext)
- Routing: React Router v6 (Protected Routes)
- Styling: Clean, responsive CSS
- Node.js (v16+)
- PostgreSQL (running locally)
Create a PostgreSQL database named mini_erp:
CREATE DATABASE mini_erp;Navigate to the backend folder:
cd backend
npm installConfigure Environment Variables:
Create a .env file in backend/ based on your PostgreSQL credentials:
DATABASE_URL="postgresql://postgres:YOUR_PASSWORD@localhost:5432/mini_erp?schema=public"
JWT_SECRET="your_secure_jwt_secret"
PORT=5000(Replace YOUR_PASSWORD with your actual Postgres password)
Run Migrations:
npx prisma migrate dev --name initStart the Server:
npm run dev
# Server runs on http://localhost:5000Navigate to the frontend folder:
cd ../frontend
npm installStart the Client:
npm run dev
# App runs on http://localhost:5173You can log in to the admin dashboard using the following default credentials (make sure you have seeded or created the user in your database):
- Email:
admin@minierp.com - Password:
adminpassword123
Navigate to http://localhost:5173/login in your browser to sign in.