A comprehensive Flask-based PTO (Paid Time Off) tracking system for Mount Sinai West Cardiovascular Institute.
- Multi-role Management: Admin, Clinical, Super Admin, MOA Supervisor, Echo Tech Supervisor
- PTO Request Submission: Full and partial day requests with automatic balance calculation
- Approval Workflow: Role-based approval system with email notifications
- Calendar View: Visual representation of approved time off
- Staff Directory Integration: Pre-configured staff members by position and team
- Real-time Balance Tracking: Automatic PTO balance deduction upon approval
- Python 3.11 or higher
- Flask and required dependencies (see requirements.txt)
-
Clone/Download the project to your local machine
-
Navigate to the project directory:
cd PtoTrackerLocal -
Install dependencies (if virtual environment is not set up):
pip install -r requirements.txt
Option 1: Using Python directly
python app.pyOption 2: Using the batch file (Windows)
start_server.batThe application will be available at: http://127.0.0.1:5000
For testing and initial setup, use these default credentials:
| Role | Password | |
|---|---|---|
| Admin Manager | [email protected] | admin123 |
| Clinical Manager | [email protected] | clinical123 |
| Super Admin | [email protected] | super123 |
| MOA Supervisor | [email protected] | moa123 |
| Echo Tech Supervisor | [email protected] | echo123 |
- Visit the main page
- Select your team, position, and name from the dropdowns
- Choose your PTO dates and type
- Submit the request
- Receive email confirmation
- Login using manager credentials
- Access your role-specific dashboard
- Review pending requests
- Approve or deny requests with reasons
- Track team PTO usage
- Home (
/): Submit new PTO requests - Calendar (
/calendar): View approved time off - Login (
/login): Manager authentication - Dashboards: Role-specific management interfaces
- User: Base user class with PTO balance tracking
- TeamMember: Employees who submit requests
- Manager: Supervisors who approve requests
- PTORequest: Individual PTO request records
- 7.5-hour workday standard (configurable)
- Automatic PTO deduction upon approval
- Partial day support with hourly calculations
- Email notifications for all status changes
- Role-based access control for different manager types
PtoTrackerLocal/
├── app.py # Main Flask application
├── database.py # Database configuration
├── models.py # SQLAlchemy models
├── routes.py # Flask routes and views
├── auth.py # Authentication system
├── email_service.py # Email notification service
├── pto_system.py # Core PTO business logic
├── static/
│ ├── css/custom.css # Mount Sinai themed styles
│ └── js/main.js # Frontend JavaScript
├── templates/ # Jinja2 HTML templates
└── requirements.txt # Python dependencies
Edit the get_staff_directory() function in routes.py to add new team members.
Update the business logic in pto_system.py and models.py for different PTO rules.
Modify static/css/custom.css to customize the Mount Sinai theme colors and layout.
- Database: SQLite for local development (easily configurable for PostgreSQL)
- Authentication: Session-based with password hashing
- Email: SMTP configuration with fallback to console logging
- Security: Role-based access control and CSRF protection
For production use:
- Change default passwords immediately
- Configure proper email SMTP settings
- Use a production database (PostgreSQL recommended)
- Set up proper SSL/HTTPS
- Use a production WSGI server (Gunicorn, uWSGI)
The application includes comprehensive frontend tests using Playwright MCP:
# Run all basic tests
npx playwright test tests/basic.spec.js --project=chromium
# Run with visual browser
npx playwright test --headed
# View test reports
npx playwright show-report- ✅ UI component rendering and interaction
- ✅ Manager authentication and role-based access
- ✅ PTO request submission and validation
- ✅ Approval/denial workflows
- ✅ Calendar integration
- ✅ Multi-browser compatibility (Chrome, Firefox, Safari)
- ✅ Mobile responsiveness
See TESTING.md for detailed testing documentation.
For issues or questions about the PTO Tracker system, contact your IT administrator.