Skip to content

Latest commit

Β 

History

76 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

β˜• Odoo Cafe POS - Smart Order Management

Odoo Cafe Logo

A modern, enterprise-grade Point of Sale system built with Next.js, Prisma, and PostgreSQL

Next.js Prisma PostgreSQL TailwindCSS Express

Features β€’ Tech Stack β€’ Installation β€’ Architecture β€’ Screenshots


TEAM MEMBERS

  • Hardagya Rajput
  • Jagjeet Dangar
  • Isha Patel

πŸ“– Table of Contents


🎯 Overview

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.

Key Objectives

  • 🏒 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)

System Overview Mindmap

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
Loading

✨ Features

πŸ–₯️ POS Operations

  • βœ… 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

πŸ‘¨β€πŸ³ Kitchen Display System (KDS)

  • βœ… 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

πŸ”§ Admin & Inventory

  • βœ… 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

πŸ“Š Views & Dashboards

  • βœ… 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)

πŸš€ Smart Automation

  • βœ… 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

Order Workflow Diagram

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
Loading

πŸ” Security & Tech

  • βœ… JWT-based authentication
  • βœ… Encrypted passwords (bcryptjs)
  • βœ… Protected API routes (Middleware)
  • βœ… Optimistic concurrency control on orders

πŸ› οΈ Tech Stack

Frontend

  • 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

Backend

  • 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

Technology Stack Visualization

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
Loading

πŸ—οΈ System Architecture

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
Loading

πŸ—„οΈ Database Schema

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
    }
Loading

Key Enums

Enum Values
Role ADMIN, CASHIER, KITCHEN
OrderStatus DRAFT, SENT, PREPARING, COMPLETED, PAID, CANCELLED
PaymentMethod CASH, DIGITAL, UPI
SessionStatus OPEN, CLOSED

πŸ”„ Order Lifecycle

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)
Loading

πŸ“₯ Installation

Prerequisites

  • Node.js 18+
  • PostgreSQL database
  • npm or yarn

Step 1: Clone Repository

git clone https://github.com/Hardagya12/Odoo-Cafe-Pos.git
cd odoo-cafe-pos

Step 2: Backend Setup

cd backend
npm install
# Setup .env file
# Run migrations
npx prisma generate
npx prisma migrate dev
# Seed data
npm run seed
# Start Server
npm run dev

Step 3: Frontend Setup

cd frontend
npm install
# Setup .env.local file
# Start Client
npm run dev

Open http://localhost:3000 for Frontend and http://localhost:5000 for Backend API.


πŸ” Environment Variables

Backend (.env)

Variable Description Required
DATABASE_URL PostgreSQL connection string βœ… Yes
JWT_SECRET Secret key for auth tokens βœ… Yes
PORT API Port (default 5000) ❌ No

Frontend (.env.local)

Variable Description Required Default
NEXT_PUBLIC_API_URL Boolean βœ… Yes http://localhost:5000/api

πŸš€ Usage

Default Accounts (from Seed)

Email 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

Standard Workflow

  1. Login as Cashier.
  2. Select Terminal and Open Session (Enter opening float).
  3. Select Table from the floor plan.
  4. Add Items to cart. Add variants/notes if needed.
  5. Send to Kitchen (Order appears on KDS).
  6. Kitchen Staff marks items as Ready.
  7. Payment: Select Cash/UPI, confirm payment.
  8. Close Session at end of day (Enter closing cash).

πŸ“‘ API Reference

πŸ” Authentication

Base URL: /api/auth

  • POST /signup - Register new user
  • POST /login - Authenticate user
  • GET /me - Get current user profile

πŸ“¦ Products & Inventory

Base URL: /api/products

  • GET / - List all products
  • POST / - Create product
  • PUT /:id - Update product
  • DELETE /:id - Delete product
  • GET /categories - List categories
  • POST /categories - Create category
  • DELETE /categories/:id - Delete category

πŸ“ Orders

Base URL: /api/orders

  • POST / - Create new order
  • GET / - List all orders
  • GET /:id - Get order details
  • PUT /:id/status - Update order status
  • POST /:id/pay - Process payment
  • POST /:id/email - Send receipt email

πŸ‘¨β€πŸ³ Kitchen

Base URL: /api/kitchen

  • GET /active - Get active kitchen tickets
  • PUT /:id/status - Update ticket status

🏒 Floor & Tables

Base URL: /api

  • GET /floors - List floors
  • POST /floors - Create floor
  • POST /floors/:id/tables - Add table to floor
  • PUT /tables/:id - Update table details
  • DELETE /tables/:id - Remove table

πŸ–₯️ Sessions & Terminals

Base URL: /api

  • POST /sessions/open - Open POS session
  • PUT /sessions/:id/close - Close session
  • GET /sessions/active - Get active session
  • GET /sessions/:id - Get session details
  • GET /terminals - List terminals
  • POST /terminals - Create terminal
  • DELETE /terminals/:id - Delete terminal

πŸ“Š Dashboard

Base URL: /api/dashboard

  • GET /stats - Summary statistics
  • GET /recent-orders - Recent activity
  • GET /sales-chart - Sales visualization data
  • GET /sales-trends - Trend analysis
  • GET /top-products - Best selling items
  • GET /heatmap-data - Busy hours heatmap

βš™οΈ Settings & Users

Base URL: /api

  • GET /settings - Get store config
  • PUT /settings - Update store config
  • GET /users - List users
  • POST /users - Create user
  • PUT /users/:id - Update user
  • DELETE /users/:id - Delete user

πŸ“ Project Structure

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

πŸ” Role-Based Access Control

  • ADMIN: Access to Dashboard, Settings, User Management, Menu Editing.
  • CASHIER: Access to POS, Orders, Payments, Sessions.
  • KITCHEN: Access restricted to Kitchen Display System (KDS).

πŸ“Έ Screenshots

(Placeholders)

POS Interface

POS

Kitchen Display

KDS

Analytics Dashboard

Dashboard


🀝 Contributing

  1. Fork the repo
  2. Create feature branch (git checkout -b feature/NewFeature)
  3. Commit changes
  4. Push to branch
  5. Create Pull Request

πŸ“„ License

This project is licensed under the MIT License.


Built with ❀️ for Coffee Lovers

⭐ Star this repo if you find it helpful! ⭐

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages