This guide will help you get the Invex Inventory Management System up and running in minutes.
- Node.js v16+ installed
- MySQL installed and running
- Git installed
- Code editor (VS Code recommended)
# Clone the repository
git clone https://github.com/yourusername/invex.git
cd invex
# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm install# Open MySQL command line or MySQL Workbench
mysql -u root -p
# Create database
CREATE DATABASE invex_db;
exit;Create backend/.env file:
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your_mysql_password
DB_NAME=invex_db
DB_DIALECT=mysql
JWT_SECRET=your_secret_key_min_32_characters_long
PORT=5000
NODE_ENV=development# Terminal 1 - Backend
cd backend
npm run seed:admin # Creates admin user
npm run seed:staff # Creates staff user
npm run seed:items # Creates sample inventory
npm start # Start backend server
# Terminal 2 - Frontend
cd frontend
npm start # Start frontend serverOpen your browser and visit:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- API Docs: http://localhost:5000/api-docs
Username: admin
Password: admin123
Username: staff
Password: staff123
- Login to dashboard
- View inventory items
- Create a new item
- Edit an item
- Delete an item
- Navigate to Users page
- Create a new user
- Edit user role
- Reset user password
- Delete a user
- Login to dashboard
- View inventory items
- Update item quantity
- Search for items
- Try to access Users page (should see "Access Denied")
- Try to create an item (should not see the button)
# Check if MySQL is running
mysql -u root -p
# Check if port 5000 is in use
netstat -ano | findstr :5000 # Windows
lsof -i :5000 # Mac/Linux
# Re-install dependencies
cd backend
rm -rf node_modules package-lock.json
npm install# Check if port 3000 is in use
netstat -ano | findstr :3000 # Windows
lsof -i :3000 # Mac/Linux
# Re-install dependencies
cd frontend
rm -rf node_modules package-lock.json
npm install- Verify MySQL is running
- Check credentials in
.envfile - Ensure database
invex_dbexists - Check MySQL user has proper permissions
- Run seed scripts again:
cd backend npm run seed:admin npm run seed:staff - Check browser console for errors
- Verify backend is running on port 5000
For development with auto-reload:
# Backend with nodemon
cd backend
npm run dev
# Frontend (already has hot reload)
cd frontend
npm startInvex/
├── backend/ # Node.js + Express API
│ ├── config/ # Database & Swagger config
│ ├── controllers/ # Business logic
│ ├── middleware/ # Auth & authorization
│ ├── models/ # Sequelize models
│ ├── routes/ # API routes
│ └── utils/ # Helper functions & seeds
└── frontend/ # React application
└── src/
├── components/ # Reusable components
├── context/ # Auth context
├── pages/ # Page components
├── services/ # API service
└── theme/ # CSS styling
- Explore the API: Visit http://localhost:5000/api-docs
- Customize: Modify colors in
frontend/src/theme/dark-theme.css - Add Features: Extend models, controllers, and pages
- Deploy: Follow deployment guides for your platform
# Backend
npm start # Run production server
npm run dev # Run with nodemon
npm run seed:admin # Create admin user
npm run seed:staff # Create staff user
npm run seed:items # Seed inventory items
# Frontend
npm start # Start dev server
npm run build # Create production build- Check
README.mdfor detailed documentation - Review
CHANGELOG.mdfor recent changes - Check API documentation at http://localhost:5000/api-docs
- Review console logs for error messages
- Environment Variables: Use production values for JWT_SECRET and database
- Database: Use managed MySQL service (AWS RDS, Azure Database, etc.)
- Frontend Build: Run
npm run buildin frontend directory - Backend: Use PM2 or similar process manager
- Security: Enable HTTPS, update CORS settings
- Environment: Set
NODE_ENV=production
Happy Coding! 🎉
For detailed documentation, see README.md