Below is the complete, up-to-date structure of the project, visualized and tabulated for clarity.
flowchart TD
A[<b>pos-system/</b> <br/> <img src='https://img.icons8.com/ios-filled/24/000000/source-code.png'/>]
A --> B[app/ <img src='https://img.icons8.com/ios-filled/20/000000/folder-invoices--v1.png'/>]
B --> B1[admin/]
B1 --> B1a[products/]
B1a --> B1a1[page.tsx]
B --> B2[api/]
B2 --> B2a[customers/]
B2a --> B2a1[model.ts]
B2a --> B2a2[route.ts]
B2 --> B2b[orders/]
B2b --> B2b1[model.ts]
B2b --> B2b2[route.ts]
B2 --> B2c[products/]
B2c --> B2c1[model.ts]
B2c --> B2c2[route.ts]
B2 --> B2d[staff/]
B2d --> B2d1[model.ts]
B2d --> B2d2[route.ts]
B2 --> B2e[tables/]
B2e --> B2e1[model.ts]
B2e --> B2e2[route.ts]
B2 --> B2f[waiters/]
B2f --> B2f1[model.ts]
B2f --> B2f2[route.ts]
B --> B3[checkout/]
B3 --> B3a[page.tsx]
B --> B4[components/ <img src='https://img.icons8.com/ios-filled/20/000000/react-native.png'/>]
B4 -->|...| B4x[UI & Feature Components]
B --> B5[context/]
B5 --> B5a[cart-context.tsx]
B5 --> B5b[pos-context.tsx]
B --> B6[data/]
B6 -->|...| B6x[Product Data]
B --> B7[globals.css]
B --> B8[layout.tsx]
B --> B9[order-confirmation/]
B9 --> B9a[orderId/]
B9a --> B9a1[page.tsx]
B --> B10[page.tsx]
B --> B11[success/]
B11 --> B11a[page.tsx]
B --> B12[types/]
B12 --> B12a[index.ts]
A --> C[components/ <img src='https://img.icons8.com/ios-filled/20/000000/react-native.png'/>]
C --> C1[theme-provider.tsx]
C --> C2[ui/]
C2 -->|...| C2x[UI Primitives]
A --> D[hooks/ <img src='https://img.icons8.com/ios-filled/20/000000/hook.png'/>]
D --> D1[use-mobile.tsx]
D --> D2[use-toast.ts]
A --> E[lib/ <img src='https://img.icons8.com/ios-filled/20/000000/library.png'/>]
E --> E1[cloudinary.ts]
E --> E2[mongodb.ts]
E --> E3[utils.ts]
A --> F[public/ <img src='https://img.icons8.com/ios-filled/20/000000/public.png'/>]
F --> F1[notification.mp3]
F --> F2[placeholder-logo.svg]
F --> F3[placeholder.jpg]
F --> F4[placeholder.svg]
A --> G[styles/ <img src='https://img.icons8.com/ios-filled/20/000000/css3.png'/>]
G --> G1[globals.css]
A --> H[package.json]
A --> I[pnpm-lock.yaml]
A --> J[postcss.config.mjs]
A --> K[README.md]
A --> L[tailwind.config.ts]
A --> M[tsconfig.json]
A --> N[components.json]
A --> O[.gitignore]
Path | ๐/๐ | Description |
---|---|---|
app/ | ๐ | Main Next.js app directory |
app/admin/ | ๐ | Admin-only pages |
app/api/ | ๐ | All backend API endpoints |
app/checkout/ | ๐ | Checkout and payment flow |
app/components/ | ๐ | UI and feature components |
app/context/ | ๐ | React Contexts for POS and cart |
app/data/ | ๐ | Product/menu data |
app/order-confirmation/ | ๐ | Order confirmation, bill download/print |
app/success/ | ๐ | Success page after order completion |
app/types/ | ๐ | TypeScript types |
components/ | ๐ | Shared UI primitives, theme provider |
hooks/ | ๐ | Custom React hooks |
lib/ | ๐ | Utility libraries (MongoDB, Cloudinary, helpers) |
public/ | ๐ | Static assets (images, sounds, logos) |
styles/ | ๐ | Global CSS, Tailwind setup |
package.json | ๐ | Project dependencies and scripts |
tailwind.config.ts | ๐ | Tailwind CSS config |
tsconfig.json | ๐ | TypeScript config |
README.md | ๐ | Project documentation |
flowchart TD
A[๐ค User] -->|๐ Login/Select Role| B[๐ฅ๏ธ POS Dashboard]
B --> C{๐งญ Navigation}
C -->|๐ Home| D[๐ Product Grid]
C -->|๐ช Table Mgmt| E[๐๏ธ Table Management]
C -->|๐จโ๐ณ Kitchen| F[๐ณ Kitchen Display]
C -->|๐ฆ Inventory| G[๐ฆ Inventory Management]
C -->|๐ฅ Staff| H[๐ฅ Staff Management]
C -->|๐ Reports| I[๐ Reports]
C -->|๐ธ Expense| J[๐ธ Expense Tracker]
C -->|๐ Recipe| K[๐ Recipe Manager]
C -->|๐ Loyalty| L[๐ Customer Loyalty]
C -->|โ Add Product| M[โ Product Admin]
C -->|๐งโ๐ณ Waiter Orders| N[๐งโ๐ณ Waiter Order Count]
C -->|๐ Sales Analytics| O[๐ Sales Analytics]
C -->|๐งโ๐ผ Staff Profile| P[๐งโ๐ผ Staff Profile]
D --> Q[๐ Add to Cart]
Q --> R[๐ณ Checkout]
R --> S[๐งพ Order Confirmation]
S --> T[โ
Success Page]
E --> U[๐ช Assign Table]
F --> V[๐ณ View Orders]
G --> W[๐ฆ Manage Stock]
H --> X[๐ฅ Manage Staff]
I --> Y[๐ View Analytics]
J --> Z[๐ธ Track Expenses]
K --> AA[๐ Manage Recipes]
L --> AB[๐ View Loyalty]
M --> AC[โ Add/Edit Products]
N --> AD[๐งโ๐ณ Waiter Stats]
O --> AE[๐ Sales Charts]
P --> AF[๐งโ๐ผ Profile Details]
style B fill:#f9f,stroke:#333,stroke-width:2px
style D fill:#bbf7d0,stroke:#333,stroke-width:2px
style E fill:#fef08a,stroke:#333,stroke-width:2px
style F fill:#fca5a5,stroke:#333,stroke-width:2px
style G fill:#a5b4fc,stroke:#333,stroke-width:2px
style H fill:#fdba74,stroke:#333,stroke-width:2px
style I fill:#fcd34d,stroke:#333,stroke-width:2px
style J fill:#f9a8d4,stroke:#333,stroke-width:2px
style K fill:#6ee7b7,stroke:#333,stroke-width:2px
style L fill:#f472b6,stroke:#333,stroke-width:2px
style M fill:#facc15,stroke:#333,stroke-width:2px
style N fill:#a3e635,stroke:#333,stroke-width:2px
style O fill:#38bdf8,stroke:#333,stroke-width:2px
style P fill:#fbbf24,stroke:#333,stroke-width:2px
Apna POS is a next-generation, fully real-time, animated, and mobile-first Point of Sale system for cafes and restaurants. Built for scale, speed, and delight, it brings together:
- ๐ก Live Order Management
- ๐ช Animated UI/UX
- ๐ก๏ธ Enterprise Security
- ๐ Offline Mode & Auto-Sync
- ๐ Business Analytics
- ๐ Customer Loyalty & Staff Performance
- ๐งโ๐ป Developer-Grade API & Extensibility
๐ Core | ๐งโ๐ณ Advanced | ๐ผ Business | ๐ ๏ธ Tech |
---|---|---|---|
๐ Real-Time Order Mgmt | ๐ฝ๏ธ Table Mgmt (Add/Edit/Clean/Reserve) | ๐ Sales Analytics & Reports | โก Next.js 15, React 19 |
๐งพ Bill/Receipt Printing | ๐จโ๐ณ Kitchen Display | ๐ Loyalty Points & Tiers | ๐จ Tailwind CSS, shadcn/ui |
๐ณ Payment (Cash/Card/UPI) | ๐ Inventory Mgmt | ๐ฅ Staff Attendance & Roles | ๐ข MongoDB (Cloud/Local) |
๐ Multi-language (EN/HI) | ๐งโ๐ผ Staff Mgmt | ๐ธ Expense Tracking | ๐ Real-Time Notifications |
๐ฑ 100% Responsive | ๐ฅ Recipe Manager | ๐ Waiter Order Counter | ๐ Offline Mode |
๐ Role-based Access | ๐ ๏ธ API-first | ๐ท๏ธ GST/Service Charge | ๐งฉ Modular, Extensible |
๐จ๏ธ Print/Download Receipts | ๐งพ Digital Receipts | ๐ Loyalty Tiers | ๐ง AI-Ready Architecture |
๐งโ๐ป Staff Profiles | ๐ท๏ธ Discounts & Offers | ๐ข Multi-Branch Ready | ๐๏ธ Scalable Microservices |
๐งโ๐จ Custom Branding | ๐งโ๐ฌ Advanced Reporting | ๐ฆ Financial Exports | ๐งช Automated Testing |
๐งโโ๏ธ Audit Logs | ๐งโ๐คโ๐ง CRM Integration | ๐ช Franchise Support | ๐งโ๐ป Dev API Docs |
Layer | Tech | Icon |
---|---|---|
Frontend | Next.js 15, React 19, TypeScript, Tailwind CSS, shadcn/ui | โ๏ธ ๐ฆ ๐จ |
Backend | Next.js API routes, MongoDB (Mongoose) | ๐ข ๐๏ธ |
State | React Context API | ๐ง |
Charts | Recharts | ๐ |
Icons | Lucide React | ๐ผ๏ธ |
Notifications | Real-time, animated | ๐ |
Offline | Local queue + auto-sync | ๐ก |
Testing | Jest, React Testing Library | ๐งช |
CI/CD | GitHub Actions, Vercel | ๐ |
Monitoring | Sentry, LogRocket | ๐ก๏ธ |
DevOps | Docker, Vercel, GitHub Actions | ๐ณ โ๏ธ |
- ๐ช Table Created: Add a table with number, capacity, and (optional) location.
- ๐งโ๐ผ Waiter Assigns Table: Waiter selects table and starts order.
- ๐ฝ๏ธ Order Placed: Items added, customizations, and special instructions.
- ๐จโ๐ณ Kitchen Display: Orders appear live in kitchen view.
- ๐ณ Bill Generated: Bill is created instantly after order placement.
- ๐จ๏ธ Print/Download Bill: Bill can be viewed, printed, or downloaded for each table.
- โ Finalize Bill: Mark bill as paid, table resets for new customer.
- ๐ Real-Time Updates: All actions update instantly for all users.
- Restaurant Owners: Full business overview, analytics, and control.
- Managers: Real-time order, table, and staff management.
- Waiters: Fast order taking, table assignment, and performance tracking.
- Kitchen Staff: Live kitchen display, order queue, and recipe access.
- Cashiers: Quick billing, payment, and receipt generation.
- Customers: Loyalty points, personalized service, and digital receipts.
- Franchise Chains: Multi-branch, centralized analytics.
- Cloud Kitchens: Centralized order and inventory management.
- Cafes & QSRs: Fast, touch-friendly, and mobile-first.
- Enterprise Groups: Custom workflows, integrations, and analytics.
- MongoDB Models: Orders, Tables, Staff, Customers, Products, Waiters, Loyalty, Expenses, Recipes, Inventory
- API Routes:
/api/orders
,/api/tables
,/api/staff
,/api/customers
,/api/products
,/api/waiters
,/api/expenses
,/api/recipes
,/api/inventory
- Real-Time: All CRUD via API, no local/demo data
- Offline Mode: Orders saved locally and auto-synced
- Webhooks: Ready for integrations
Endpoint | Method | Description |
---|---|---|
/api/orders |
GET/POST/PUT/DELETE | Manage orders |
/api/tables |
GET/POST/PUT/DELETE | Manage tables |
/api/staff |
GET/POST/PUT/DELETE | Manage staff |
/api/customers |
GET/POST/PUT/DELETE | Manage customers |
/api/products |
GET/POST/PUT/DELETE | Manage products |
/api/waiters |
GET/POST/PUT/DELETE | Manage waiters |
/api/expenses |
GET/POST/PUT/DELETE | Manage expenses |
/api/recipes |
GET/POST/PUT/DELETE | Manage recipes |
/api/inventory |
GET/POST/PUT/DELETE | Manage inventory |
- ๐ Boosts Sales: Faster order flow, less wait time, more table turns
- ๐ฐ Reduces Costs: Automated analytics, inventory, and staff management
- ๐ Increases Loyalty: Points, tiers, and personalized offers
- ๐ Data-Driven: Real-time insights for smarter decisions
- ๐ก๏ธ Secure: Role-based access, audit logs, and compliance
- ๐ Scalable: From single cafe to multi-branch chains
- ๐งโ๐ผ Empowers Staff: Training, performance, and happiness
- ๐งโ๐ณ Delights Customers: Fast, accurate, and personal service
- ๐ Role-Based Access Control
- ๐ก๏ธ Data Encryption (in transit & at rest)
- ๐ Audit Logs
- ๐ข GDPR & Data Privacy Ready
- ๐งโโ๏ธ User Permissions & Approval Flows
- ๐งโ๐ป Penetration Tested
- ๐งโ๐ฌ Regular Security Audits
- ๐งโ๐ป Modular UI Components
- ๐ API-First Design
- ๐ ๏ธ Easy Theming & Branding
- ๐ง AI/ML Integration Ready
- ๐ท๏ธ Custom Fields & Workflows
- ๐งโ๐จ White-label Ready
- ๐งโ๐ผ Custom Reports & Dashboards
- ๐ Optimized for Speed: SSR, code splitting, caching
- ๐๏ธ Horizontal Scaling: Cloud-native, microservices ready
- ๐ Offline Mode: Local-first, auto-sync
- ๐ Load Tested: 1000+ concurrent users
- ๐งโ๐ป Zero Downtime Deploys
- ๐ Multi-language: English, Hindi (add more easily)
- โฟ WCAG 2.1 Compliant
- ๐ฆป Screen Reader Friendly
- ๐ฅ๏ธ Keyboard Navigation
- ๐งโ๐ฆฏ Color Blind Modes
- ๐งโ๐ฆผ Accessible Animations
- Fork the repo
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
See CHANGELOG.md for version history, new features, and bug fixes.
Problem | Possible Cause | Solution |
---|---|---|
Order not syncing | Offline mode active | Wait for internet, auto-sync will trigger |
Staff not persisting | LocalStorage issue | Clear browser cache, re-login |
Bill not showing | API/data error | Check API logs, refresh page |
Demo data showing | Old cache | Hard refresh, clear cache |
Waiter not persisting | LocalStorage issue | Clear cache, re-select waiter |
UI not responsive | Outdated browser | Update browser, clear cache |
Q: How do I add a new language?
- See
/locales
folder and follow the i18n guide in the docs.
Q: Can I customize the bill format?
- Yes! Go to Settings > Bill Template.
Q: How do I enable/disable offline mode?
- Offline mode is automatic. You can see status in the header.
- Real-time MongoDB data everywhere
- Offline mode with auto-sync
- Animated, mobile-first UI
- Loyalty, analytics, staff, inventory
- AI-powered sales prediction
- WhatsApp/SMS order notifications
- Multi-branch analytics dashboard
- More payment integrations
- Plug-in marketplace
"Apna POS เคจเฅ เคนเคฎเคพเคฐเฅ เคฐเฅเคธเฅเคเฅเคฐเฅเคเค เคเฅ เคธเฅเคชเฅเคก เคเคฐ เคธเคฐเฅเคตเคฟเคธ เคฆเฅเคจเฅเค เคฌเคฆเคฒ เคฆเฅ!"
โ Ramesh
"The animated UI is a delight for staff and customers alike!"
โ Priya
"Offline mode saved us during a network outageโno lost orders!"
โ Vikram
"The best POS for multi-branch chainsโanalytics are next level!"
โ Amit
"Integration with our CRM and loyalty program was seamless."
โ Sonia
Name | Role | Emoji |
---|---|---|
Narender Singh | Founder, Architect, Lead Dev | ๐ ๐จโ๐ป |
[Add your name!] | Contributor | ๐ |
- AI-powered menu recommendations
- Global multi-currency, multi-language support
- Open plug-in marketplace for 3rd party integrations
- Narender Singh โ Founder, Architect, Lead Developer
- Contributors
- Special thanks to the open-source community
This project is licensed under the MIT License. See LICENSE for details.
Note: If you want to use, sell, or monetize this project, or present it on LinkedIn or any public/commercial platform, you must credit the author and request permission via LinkedIn: Narender Singh. Commercial use without permission is not allowed.
- For support, issues, or feature requests, open an issue or email: narendersingh2028@gmail.com
- For business/commercial inquiries or permission, contact via LinkedIn: Narender Singh
โโโโ โโโ โโโโโโ โโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโ โโโโโโ โโโโโโโโโ โโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโโ โโโโโโโโ โโโ โโโโโโโโโ โโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ โโโ โโโ โโโโโโโโ โโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโ โโโ