A complete full-stack Point of Sale (POS) system built with:
- ⚛️ Client: React.js + Vite
- 🚀 Server: NestJS (Node.js)
- 🍃 Database: MongoDB + Prisma ORM
- 📦 Package Manager: pnpm
- 🔌 API: REST API
- Client: http://localhost:5173
- Server API: http://localhost:8000
project-root/
│
├── client/ → React + Vite Client
├── server/ → NestJS Server (REST API)
└── screenshots → Screenshots of this project
└── README.md → Project instructions and docs
Ensure you have the following installed:
- Node.js (v18+)
- pnpm (v8+)
- MongoDB or MongoDB Atlas
- Postman or similar tool for API testing (optional)
git clone https://github.com/mdranaa/pos
cd pos
Using pnpm:
# Client
cd client
pnpm install
# Server
cd server
pnpm install
Create a .env
file inside the Server/
folder:
PORT=8000
DATABASE_URL=mongodb://localhost:27017/pos_db
JWT_SECRET=your_jwt_secret
JWT_EXPIRES_IN='1d'
PORT=8000
CLIENT_URL=http://localhost:5173
✅ Replace values as needed. For MongoDB Atlas, use your connection string.
cd server
npx prisma generate
npx prisma db push
pnpm run start:dev
Server runs on:
http://localhost:8000
Create a .env
file inside the client/
folder:
VITE_SERVER_URL=http://localhost:8000
cd client
pnpm run dev
App runs on:
http://localhost:5173
Method | Endpoint | Description |
---|---|---|
POST | /auth/register |
Register a new user |
POST | /auth/login |
Login and get a token |
Method | Endpoint | Description |
---|---|---|
GET | /products |
Get all products |
GET | /products/:id |
Get product by ID |
POST | /products |
Create a new product |
Method | Endpoint | Description |
---|---|---|
GET | /sales |
Get all sales |
POST | /sales |
Create a new sale |
⚠️ Secure Routes require a JWT token in theAuthorization
header:
Authorization: Bearer <your_token>
curl -X POST http://localhost:8000/auth/login -H "Content-Type: application/json" -d '{"email":"[email protected]","password":"password123"}'
Add screenshots to the screenshots/
folder and display them here.
🔐 Login Page | 📊 Dashboard | 🧾 Sales Page |
---|---|---|
![]() |
![]() |
![]() |
cd client
pnpm run build
Output in
client/dist/
cd server
pnpm run build
Compiled files in
server/dist/
Want containerized deployment?
Ask to add:
Dockerfile
for Client & Serverdocker-compose.yml
for the full stack
Use Postman, Insomnia, or browser DevTools to test your REST API at:
http://localhost:8000/auth
http://localhost:8000/products
http://localhost:8000/sales
MIT License © [Rana Ahammed]
- GitHub: @mdranaa
- Email: [email protected]