Skip to content
Projects

AbbasRostami/Cafino has 30 GitHub stars and 0 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-15 20:21 UTC. Last push 2026-11-14.

How these counts are measured

What you can do

  • 🏠 Homepage with category display and popular products
  • 🍽️ Complete menu with advanced filters (price, category, rating)
  • 🛒 Shopping cart with add/decrease/remove item capabilities
  • 💳 Integrated payment system with discount code support

Measured star growth

in 24h
0
in 7 days
Update delayed
in 15 days
Update delayed
in 1 month
Update delayed

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

About

Modern Cafe & Restaurant Management Platform built with Next.js and TypeScript.

Web & Apps

README.md

Original

☕ Cafino - Modern Cafe & Restaurant Management Platform

Core Technologies & Frameworks

Next.js React TypeScript Tailwind CSS shadcn/ui

State & Data Management

TanStack Query Zustand React Hook Form Zod

Testing & PWA

Vitest Playwright Testing Library Serwist PWA

Visualization & UI

Recharts Framer Motion Lucide Icons Swiper

Core Backend Technologies

NestJS PostgreSQL JWT Auth AWS S3

📋 Table of Contents


🎯 Project Overview

Cafino is a comprehensive and modern platform for cafe and restaurant management, developed using the latest web technologies. This project consists of two main parts: Frontend (Next.js) and Backend (Nest.js).

🔧 Backend:

🎨 Frontend & UI/UX:


✨ Key Features

🛒 Customer Features

  • 🏠 Homepage with category display and popular products
  • 🍽️ Complete menu with advanced filters (price, category, rating)
  • 🛒 Shopping cart with add/decrease/remove item capabilities
  • 💳 Integrated payment system with discount code support
  • ❤️ Favorites for saving preferred products
  • 📍 Address management with province and city selection
  • 📦 Order tracking with complete details
  • 🎫 Ticket system for support
  • 👤 User profile with personal settings
  • 🌙 Dark mode with theme switching
  • 📱 Responsive design optimized for mobile and desktop

👨‍💼 Admin Dashboard Features

  • 📊 Overview & Analytics with statistics and insights
  • 🍽️ Item Management (create, update, delete menu items with image uploads)
  • 📂 Category Management to organize menu items
  • 👥 User Management and role system
  • 📝 Comment Management and approval/rejection
  • 🎫 Support ticket management
  • 💰 Discount Management and discount codes
  • 📦 Order Management and status changes
  • 🚫 Blacklist Management and restrictions
  • 📈 Sales reports and revenue
  • 📊 Rate Limiting monitoring and control
  • 💬 Message Center for customer contact form submissions

🛡️ Security Features

  • 🔐 Two-factor authentication with OTP
  • 🛡️ Access management based on roles (RBAC)
  • 🚫 Rate limiting system to prevent abuse
  • 🔒 Route protection with Middleware
  • 🍪 Secure cookie management
  • 🛡️ Content Security Policy configured for service worker
  • 🔒 Security Headers (XSS protection, frame options, referrer policy)
  • ✅ Input Validation with Zod schema validation

🔐 Authentication & Authorization Features

The application uses a cookie-based authentication system with role-based access control:

  • OTP Authentication: Phone number-based OTP login system
  • Token Refresh: Automatic access token refresh
  • Role-Based Access: User and Admin roles with different permissions
  • Route Protection: Middleware-based route protection for /profile and /dashboard routes
  • Guest Support: Full functionality for non-authenticated users

🛒 Shopping Cart System Features

The cart system supports both guest and authenticated users with seamless experience:

  • Guest Cart: Local storage-based cart for unauthenticated users
  • Authenticated Cart: Server-synced cart for logged-in users
  • Cart Migration: Automatic migration of guest cart to server upon login
  • Real-time Updates: Immediate UI updates with optimistic rendering
  • Persistence: Cart data persists across browser sessions

🧪 Testing

🔬 Unit Tests

Tests are written using Vitest and React Testing Library:

  • Component tests in src/components/__tests__/
  • Hook tests in src/hooks/__tests__/
  • Service tests in src/services/__tests__/
  • Store tests in src/store/__tests__/

