Simple MERN-lite style project using:
- Frontend: Vanilla HTML/CSS/JS (dashboard with search, filter, categories, pagination)
- Backend: Node.js + Express
- Database: MongoDB (mongoose)
backend/— server code with routes, controllers, and Supplier modelfrontend/— static dashboard UI (index.html, styles.css, app.js).gitignore, README and package.json
- Install Node.js (v16+ recommended) and MongoDB.
- Start MongoDB (e.g.
mongod). - In
backend/directory:npm install- set
MONGO_URIenv var if needed (defaultmongodb://127.0.0.1:27017/supplierDB) npm run dev(requires nodemon) ornpm start
- Serve frontend: open
frontend/index.htmlin a browser, or serve it from a static server.- For CORS ease in development, run frontend on
localhostwhile backend runs on port 5000.
- For CORS ease in development, run frontend on
POST /supplier/add— add supplier (body: name,company,phone,address,category)GET /supplier/all— list suppliers with query params:qsearch term,category,page,limit
GET /supplier/:id— get single supplierPUT /supplier/update/:id— update supplierDELETE /supplier/delete/:id— delete supplier
- Add authentication (JWT)
- File upload for supplier documents
- More robust validation (Joi)
- Tests and CI