AbbasRostami/Cafino
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.
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 & AppsREADME.md
Original☕ Cafino - Modern Cafe & Restaurant Management Platform
Core Technologies & Frameworks
State & Data Management
Testing & PWA
Visualization & UI
Core Backend Technologies
📋 Table of Contents
- Project Overview
- Key Features
- Authentication & Authorization Features
- Shopping Cart System Features
- Testing
- Security Features
- Technology Stack
- Project Structure
- Available Scripts
- License
🎯 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:
- Developer: alireza-msvi13
- Repository: alireza-msvi13/cafino
🎨 Frontend & UI/UX:
- Developer: AbbasRostami
- Repository: AbbasRostami/cafino
✨ 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
/profileand/dashboardroutes - 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
- Next.js 15.3.3 - React framework with SSR/SSG (App Router)
- React 19.0.0 - UI library
- TypeScript 5.0 - Type-safe development
- Tailwind CSS 4.0 - CSS framework with custom animations
- shadcn/ui - UI components
- Radix UI - Accessible components
🔄 State Management & Data Fetching
- Zustand 5.0.6 - State management with persistence
- TanStack Query 5.81.5 - Data management and caching
- React Hook Form 7.56.4 - Form management
- Zod 3.25.74 - Schema validation
🎭 UI/UX Libraries
- Framer Motion 12.15.0 - Animations
- Lucide React 0.511.0 - Icons
- Sonner 2.0.7 - Notifications
- Swiper 11.2.10 - Slider
- Recharts 2.15.4 - Charts
🧪 Testing & Quality
- Vitest 3.2.4 - Unit tests
- Playwright 1.55.0 - E2E tests
- Testing Library - React tests
- MSW 2.11.3 - Mock Service Worker
🔧 Development Tools
- ESLint - Linting
- Prettier - Code formatting
- Husky - Git hooks
- Lint-staged - Pre-commit hooks
🌐 PWA & Performance
- Serwist 9.2.1 - Service Worker
- Next PWA - PWA support
- Image Optimization - Image optimization
🌍 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 typescomponents/: React components with modular structureservices/: API calls and business logic hookshooks/: Custom React hooks for reusable logicstore/: Zustand state management with persistencetypes/: TypeScript type definitions organized by featureutils/: Helper functions and utilitiesschemas/: Zod validation schemas for form validation
🔄 Data Flow
Client-Side/: React Query for caching and state managementServer-Side/: Next.js API Routes for proxyAuthentication/: JWT tokens with httpOnly cookiesAuthorization/: 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.