A modern, Progressive Web App (PWA) for employee leave management with a 2-level approval workflow.
- 📱 Progressive Web App - Install on any device, works offline
- 🔐 Secure Authentication - Powered by Supabase Auth
- 👥 Role-Based Access Control - Staff, Manager, and Owner roles
- ✅ 2-Level Approval Workflow - Manager review → Owner final approval
- 📊 Leave Balance Tracking - Annual and medical leave entitlements
- 📄 Medical Certificate Upload - Support for medical leave documentation
- 📧 Email Notifications - Automatic status updates via Resend
- 📱 Mobile-First Design - Responsive UI for all screen sizes
- 📂 Leave History Archive - Track and filter past leave applications
- Frontend: Next.js 16 (App Router), React 19, TypeScript
- Backend: Supabase (PostgreSQL + Auth + Storage + Edge Functions)
- Styling: Tailwind CSS
- Email: Resend API
- Deployment: Jenkins CI/CD
CafeOS uses Supabase as a cloud-hosted database. The schema includes:
profiles- User profiles with roles (staff/manager/owner)leave_applications- Leave requests with approval statusesleave_entitlements- Annual leave balances per usermedical_certificates- File metadata for medical evidence
- Node.js 18+
- Supabase account
- Resend account (for email notifications)
-
Clone the repository
git clone https://github.com/YOUR_USERNAME/CafeOs.git cd CafeOs -
Install dependencies
npm install
-
Configure environment variables
cp .env.local.example .env.local
Edit
.env.localand add your Supabase credentials:- Get them from supabase.com/dashboard → Your Project → Settings → API
-
Run development server
npm run dev
-
Open the app
- Navigate to http://localhost:3000
The database migrations are in supabase/migrations/. To set up your Supabase
database:
- Create a new Supabase project
- Run migrations in order via Supabase SQL Editor, or use the Supabase CLI:
npx supabase db push
See EMAIL_NOTIFICATIONS_SETUP.md for detailed instructions on configuring the Resend integration and deploying the Edge Function.
See DEPLOYMENT.md for comprehensive deployment instructions including:
- Jenkins CI/CD pipeline setup
- Environment variable configuration
- Supabase Edge Function deployment
- Troubleshooting guide
CafeOs/
├── src/
│ ├── app/ # Next.js App Router pages
│ │ ├── admin/ # Admin dashboard pages
│ │ ├── leave/ # Leave application pages
│ │ └── profile/ # User profile pages
│ ├── components/ # Reusable React components
│ ├── lib/ # Utility functions and Supabase client
│ └── types/ # TypeScript type definitions
├── supabase/
│ ├── functions/ # Edge Functions (email notifications)
│ └── migrations/ # Database schema migrations
├── public/ # Static assets and PWA manifest
└── Jenkinsfile # CI/CD pipeline configuration
- Row Level Security (RLS) policies enforce data access control
- Supabase Auth handles authentication
- Environment variables keep credentials secure
- File uploads are validated and stored securely in Supabase Storage
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is private/proprietary. Contact the owner for licensing information.
For deployment or technical issues, see DEPLOYMENT.md troubleshooting section.