
Ongba Management System
Full-stack restaurant employee management and sales reporting system
- Website
- Next.js
- React
- MongoDB
- TypeScript
- Tailwindcss
- Prisma
- Shadcn/ui
- Vercel
Tech stack
- Next.js- React framework
- Prisma- Node.js and TypeScript ORM
- MongoDB- Database
- Tailwindcss- Styling
- Shadcn/ui- UI components
- Firebase storage- Image storage
- Vercel- Hosting
Features
Sales report generation
Detailed breakdown of daily sales is automatically calculated using the submitted raw sales data, such as total sales, card sales, online sales, and tips. Employees' hours and tips are also calculated and displayed in the report. The report is then generated and stored in the system for future reference.
My shifts: Track hours worked and tips earned
Employees can easily track their shifts, hours worked, and tips earned in one convenient place. They can view their total hours worked, total tips earned bi-weekly for the current month, and review past months' earnings
Monthly sales summary - Admin Feature
Admin can view monthly sales summaries, including total sales, in-store sales, and online sales. This feature provides a quick overview of the restaurant's performance for each month.
Monthly employees' hours and tips breakdown - Admin Feature
Admin can view a detailed breakdown of the employees' hours worked and tips earned for each month. This feature provides insights into the employees' performance and helps with payroll management.
Monthly cashflow - Admin Feature
Submitted sales report data is displayed and summarized in a monthly cashflow table. This feature provides insights into the restaurant's financial performance.
Role-based access control
Role-based access control (RBAC) is implemented to manage user roles and permissions. Admins have full access to all features, while employees, such as managers, chefs, and servers, have different levels of access based on their roles.
For example, users with chef roles can only view the sales report and their shift records, while servers can also create new sales reports.
Other features
- Simple cash calculator app for calculating cash in the till.
- Account settings for updating personal information, password, and profile picture.
- Session-based authentication and authorization - login, signup using email and password, and reset password by email.
- Rate limiting using sliding window algorithm.
Challenges and what I learned
- After deploying to Vercel, I realized the difference in timezone between the server and the client had messed up the date and time of the sales report. For example, when a user submits a sales report, the date and time are recorded in the user's local timezone, says 21:00 on 2024-12-12 Vancouver time, which is 05:00 on 2024-12-13 UTC time. When the data is processed on the server, because the server is in UTC timezone, that report is mistakenly treated as being created at 05:00 on 2024-12-13 Vancouver time. This causes all data to be incorrectly processed and displayed. I learned to handle the timezone difference by converting the date and time to Vancouver timezone before processing the data.
Future improvements
- Staff scheduling: view, create, and manage staff schedules; ability to swap shifts.
- Inventory management: track inventory levels and expenses.
- Payroll management: calculate employee wages, generate pay stubs, and manage payroll.