A full-stack inventory management system for mobile phone businesses that handles stock tracking, suppliers, customers, employees, and sales operations through a modular Node.js/Express backend with MySQL integration.
This project is a good example of a real-world inventory system that combines:
- user-facing pages in
public/ - API-driven backend routes in
src/routes/ - persistent data storage in MySQL
- security via JWT authentication
It shows how to keep frontend and backend responsibilities separated while supporting the core flows needed by an inventory team.
- phone inventory management
- supplier management
- customer management
- employee management
- sales tracking system
- stock-entry and inventory operations
- JWT-based authentication
- protected API routes
- automated email-based employee onboarding (setup link via nodemailer)
- RBAC
- modular route handlers
- static frontend integration using HTML/CSS/JavaScript
- environment-based configuration with .env
- Node.js
- Express.js
- MySQL
- JWT (
jsonwebtoken) - password hashing (
bcryptjs) - email notifications (
nodemailer) - environment configuration (
dotenv) - CORS support (
cors)
- HTML
- CSS
- JavaScript
- MySQL
Most /api/* endpoints are protected using JWT middleware.
After successful login, the backend generates a JWT token which must be included in requests:
Authorization: Bearer <token>Protected routes verify the token before allowing access to inventory operations.
When a new employee is added, nodemailer sends them a secure setup link with a 30-minute expiry token. The employee uses this link to set their own password (hashed via bcryptjs) before logging in — no plaintext passwords are ever shared.
All other sectiones have also these features
- Clone the repository.
- Install dependencies:
npm install- Create a
.envfile at the project root and set values like:
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=yourpassword
DB_NAME=yourdbname
JWT_SECRET=yourjwtsecret
JWT_EXPIRES_IN=1h
PORT=5000- Start the server:
node sql_server.js5.Open the frontend pages from the public/ directory or serve them locally using Live Server.
Note: Most
/api/*endpoints are protected by JWT middleware. Add theAuthorization: Bearer <token>header after login.
sql_server.js— main backend server and route mountingsrc/config/db.js— MySQL connection pool configurationsrc/middleware/auth.js— token verification middlewaresrc/routes/— API route definitions for auth, suppliers, phones, customers, employees, salespublic/— frontend static assets and HTML pages
- add role-based access control
- report generation and downloadable exports
- improved frontend UI/UX
- enhanced backend validation
- support a more complete dashboard with analytics and inventory alerts
Github : https://github.com/JaVi080 linkdin : https://www.linkedin.com/in/javairialateef



