Thant Zin Phyo
Back to Selected Work
Technical DossierCloud-native Point of Sale system.

Morning Haze Cafe POS System

A high-throughput web POS built for real-time ordering, automated inventory deduction, and fast offline-first resilience. Designed to streamline operations for cafe staff and administrators.

Engineering Contribution

Full-stack development, database architecture (Prisma/PostgreSQL), secure RBAC implementation, UI/UX design, and Next.js Server Actions integration.

Technology Stack

01 / Architecture

Frontend

  • Next.js 15
  • React 19
  • Tailwind CSS
  • Lucide React

Backend & Database

  • Prisma ORM
  • PostgreSQL
  • Next.js Server Actions

Security & Storage

  • Bcryptjs
  • Zod
  • Vercel Blob

System Schematics

02 / Blueprints
Entity-Relationship Diagram
Fig. A — Entity-Relationship Diagram
Use Case Diagram
Fig. B — System Use Case Diagram

Core Modules

03 / Subsystems
Module 01

Role-Based Access Control (RBAC)

Secure authentication and authorization system distinguishing between Cashiers and Administrators.

  • Secure login with bcrypt password hashing
  • Role-specific dashboard routing
  • Session validation
Module 02

Order & Payment Processing

Core POS functionality allowing cashiers to take orders, calculate totals, and process payments.

  • Cart management (add, update, remove items)
  • Tax and total calculations
  • Payment recording and receipt generation
Module 03

Menu & Category Management

Administrative tools to control the product offerings visible to cashiers.

  • CRUD operations for Categories
  • CRUD operations for Menu Items
  • Image uploading via Vercel Blob
Module 04

Inventory Tracking

Automated stock management that tracks raw materials and final product availability.

  • Real-time stock deduction upon order completion
  • Low stock alerts and reorder levels
  • Manual stock adjustments by admins

Implementation Notes

04 / Code Excerpt

Server Actions and Prisma Integration

The application leverages Next.js Server Actions for form submissions and data mutations, ensuring type safety from the client to the database. Prisma ORM is used for robust database modeling.

// Example: Creating an order transaction
export async function createOrder(data: OrderInput) {
  return await prisma.$transaction(async (tx) => {
    const order = await tx.order.create({
      data: {
        cashierId: data.cashierId,
        totalAmount: data.total,
        orderStatus: 'COMPLETED',
        orderItems: {
          create: data.items.map(item => ({
             menuItemId: item.id,
             quantity: item.quantity,
             unitPrice: item.price,
             subTotal: item.price * item.quantity
          }))
        }
      }
    });
    
    // Deduct inventory
    for (const item of data.items) {
      await tx.inventory.update({
        where: { menuItemId: item.id },
        data: { stockQuantity: { decrement: item.quantity } }
      });
    }
    return order;
  });
}

Dynamic UI with Tailwind CSS

The UI is fully responsive, built with Tailwind CSS. It uses CSS Grid for the POS layout, allowing cashiers to quickly access categories and menu items on touch devices.