🎭 E2E Tests

Playwright tests cover critical user flows:

  • Authentication flows - Login, logout, OTP verification
  • Shopping and checkout process - Add to cart, checkout, payment
  • Admin panel operations - Dashboard, item management
  • Navigation testing - Menu navigation, responsive design

🔒 Security Features

  • Content Security Policy: Configured for service worker
  • Security Headers: XSS protection, frame options, referrer policy
  • Authentication Middleware: Protected routes with role-based access
  • Rate Limiting: API rate limiting support
  • Input Validation: Zod schema validation on all forms
  • Cookie Security: HttpOnly cookies for token storage

🛠️ Technology Stack

🎨 Frontend Stack

🔄 State Management & Data Fetching

🎭 UI/UX Libraries

🧪 Testing & Quality

🔧 Development Tools

🌐 PWA & Performance

🌍 Internationalization

  • Persian (Farsi) language support with RTL layout
  • Jalali-moment for Persian calendar integration
  • Vazirmatn font for Persian typography
  • Localized date and number formatting

📁 Project Structure

cafino/
├── 📁 public/                     # Static files
│   ├── 🖼️ images/                # Images and icons
│   └── 🔧 sw.js                  # Service Worker
├── 📁 src/
│   ├── 📁 app/                   # Next.js App Router
│   │   ├── 📁 (admin)/                # Admin Panel Route Group
│   │   │   ├── 📁 components/          # Reusable components for the admin section
│   │   │   ├── 📁 context/             # React contexts for admin state
│   │   │   └── 📁 dashboard/           # The main admin dashboard area
│   │   │       ├── 📁 blacklist/       # Management of Banned users/Blacklist
│   │   │       ├── 📁 categories/      # Management of Categories
│   │   │       ├── 📁 comments/        # Management of Comments
│   │   │       ├── 📁 discounts/       # Management of Discounts/coupons
│   │   │       ├── 📁 items/           # Management of Items/products
│   │   │       ├── 📁 messages/        # Management of Internal messages
│   │   │       ├── 📁 orders/          # Management of Orders
│   │   │       ├── 📁 overview/        # Management of Admin dashboard/General overview
│   │   │       ├── 📁 rate-limit/      # Management of Request rate limiting
│   │   │       ├── 📁 tickets/         # Management of Support tickets
│   │   │       ├── 📁 users/           # Management of Users
│   │   │       ├── 📄 DashboardClient.tsx
│   │   │       └── 📄 layout.tsx
│   │   ├── 📁 (main)/            # Customer-facing pages
│   │   │   ├── 🏠 page.tsx       # Homepage
│   │   │   ├── 🍽️ menu/          # Menu
│   │   │   ├── 🛒 checkout-cart/ # Shopping cart
│   │   │   ├── 💳 payment/       # Payment
│   │   │   ├── 📞 contact-us/    # Contact us
│   │   │   └── ℹ️ about-us/      # About us
│   │   ├── 📁 (profile)/         # User profile pages
│   │   │   └── 📁 profile/       # Main profile section
│   │   │       ├── 📁 addresses/ # User addresses management
│   │   │       ├── 📁 favorites/ # User favorites list
│   │   │       ├── 📁 orders/    # Order history
│   │   │       ├── 📁 overview/  # Profile overview
│   │   │       ├── 📁 settings/  # User settings
│   │   │       ├── 📁 tickets/   # Support tickets
│   │   │       └── 📄 layout.tsx
│   │   ├── 📁 offline/           # PWA offline page
│   │   ├── 📄 layout.tsx         # Root layout
│   │   ├── 📄 manifest.ts        # Web App Manifest
│   │   ├── 📄 not-found.ts       # Custom 404 page
│   │   ├── 📄 globals.css        # Global styles
│   │   ├── 📄 robots.ts          # Dynamic robots.txt
│   │   ├── 📄 sitemap.ts         # Dynamic sitemap.xml
│   │   └── 📄 sw.ts              # Service Worker Configuration (Serwist)
│   ├── 📁 components/            # React components
│   │   ├── 📁 main/              # Customer UI components
│   │   ├── 📁 profile/           # Profile components
│   │   ├── 📁 shared/            # Shared components
│   │   ├── 📁 skeleton/          # Loading skeletons
│   │   └── 📁 ui/                # UI primitives (Shadcn-based)
│   ├── 📁 services/              # API service hooks
│   │   ├── 📁 auth/              # Authentication services
│   │   ├── 📁 cart/              # Shopping cart services
│   │   ├── 📁 items/             # Menu item services
│   │   ├── 📁 orders/            # Order management
│   │   ├── 📁 user/              # User management
│   │   ├── 📁 addresses/         # Address management
│   │   ├── 📁 favorites/         # Favorites management
│   │   ├── 📁 payment/           # Payment processing
│   │   ├── 📁 comments/          # Product reviews
│   │   ├── 📁 tickets/           # Support system
│   │   └── 📁 ...                # Other API services
│   ├── 📁 store/                 # Zustand state management
│   │   ├── 📄 authStore.ts       # Authentication state
│   │   ├── 📄 cartStore.ts       # Shopping cart state
│   │   └── 📄 useConfirmStore.ts # Confirmation modal state
│   ├── 📁 hooks/                 # Custom React hooks
│   │   ├── 📁 api/               # API-related hooks
│   │   ├── 📁 business/          # Business logic hooks
│   │   └── 📁 ui/                # UI-related hooks
│   ├── 📁 schemas/               # Zod validation schemas
│   │   ├── 📁 main/              # Main app schemas
│   │   ├── 📁 admin/             # Admin schemas
│   │   └── 📁 profile/           # Profile schemas
│   ├── 📁 types/                 # TypeScript type definitions
│   │   ├── 📁 main/              # Main app types
│   │   ├── 📁 admin/             # Admin types
│   │   └── 📁 Profile/           # Profile types
│   ├── 📁 utils/                 # Utility functions
│   │   ├── 📄 formatters.tsx     # Date, currency, text formatters
│   │   ├── 📄 utils.ts           # General utilities
│   │   └── 📄 MotionWrapper.tsx  # Animation wrapper
│   ├── 📁 lib/                   # Library configurations
│   │   └── 📁 metadata/          # SEO metadata
│   ├── 📁 test/                  # Test setup
│   └── 📄 middleware.ts          # Next.js middleware for auth
├── 📁 tests/                     # E2E tests
│   ├── 📁 admin/                 # Admin tests
│   ├── 📁 auth/                  # Authentication tests
│   ├── 📁 navigation/            # Navigation tests
│   └── 📁 shopping/              # Shopping flow tests
├── 📄 next.config.ts             # Next.js configuration
├── 📄 tailwind.config.js         # Tailwind configuration
├── 📄 tsconfig.json              # TypeScript configuration
├── 📄 playwright.config.ts       # Playwright configuration
├── 📄 vitest.config.mts          # Vitest configuration
└── 📄 package.json               # Dependencies

