A modern, enterprise-grade Point of Sale system built with Next.js, Prisma, and PostgreSQL
Features β’ Tech Stack β’ Installation β’ Architecture β’ Screenshots
- Hardagya Rajput
- Jagjeet Dangar
- Isha Patel
- Overview
- Features
- Tech Stack
- System Architecture
- Database Schema
- Order Lifecycle
- Installation
- Environment Variables
- Usage
- API Reference
- Project Structure
- Role-Based Access Control
- Screenshots
- Contributing
- License
Odoo Cafe POS is a comprehensive restaurant management system designed to streamline the ordering process, from table selection to kitchen preparation and final billing. It offers a synchronized ecosystem connecting Baristas, Kitchen Staff, and Managers through real-time updates.
- π’ Centralized table and floor management
- β‘ Fast, intuitive Point of Sale (POS) interface
- π¨βπ³ Real-time Kitchen Display System (KDS)
- π³ Integrated payments (Cash, UPI with QR, Digital)
- π Detailed sales sessions and financial reporting
- π Secure role-based access control (Admin, Cashier, Kitchen)
mindmap
root((Odoo Cafe POS))
POS Terminal
Table Selection
Menu Browsing
Cart Management
Checkout
Kitchen (KDS)
Live Order Feed
Status Updates
Prep Tracking
Management
Floor Planning
Product Inventory
Staff Sessions
Sales Reports
Payments
Cash Handling
UPI Integration
Receipt Generation
Security
JWT Auth
Role Based Access
Session Tracking
- β Table Management: Visual floor plan with real-time table status (Occupied, Free)
- β Smart Menu: Categorized items, search, and variants (sizes, extras)
- β Cart Operations: Hold orders, add notes, modify quantities
- β Session Management: Opening/Closing cash tracking per terminal
- β Real-time Feed: Orders appear instantly via Socket.io
- β Status Workflow: PENDING β PREPARING β READY β COMPLETED
- β Visual Cues: Distinct colors for different order states
- β Item-level Control: Mark individual items as ready
- β Product Management: Create categories, products, and variants
- β Floor Editor: Design restaurant layout (Floors, Tables, Seats)
- β Staff Management: Create users and assign roles
- β Sales Dashboard: Visualize revenue, popular items, and peak hours
- β POS View: Optimized for touchscreens and fast entry
- β Kitchen View: High-contrast, easy-to-read order tickets
- β Manager Dashboard: Charts using Recharts/Nivo for insights
- β Customer Display: Second screen view for customers (Planned)
- β Auto-Routing: 'Send to Kitchen' flag routes specific items to KDS
- β Status Sync: KDS updates reflect instantly on POS
- β Receipts: Auto-generated PDF receipts with QR codes
- β Stock Logic: Basic availability toggles for menu items
flowchart LR
subgraph Cashier
C1[Open Session]
C2[Select Table]
C3[Add Items]
C4[Checkout]
end
subgraph Kitchen
K1[Receive Ticket]
K2[Start Prep]
K3[Mark Ready]
end
C1 --> C2
C2 --> C3
C3 --> C4
C4 -->|Socket.io| K1
K1 --> K2
K2 --> K3
K3 -->|Notification| C4
style C1 fill:#1A4D2E,color:#fff
style C4 fill:#1A4D2E,color:#fff
style K1 fill:#D97706,color:#fff
style K3 fill:#10B981,color:#fff
- β JWT-based authentication
- β Encrypted passwords (bcryptjs)
- β Protected API routes (Middleware)
- β Optimistic concurrency control on orders
- Framework: Next.js 16.1.4 (App Router)
- Styling: Tailwind CSS 3.4
- State Management: Zustand + React Query
- Icons: Lucide React
- Charts: Recharts, Nivo, MUI X-Charts
- Realtime: Socket.io Client
- Animations: Framer Motion
- Runtime: Node.js
- Framework: Express.js 5.2
- Database: PostgreSQL (NeonDB Serverless)
- ORM: Prisma 5.10
- Authentication: JWT + bcryptjs
- Realtime: Socket.io Server
- Email: Nodemailer
graph LR
subgraph Frontend
A[Next.js 16] --> B[React Components]
B --> C[Tailwind CSS]
B --> D[Zustand]
B --> E[Socket.io Client]
end
subgraph Backend
F[Express API] --> G[Prisma ORM]
F --> H[JWT Auth]
F --> I[Socket.io Server]
G --> J[(PostgreSQL)]
end
E <--> I
style A fill:#000,color:#fff
style C fill:#38B2AC,color:#fff
style G fill:#2D3748,color:#fff
style J fill:#336791,color:#fff
style F fill:#000,color:#fff
graph TB
subgraph "Client Layer"
POS[POS Terminal]
KDS[Kitchen Display]
Admin[Admin Dashboard]
end
subgraph "API Layer"
Express[Express Server]
Socket[Socket.io Service]
Auth[Auth Middleware]
end
subgraph "Data Layer"
Prisma[Prisma Client]
DB[(PostgreSQL)]
end
POS -->|HTTP| Express
POS <-->|WebSocket| Socket
KDS <-->|WebSocket| Socket
Admin -->|HTTP| Express
Express --> Auth
Auth --> Prisma
Prisma --> DB
style POS fill:#1A4D2E,color:#fff
style KDS fill:#D97706,color:#fff
style Express fill:#000,color:#fff
style Prisma fill:#2D3748,color:#fff
erDiagram
User ||--o{ Session : "opens"
User ||--o{ Order : "manages"
Terminal ||--o{ Session : "hosts"
Session ||--o{ Order : "contains"
Floor ||--o{ Table : "contains"
Table ||--o{ Order : "assigned"
Category ||--o{ Product : "classifies"
Product ||--o{ Variant : "has"
Product ||--o{ OrderItem : "sold as"
Order ||--o{ OrderItem : "contains"
Order ||--o{ Payment : "paid by"
User {
string id PK
string email UK
string name
enum role "ADMIN, CASHIER, KITCHEN"
}
Session {
string id PK
timestamp startAt
timestamp endAt
decimal openingCash
decimal closingCash
enum status "OPEN, CLOSED"
}
Product {
string id PK
string name
decimal price
boolean isAvailable
boolean sendToKitchen
}
Order {
string id PK
string orderNumber
enum status "DRAFT, PREPARING, COMPLETED"
decimal totalAmount
}
| Enum | Values |
|---|---|
| Role | ADMIN, CASHIER, KITCHEN |
| OrderStatus | DRAFT, SENT, PREPARING, COMPLETED, PAID, CANCELLED |
| PaymentMethod | CASH, DIGITAL, UPI |
| SessionStatus | OPEN, CLOSED |
stateDiagram-v2
[*] --> DRAFT: Order Created
DRAFT --> SENT: Send to Kitchen
SENT --> PREPARING: Kitchen Starts
PREPARING --> COMPLETED: Kitchen Finishes
COMPLETED --> PAID: Payment Received
PAID --> [*]
DRAFT: π Draft\n(Adding Items)
SENT: π¨ Sent\n(Awaiting Kitchen)
PREPARING: π¨βπ³ Cooking\n(In Progress)
COMPLETED: β
Ready\n(Serve to Customer)
- Node.js 18+
- PostgreSQL database
- npm or yarn
git clone https://github.com/Hardagya12/Odoo-Cafe-Pos.git
cd odoo-cafe-poscd backend
npm install
# Setup .env file
# Run migrations
npx prisma generate
npx prisma migrate dev
# Seed data
npm run seed
# Start Server
npm run devcd frontend
npm install
# Setup .env.local file
# Start Client
npm run devOpen http://localhost:3000 for Frontend and http://localhost:5000 for Backend API.
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | β Yes |
JWT_SECRET |
Secret key for auth tokens | β Yes |
PORT |
API Port (default 5000) | β No |
| Variable | Description | Required | Default |
|---|---|---|---|
NEXT_PUBLIC_API_URL |
Boolean | β Yes | http://localhost:5000/api |
| Password | Role | Usage | |
|---|---|---|---|
admin@odoo.com |
admin123 |
ADMIN | Full Access, Manage Users/Products |
cashier@odoo.com |
cashier123 |
CASHIER | POS Main, Orders, Payments |
kitchen@odoo.com |
kitchen123 |
KITCHEN | KDS View Only |
- Login as Cashier.
- Select Terminal and Open Session (Enter opening float).
- Select Table from the floor plan.
- Add Items to cart. Add variants/notes if needed.
- Send to Kitchen (Order appears on KDS).
- Kitchen Staff marks items as Ready.
- Payment: Select Cash/UPI, confirm payment.
- Close Session at end of day (Enter closing cash).
Base URL: /api/auth
POST /signup- Register new userPOST /login- Authenticate userGET /me- Get current user profile
Base URL: /api/products
GET /- List all productsPOST /- Create productPUT /:id- Update productDELETE /:id- Delete productGET /categories- List categoriesPOST /categories- Create categoryDELETE /categories/:id- Delete category
Base URL: /api/orders
POST /- Create new orderGET /- List all ordersGET /:id- Get order detailsPUT /:id/status- Update order statusPOST /:id/pay- Process paymentPOST /:id/email- Send receipt email
Base URL: /api/kitchen
GET /active- Get active kitchen ticketsPUT /:id/status- Update ticket status
Base URL: /api
GET /floors- List floorsPOST /floors- Create floorPOST /floors/:id/tables- Add table to floorPUT /tables/:id- Update table detailsDELETE /tables/:id- Remove table
Base URL: /api
POST /sessions/open- Open POS sessionPUT /sessions/:id/close- Close sessionGET /sessions/active- Get active sessionGET /sessions/:id- Get session detailsGET /terminals- List terminalsPOST /terminals- Create terminalDELETE /terminals/:id- Delete terminal
Base URL: /api/dashboard
GET /stats- Summary statisticsGET /recent-orders- Recent activityGET /sales-chart- Sales visualization dataGET /sales-trends- Trend analysisGET /top-products- Best selling itemsGET /heatmap-data- Busy hours heatmap
Base URL: /api
GET /settings- Get store configPUT /settings- Update store configGET /users- List usersPOST /users- Create userPUT /users/:id- Update userDELETE /users/:id- Delete user
odoo-cafe-pos/
βββ backend/
β βββ src/
β β βββ controllers/ # Route controllers
β β βββ routes/ # API routes
β β βββ middlewares/ # Auth & Validation
β β βββ services/ # Business logic
β β βββ app.js # Express entry point
β βββ prisma/
β β βββ schema.prisma # Database Schema
β βββ package.json
βββ frontend/
β βββ src/
β β βββ app/ # Next.js App Router Pages
β β βββ components/ # UI Components
β β βββ lib/ # Utilities & API client
β β βββ stores/ # Zustand Stores
β βββ package.json
βββ README.md
- ADMIN: Access to Dashboard, Settings, User Management, Menu Editing.
- CASHIER: Access to POS, Orders, Payments, Sessions.
- KITCHEN: Access restricted to Kitchen Display System (KDS).
(Placeholders)
- Fork the repo
- Create feature branch (
git checkout -b feature/NewFeature) - Commit changes
- Push to branch
- Create Pull Request
This project is licensed under the MIT License.
Built with β€οΈ for Coffee Lovers
β Star this repo if you find it helpful! β