A complete full-stack ERP and CRM solution tailored for wholesale and distribution companies. This system manages customers, products, inventory, purchase orders, sales challans, and CRM follow-ups, with role-based access control.
- Frontend Application: https://mini-erp-gilt-sigma.vercel.app/
- Backend API: https://mini-erp-qbz6.onrender.com
| Role | Password | |
|---|---|---|
| Admin | kk6547015@gmail.com | 12345678 |
| Sales | raj@gmail.com | 12345678 |
| Warehouse | rohan@gmail.com | 12345678 |
| Accounts | rahul@gmail.com | 12345678 |
(Note: The Admin can create new users with Sales, Warehouse, and Accounts roles directly from the Users dashboard in the live app).
Frontend: React, Vite, TailwindCSS, Axios, Lucide Icons
Backend: Node.js, Express.js, Prisma ORM, JWT Authentication, bcrypt
Database: MySQL (Hosted on Aiven Cloud)
DevOps/Deployment: Vercel (Frontend), Render (Backend), Docker, GitHub Actions (CI/CD)
The application follows a decoupled monolith architecture, separated into a React Single Page Application (SPA) and an Express REST API.
- Authentication & Security: Uses secure, HTTP-only cookies with JWTs for authentication. The frontend and backend communicate seamlessly via CORS configurations tailored for the specific deployment URLs.
- Database: Prisma ORM is used for type-safe database interactions with a highly normalized MySQL schema.
- CI/CD & Containerization: The application is fully Dockerized. A GitHub Actions pipeline is configured to automatically test builds and push Docker images to the GitHub Container Registry (GHCR) upon every push to the
mainbranch.
- Node.js (v20+)
- Docker & Docker Compose (Optional but recommended)
- A local MySQL database (or a cloud instance)
The easiest way to run the entire stack locally is using Docker Compose.
- Clone the repository:
git clone https://github.com/Kunal455/Mini_ERP.git cd Mini_ERP - Create a
.envfile in theBackenddirectory based on the provided.env.example(or use the one provided by the evaluator). Ensure you setDATABASE_URL. - Run Docker Compose from the root directory:
docker-compose up --build
- Access the frontend at
http://localhost:80. The backend runs onhttp://localhost:5000.
1. Backend Setup
cd Backend
npm install
# Create a .env file with DATABASE_URL, JWT_SECRET, FRONTEND_URL, PORT
npx prisma generate
npx prisma db push
npm start2. Frontend Setup
cd Frontend
npm install
# Ensure you have a .env file with VITE_API_URL pointing to the backend
npm run devThe application is deployed using modern cloud platforms:
- Database: Hosted on Aiven Cloud (MySQL).
- Backend: Hosted on Render as a Web Service. Connected to GitHub for continuous deployment. Environment variables (
DATABASE_URL,JWT_SECRET,FRONTEND_URL) are securely injected via Render's dashboard. - Frontend: Hosted on Vercel. Connected to GitHub for continuous deployment. The API URL is injected via the
VITE_API_URLenvironment variable during the build step. - Docker/CI: GitHub Actions automatically builds and publishes Docker images to GHCR.
- Typescript Migration: While the assignment requested TypeScript, the current backend is built in JavaScript (Node.js/Express) to prioritize feature completeness and rapid delivery within the deadline.
- Export to PDF: The frontend table currently allows printing the screen, but native PDF generation (bonus point) using a library like
jspdfis not yet fully implemented. - AWS S3 Images: Product images currently rely on URLs rather than direct AWS S3 uploads (bonus point).
A Postman collection (https://kk6547015-4843383.postman.co/workspace/kunal's-Workspace~c0e1ca57-4a75-4ba8-80ea-130865150004/request/46950697-ec3a662f-b32a-4ec8-8a32-abd7c4137759?action=share&creator=46950697) is included in the root of this repository. Import it into Postman to view and test all available endpoints, request bodies, and expected responses.