A modern, full-stack inventory management system with React frontend and Node.js backend.
- Product Management: Add, edit, delete products with barcode support
- Customer Management: Track customer information and GST details
- Point of Sale (POS): Complete checkout system with GST calculation
- Invoice Generation: Automatic invoice creation with bill numbers
- Analytics Dashboard: Sales trends, top products, revenue tracking
- User Management: Role-based access control (Admin, Manager, Cashier)
- Audit Trail: Complete activity logging
- Barcode & QR Code: Generate barcodes and QR codes for products
- Node.js 18+ and npm
- MongoDB Atlas account (or local MongoDB)
- Vercel account (for frontend deployment)
- Render account (for backend deployment)
.
├── web-app/
│ ├── client/ # React frontend (Vite)
│ └── server/ # Express.js backend
├── db/ # Database scripts and samples
└── README.md
-
Frontend (Vercel): Push to GitHub → Import project into Vercel → set Root Directory =
web-app/client→ add env varVITE_API_URL=https://<your-backend-url>→ Build & Deploy. Verify the site athttps://<project>.vercel.appand confirm login works. -
Backend (Render + MongoDB Atlas): Push to GitHub → Create Web Service on Render with Root Directory =
web-app/server→ set env varsMONGODB_URI,DB_NAME,ADMIN_USERNAME,ADMIN_PASSWORD,PORT=4000→ Deploy. Verifyhttps://<your-backend>/api/pingreturns{"ok":true}.
Note: For testing, allow Atlas network access 0.0.0.0/0 or use Render’s IP ranges; in production lock it down to approved IPs only.
-
Create a new Web Service on Render:
- Go to Render Dashboard
- Click "New +" → "Web Service"
- Connect your GitHub repository
- Select the repository
-
Configure the service:
- Name:
inventory-api(or your preferred name) - Root Directory:
web-app/server - Environment:
Node - Build Command:
npm install - Start Command:
npm start
- Name:
-
Set Environment Variables:
NODE_ENV=production PORT=4000 MONGODB_URI=your-mongodb-connection-string DB_NAME=inventorydb ADMIN_USERNAME=admin ADMIN_PASSWORD=your-secure-password UNSPLASH_ACCESS_KEY=your-unsplash-key (optional) -
Deploy:
- Click "Create Web Service"
- Wait for deployment to complete
- Copy your service URL (e.g.,
https://inventory-api.onrender.com)
-
Create a new project on Vercel:
- Go to Vercel Dashboard
- Click "Add New..." → "Project"
- Import your GitHub repository
-
Configure the project:
- Root Directory:
web-app/client - Framework Preset: Vite
- Build Command:
npm run build - Output Directory:
dist
- Root Directory:
-
Set Environment Variables:
VITE_API_URL=https://your-render-backend-url.onrender.comReplace with your actual Render backend URL.
-
Deploy:
- Click "Deploy"
- Wait for deployment to complete
- Your app will be live at
https://your-project.vercel.app
This repository includes two GitHub Actions workflows that will automatically run on pushes to main:
-
.github/workflows/deploy-frontend-vercel.yml— Builds and deploys the frontend to Vercel. Requires the repository secrets:VERCEL_TOKEN(personal token from Vercel)VERCEL_ORG_ID(Vercel organization ID)VERCEL_PROJECT_ID(Vercel project ID)
-
.github/workflows/deploy-backend-render.yml— Triggers a Render deploy via the Render API. Requires:RENDER_API_KEY(API key from Render)RENDER_SERVICE_ID(ID of the Render service to deploy)
How to set the secrets:
- Vercel: Project Settings → Tokens; copy the token and the Org/Project IDs from the Vercel dashboard.
- Render: Account → API Keys to create a key; the Service ID is visible on the Render service page.
Tip: You can also connect the repo directly in both Vercel and Render dashboards for first-time setup — the workflows are useful for triggering deploys automatically after each push.
-
Navigate to the server directory:
cd web-app/server -
Install dependencies:
npm install
-
Create a
.envfile (copy from.env.example):cp .env.example .env
-
Update
.envwith your MongoDB connection string and other variables. -
Start the server:
npm start
Server will run on
http://localhost:4000
-
Navigate to the client directory:
cd web-app/client -
Install dependencies:
npm install
-
Create a
.envfile (copy from.env.example):cp .env.example .env
-
Update
.envwith your API URL:VITE_API_URL=http://localhost:4000 -
Start the development server:
npm run dev
App will run on
http://localhost:5173(or the port Vite assigns)
MONGODB_URI: MongoDB connection stringDB_NAME: Database name (default:inventorydb)PORT: Server port (default:4000)NODE_ENV: Environment (developmentorproduction)ADMIN_USERNAME: Default admin usernameADMIN_PASSWORD: Default admin passwordADMIN_PASSWORD: Default admin passwordALLOW_ADMIN_PASSWORD_CHANGE: (optional) Whentrue, allows changing admin password via the API/web UI. Recommended: leavefalsein production.UNSPLASH_ACCESS_KEY: (Optional) Unsplash API key for product images
VITE_API_URL: Backend API URLVITE_ADMIN_PASSWORD(optional): Client-side admin fallback for local/dev testing only. Do not use in production — prefer server-side admin authentication.
On first startup, the backend automatically creates an admin user:
- Username: Set via
ADMIN_USERNAMEenv var (default:admin) - Password: Set via
ADMIN_PASSWORDenv var - Password: Set via
ADMIN_PASSWORDenv var
Note: Web/API admin password changes are disabled by default. To enable password changes via the web/API set ALLOW_ADMIN_PASSWORD_CHANGE=true in your backend deployment — but this is not recommended for production.
Important: Change the default password in production!
- Create a MongoDB Atlas account at mongodb.com/cloud/atlas
- Create a new cluster (free tier is fine)
- Create a database user
- Whitelist IP addresses (for Render, use
0.0.0.0/0or Render's IP ranges) - Get your connection string and set it as
MONGODB_URI
- Frontend: React 18, Vite, Chart.js
- Backend: Node.js, Express.js
- Database: MongoDB
- Authentication: bcrypt
- File Upload: Multer
- Barcode/QR: jsbarcode, qrcode
MIT
For issues and questions, please open an issue on GitHub.