A multi-tenant, production-ready SaaS application that enables small shop owners to manage inventory, sales, billing, customers, credit (Udhar), staff roles, and business analytics all from a single dashboard.
Small retail businesses (kirana stores, mobile shops, medical stores) often rely on manual registers or fragmented apps for inventory, billing, and credit tracking.
This product provides:
- End-to-end shop management
- POS-style billing
- Real-time inventory updates
- Customer credit (Udhar) ledger
- Actionable business insights
Built with scalability, security, and real-world workflows in mind.
- Multi-tenant by design (each business is fully isolated)
- Transaction-safe operations (no inconsistent stock)
- Role-based access control
- Backend-driven business logic
- Production-grade architecture
┌──────────────┐
│ Frontend │
│ React + TS │
│ (Vite) │
└──────┬───────┘
│ HTTPS (JWT)
▼
┌──────────────────┐
│ Backend API │
│ Express + TS │
│ (REST) │
└──────┬───────────┘
│
┌─────────────┴─────────────┐
▼ ▼
┌────────────────┐ ┌─────────────────┐
│ MongoDB Atlas │ │ PDF Generator │
│ (Multi-tenant) │ │ (Invoices) │
└────────────────┘ └─────────────────┘
- Every user belongs to exactly one business
- All entities (products, sales, customers, staff) are scoped by
businessId businessIdis embedded inside JWT
Why?
- Prevents data leaks
- Enables SaaS scalability
- Allows future subscription plans
-
Stateless authentication
-
Token includes:
{ "userId": "...", "businessId": "...", "role": "OWNER | MANAGER | CASHIER" }
Benefits
- Horizontal scalability
- Easy frontend integration
- Clear authorization boundaries
| Role | Capabilities |
|---|---|
| OWNER | Full access |
| MANAGER | Inventory + reports |
| CASHIER | Billing only |
Why?
- Reflects real shop hierarchy
- Prevents accidental destructive actions
- Enterprise-grade authorization model
Billing uses MongoDB transactions:
Create Sale
├─ Validate products
├─ Check stock
├─ Deduct stock
├─ Create sale record
└─ Commit transaction
If any step fails → rollback
Why this matters
- No overselling
- No partial updates
- Production reliability
User
├─ role
└─ businessId
Business
└─ ownerId
Product
└─ businessId
Sale
├─ businessId
├─ items[]
└─ paymentStatus
Customer
├─ businessId
└─ balance (Udhar)
Staff (User)
└─ role-based access
- POS-style billing
- Paid / Unpaid (Udhar)
- Auto stock deduction
- Auto invoice number
- PDF invoice generation (server-side)
Why server-side PDFs?
- Tamper-proof
- Consistent formatting
- Audit-friendly
A key India-specific differentiator.
-
Unpaid sales increase customer balance
-
Customer ledger shows:
- Date
- Invoice
- Amount
-
Payments reduce balance
Business Value
- Replaces manual Udhar notebooks
- Prevents revenue leakage
- Improves cash flow visibility
- Today’s sales
- Monthly revenue
- Pending Udhar
- Low stock alerts
- Sales history
- Date-range filtering
- Invoice re-download
Built using MongoDB aggregation pipelines for performance.
- Vite + React + TypeScript
- POS-style billing UI
- Axios with JWT interceptors
- Protected routes
- Modular API layer
UI → API Layer → Backend
Why this separation?
- Maintainability
- Testability
- Easy future mobile app support
- Password hashing (bcrypt)
- JWT validation middleware
- Business-level data scoping
- Role-based route protection
- No direct client-side trust
| Component | Platform |
|---|---|
| Backend | Render |
| Frontend | Vercel |
| Database | MongoDB Atlas |
Supports:
- Horizontal scaling
- Environment-based configs
- Production logging
This project showcases:
- SaaS system design
- Multi-tenant architecture
- Secure authentication & authorization
- Transactional consistency
- Real-world business workflows
- Full-stack TypeScript proficiency
- Subscription plans
- Offline-first mode
- Reorder suggestions
- GST reports