A comprehensive leave management system built with Streamlit and Supabase for internal company use.
- β Leave Balance Tracking: View all leave types and remaining balances
- β Leave Request Submission: Submit new leave requests with proper validation
- β Request History: View all past and current leave requests
- β Real-time Status: Track approval status of submitted requests
- β Employee Profile: View personal information and employment details
- β Team Dashboard: Overview of all team members and their leave status
- β Approval Workflow: Approve or reject leave requests with comments
- β Team Analytics: View team leave usage and patterns
- β Dual Interface: Access both employee and supervisor views
- β Real-time Notifications: See pending requests requiring approval
- PTO: 21 days (regular) / 30 days (senior) - includes casual leave
- PPTO: 21 days personal paid time off
- Paternal Leave: 21 days maximum
- Maternal Leave: 90 days maximum
- Bereavement: 3 days per incident
- Sick Leave: 19 days (12 @ 100%, 7 @ 50%)
- Frontend: Streamlit (Python web framework)
- Database: Supabase (PostgreSQL)
- Authentication: Email-based with @tempo.fit domain restriction
- Deployment: Streamlit Cloud
- Data Visualization: Plotly charts and metrics
- Python 3.11+
- Supabase account
- @tempo.fit email addresses for users
git clone <your-repo-url>
cd tempo-leave-managementpip install -r requirements.txt- Go to supabase.com
- Create a new project
- Copy your database URL from Settings > Database
- Update the DATABASE_URL in
.streamlit/secrets.toml
streamlit run app.pygit add .
git commit -m "Initial commit"
git push origin main- Go to share.streamlit.io
- Connect your GitHub repository
- Set main file as
app.py - Add secrets in the Streamlit Cloud dashboard:
DATABASE_URL = "your-supabase-database-url"
In Streamlit Cloud secrets, add:
DATABASE_URL = "postgresql://postgres:password@host:5432/database"The application uses the following main tables:
users: Basic user informationuser_profiles: Employee details and hierarchyleave_types: Available leave typesleave_balances: Employee leave allocationsleave_requests: Leave applications and approvals
- Employee:
[email protected] - Supervisor:
[email protected]
- Add user data to the
create_initial_data()function indatabase.py - Users must have @tempo.fit email addresses
- Set supervisor relationships in the user profiles
- Domain Restriction: Only @tempo.fit email addresses
- Role-Based Access: Employee and Supervisor roles
- Session Management: Streamlit session state
- Simple Login: Email-based authentication for demo
- Leave balance cards with progress indicators
- Recent requests table with status colors
- Quick action buttons for common tasks
- Profile information and service years
- Team metrics and statistics
- Pending requests requiring approval
- Team member overview table
- Approval/rejection workflow
- Employee submits leave request
- System validates request (dates, balance, requirements)
- Request sent to supervisor for approval
- Supervisor reviews and approves/rejects
- Leave balance automatically updated on approval
- Employee receives status update
- Domain-restricted email authentication
- Role-based access control
- Database connection security
- Input validation and sanitization
- Session management
- Real-time leave balance tracking
- Team leave usage patterns
- Department-wise analytics
- Historical request data
- Approval workflow metrics
- Modern, clean interface
- Responsive design
- Color-coded status indicators
- Interactive charts and metrics
- Mobile-friendly layout
Edit leave_types in database.py to modify:
- Leave type names
- Documentation requirements
- Reason requirements
- Approval workflow
Modify create_initial_data() to adjust:
- Default leave allocations
- Senior employee benefits
- Annual carry-over rules
- β Local Development: Fully working with SQLite database
- β Database System: Smart fallback (SQLite local, PostgreSQL production)
- β Core Features: Employee dashboard, supervisor dashboard, leave management
- β Authentication: Email-based with @tempo.fit domain restriction
- π Online Deployment: Ready for Streamlit Cloud, Heroku, or Railway
# Install dependencies
pip install -r requirements.txt
# Initialize database
python -c "from database import init_database, create_initial_data; init_database(); create_initial_data()"
# Run application
python -m streamlit run app.pyOnce deployed, the application will be available at:
https://your-app-name.streamlit.app
For technical support or questions:
- Email: [email protected]
- Internal contact: System Administrator
Internal use only - Tempo.fit Company
Built with β€οΈ for Tempo.fit Team