Foodya is a full-featured Restaurant POS (Point of Sale) system coupled with a simple website. It is designed to help restaurants manage their day-to-day operations efficiently, including orders, tables, menu items, bookings, employees, transactions, and reports. The system includes Role-Based Access Control (RBAC) per page to manage permissions for different users.
Documentation Β· Request Feature Β· Connect on Linkedin
- Manage users: add, update, deactivate/activate.
- Manage roles: create multiple roles with specific permissions.
- Manage modules/pages: control access to each page in the app.
- Assign permissions: customize access per role for different pages.
- Menu Categories: create, update, delete multiple categories.
- Menu Items: manage items with variants and sizes.
- Orders: handle Dine-in, Take-away, and Drive-thru orders.
- Dine-in orders: select tables, place/reselect orders, fetch existing orders.
- Bookings: manage table bookings with optional advance payment.
- Invoices: view, print, and track past invoices and order details.
- Employee management: add employees, manage designations and promotions.
- Salary management:
- Update salaries, track changes over time.
- Generate monthly salaries with one click.
- Track payment status: Pending, Paid.
- Include bonus, penalties, and custom reasons.
- Print salary statements and history.
- Manage transaction categories (salaries, invoices, others).
- Add manual income and expenses.
- Reports:
- Summary cards: monthly income, expense, active employees, total employees.
- Charts: visualize monthly/yearly profit and expense trends.
- Hover cards: view transaction details on hover.
- Charts for financial analysis using Chart.js and Recharts.
- Animated website elements with GSAP for smooth user experience.
- Next.js 15 (App Router) β React framework for server-side rendering and routing.
- React Hook Form β Efficient form handling.
- ShadCN UI & Cult UI β Prebuilt, customizable UI components.
- Tailwind CSS β Utility-first styling.
- GSAP β Animations for website interactions.
- useSWR β Data fetching with caching and revalidation.
- TypeScript β Strongly typed codebase.
- Drizzle ORM β Type-safe ORM for MySQL.
- MySQL β Relational database for structured data.
- Auth.js (Credentials-based) β Secure authentication.
- Zod β Input validation and schema enforcement.
- Chart.js & Recharts β Data visualization.
- React Hot Toast β Notifications.
- ExcelJS & jsPDF β Export data to Excel or PDF.
- SWR β Data fetching and caching.
- Radix UI Components β Accessible UI elements.
- clsx & tailwind-merge β Dynamic class management.
foodya/
βββ app/ # Next.js App Router
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ not-found.tsx # 404 page
β β
β βββ (website)/ # Public website routes
β β βββ page.tsx # Homepage
β β βββ about/ # About page
β β βββ menu/ # Public menu display
β β
β βββ login/ # Authentication
β β βββ page.tsx # Login page
β β
β βββ errors/ # Error pages
β β βββ 403/ # Forbidden access
β β βββ database/ # Database error page
β β
β βββ restaurant/ # Protected POS routes
β β βββ layout.tsx # Dashboard layout with sidebar
β β βββ page.tsx # Dashboard redirect
β β β
β β βββ (admin-panel)/ # RBAC Management
β β β βββ modules/ # App modules/pages management
β β β βββ permissions/ # Permission assignments
β β β βββ roles/ # Role management
β β β βββ users/ # User management
β β β
β β βββ (restaurant)/ # Restaurant Operations
β β βββ dashboard/ # Main dashboard with quick actions
β β βββ menu-categories/ # Menu category management
β β βββ menu-items/ # Menu items with variants
β β βββ tables/ # Table management
β β βββ bookings/ # Reservation system
β β βββ orders/ # Order processing (dine-in, takeaway, drive-thru)
β β βββ invoices/ # Invoice generation and management
β β βββ employees/ # Employee records with designations
β β βββ salaries/ # Payroll management
β β βββ transaction-categories/ # Financial categories
β β βββ incomes/ # Income tracking
β β βββ expenses/ # Expense management
β β βββ reports/ # Financial reports and analytics
β β
β βββ api/ # API Routes
β βββ auth/[...nextauth]/ # Auth.js API handler
β βββ (restaurant)/ # Restaurant API endpoints
β β βββ menu-categories/ # Menu category CRUD
β β βββ menu-items/ # Menu items CRUD
β β βββ restaurant-tables/ # Tables CRUD
β β βββ bookings-tables/ # Bookings CRUD
β β βββ orders/ # Order processing
β β βββ invoices/ # Invoice operations
β β βββ employees/ # Employee management
β β βββ payrolls/ # Salary generation and tracking
β β βββ transaction-categories/ # Category management
β β βββ incomes/ # Income CRUD
β β βββ expenses/ # Expense CRUD
β β βββ reports/ # Financial reporting data
β βββ (website)/ # Public API endpoints
β β βββ categories/ # Public menu categories
β β βββ menu/ # Public menu items
β βββ module/ # Module management API
β βββ permission/ # Permission management API
β βββ role/ # Role management API
β βββ user/ # User management API
β βββ db-health/ # Database health check
β
βββ components/ # React Components
β βββ ui/ # ShadCN UI Components
β βββ DataTable/ # Reusable data table components
β βββ custom/ # Custom components
β βββ fallbacks/ # Loading and skeleton components
β
βββ lib/ # Utility Libraries
β βββ utils.ts # Helper functions
β βββ date-fns.ts # Date utilities
β βββ definations.ts # Type definitions
β β
β βββ db/ # Database
β β βββ index.ts # Database connection
β β
β βββ drizzle-schema/ # Database schemas
β β βββ admin-panel.schema.ts # RBAC tables
β β βββ restaurant.schema.ts # Restaurant operations tables
β β βββ index.ts # Schema exports
β β
β βββ zod-schema/ # Validation schemas
β β βββ index.ts # Common schemas
β β βββ restaurant.zod.ts # Restaurant-specific schemas
β β
β βββ crud-actions/ # Server actions
β β βββ users.ts # User operations
β β βββ permission.ts # Permission operations
β β βββ employees.ts # Employee operations
β β βββ ... # Other CRUD operations
β β
β βββ seeds/ # Database seeders
β β βββ seed.ts # Initial data seeding
β β
β βββ swr/ # SWR configuration
β β βββ index.ts # SWR hooks and config
β β
β βββ server/helpers/ # Server utilities
β βββ imageUpload.ts # Image upload handler
β
βββ hooks/ # Custom React Hooks
β βββ use-mobile.ts # Mobile detection
β βββ use-order-cart.ts # Order cart management
β βββ useDbStatus.ts # Database health monitoring
β βββ useModulePermission.ts # Permission checking
β βββ usePermissionNavigation.tsx # Permission-based navigation
β βββ useShortcuts.ts # Keyboard shortcuts
β βββ context/ # React Context providers
β βββ OrderCartContext.tsx # Order cart state
β βββ useUserContext.tsx # User session state
β
βββ types/ # TypeScript Definitions
β βββ columns.data-table.ts # Table column types
β βββ next-auth.d.ts # Auth.js type extensions
β βββ file-saver.d.ts # File saver types
β
βββ constants/ # Application Constants
β βββ index.ts # Shared constants
β
βββ public/ # Static Assets
β βββ icons/ # Icon files
β βββ images/ # Image assets
β βββ profile/ # User profile images
β
βββ README.md
βββ auth.config.ts # Auth.js configuration
βββ auth.ts # Authentication setup
βββ middleware.ts # Next.js middleware for route protection
βββ drizzle.config.ts # Drizzle ORM configuration
βββ next.config.ts # Next.js configuration
βββ package.json # Dependencies and scripts# 1. Clone the repo
git clone https://github.com/CodifyCanvas/foodya.git
cd foodya
# 2. Install dependencies
npm install
# 3. Set up .env file
cp .env
# Fill in your DATABASE_URL, AUTH_SECRET, etc.
# 4. Run Drizzle migrations
npx drizzle-kit push
# 5. Run dev server
npm run dev
# 6. Build for Production
npm run build
# 7. Start Server
npm start# Database Connection Parameters
DATABASE_NAME=
DATABASE_USER=
DATABASE_HOST=
DATABASE_PORT=
DATABASE_PASSWORD=
DATABASE_MAX_CONNECTION=
# Auth.js
AUTH_SECRET=| Shortcut | Action | Path |
|---|---|---|
| Alt + D | Go to Dashboard | /restaurant/dashboard |
| Alt + U | Go to Users Page | /restaurant/users |
| Alt + R | Go to Roles Page | /restaurant/roles |
| Alt + P | Go to Permissions Page | /restaurant/permissions |
| Alt + M | Go to Modules Page | /restaurant/modules |
| Alt + C | Go to Menu Categories Page | /restaurant/menu-categories |
| Alt + I | Go to Menu Items Page | /restaurant/menu-items |
| Alt + T | Go to Tables Page | /restaurant/tables |
| Alt + B | Go to Bookings Page | /restaurant/bookings |
| Alt + O | Go to Orders Page | /restaurant/orders |
| Alt + N | Go to Invoices Page | /restaurant/invoices |
| Alt + E | Go to Employees Page | /restaurant/employees |
| Alt + S | Go to Salaries Page | /restaurant/salaries |
| Alt + X | Go to Transaction Categories Page | /restaurant/transaction-categories |
| Alt + Q | Go to Expenses Page | /restaurant/expenses |
| Alt + Z | Go to Incomes Page | /restaurant/incomes |
| Alt + L | Go to Reports Page | /restaurant/reports |
Credentials-based login
Secure sessions using Auth.js
Middleware protected routes
RBAC Per Page
Contributions are welcome! Please feel free to submit a Pull Request.
This project is 100% free for personal or educational use.
MIT-style open freedom β no restrictions.
Built with β€οΈ using Next.js 15 by Shahzaib Awan