📂 Key Folders Explanation

  • app/: Next.js App Router with route groups for different user types
  • components/: React components with modular structure
  • services/: API calls and business logic hooks
  • hooks/: Custom React hooks for reusable logic
  • store/: Zustand state management with persistence
  • types/: TypeScript type definitions organized by feature
  • utils/: Helper functions and utilities
  • schemas/: Zod validation schemas for form validation

🔄 Data Flow

  • Client-Side/: React Query for caching and state management
  • Server-Side/: Next.js API Routes for proxy
  • Authentication/: JWT tokens with httpOnly cookies
  • Authorization/: Role-based access control (RBAC)
  • Caching/: Multi-layer caching strategy

📜 Available Scripts

Command Description
npm run dev Start development server
npm run build Build for production
npm run start Start production server
npm run lint Run ESLint

🧪 Testing Scripts

Command Description
npm run test Run unit tests with Vitest
npm run test:run Run tests once
npm run test:ui Open Vitest UI
npm run test:watch Run tests in watch mode
npm run test:e2e Run Playwright E2E tests
npm run test:e2e:ui Open Playwright UI
npm run test:e2e:headed Run E2E tests in headed mode
npm run test:e2e:debug Debug E2E tests

📄 License

This project is private and proprietary. All rights reserved.

Ask DeepWiki