A Flask-based web application for managing a flight school's operations, including student registration, aircraft and instructor management, booking system, and administrative functions.
- make demo
- log in as student@example.com / student123
- This username and password comes from tests/test_data.json - see this file for admin user credentials as well as pre-loaded aircraft types and other data
- User Management
- Student registration and authentication
- Instructor management with certification tracking
- Role-based access control (Admin, Instructor, Student)
- Booking System
- Aircraft and instructor scheduling
- Interactive calendar with real-time availability
- Current time display on booking page
- Color-coded blocks for aircraft and instructor conflicts
- Conflict prevention for bookings
- Aircraft Management
- Aircraft registration and status tracking
- Maintenance status updates
- Administrative Dashboard
- Resource management interface
- User status monitoring
- Booking oversight
- Modern UI/UX
- Responsive Bootstrap-based design
- Interactive calendar interface
- Status indicators and notifications
- Real-time feedback for booking conflicts
- Dynamic updates based on selected aircraft/instructor
flightschool/
├── app/
│ ├── __init__.py # Application factory and extensions
│ ├── models/ # Database models
│ ├── routes/ # Route handlers
│ │ ├── admin.py # Admin dashboard routes
│ │ ├── auth.py # Authentication routes
│ │ ├── booking.py # Booking system routes
│ │ └── main.py # Main application routes
│ ├── templates/ # Jinja2 templates
│ │ ├── admin/ # Admin interface templates
│ │ ├── auth/ # Authentication templates
│ │ ├── booking/ # Booking system templates
│ │ └── base.html # Base template
│ └── static/ # Static assets
├── tests/ # Test suite
│ ├── test_admin.py # Admin functionality tests
│ ├── test_auth.py # Authentication tests
│ ├── test_booking.py # Booking system tests
│ └── test_frontend.py # UI/Frontend tests
├── migrations/ # Database migrations
├── scripts/ # Utility scripts
├── Makefile # Build and management commands
├── config.py # Configuration settings
├── requirements.txt # Python dependencies
└── run.py # Application entry point
-
Clone the repository:
git clone <repository-url> cd flightschool
-
Set up the environment and install dependencies:
make init
This will:
- Create a virtual environment
- Install required packages
- Initialize the database
- Create necessary tables
-
Create a
.envfile with the following variables:FLASK_APP=run.py FLASK_ENV=development SECRET_KEY=your-secret-key DATABASE_URL=sqlite:///flightschool.db
make init- Initialize the project (create venv, install deps, setup db)make run- Start the development servermake test- Run the full test suitemake clean- Remove temporary files and virtual environmentmake db-init- Initialize a new databasemake db-migrate- Generate database migrationsmake db-upgrade- Apply database migrations
-
Start the development server:
make run
The application will be available at
http://localhost:5000- Or at
http://localhost:5001if configured for alternate port
- Or at
-
Default admin credentials:
- Email: admin@example.com
- Password: admin123
- You can log in as a student or instructor using the test data accounts in
tests/test_data.json.
Run the complete test suite:
make testRun specific test categories:
# Run frontend tests only
make test-frontend
# Run admin functionality tests
make test-admin
# Run booking system tests
make test-bookingTo verify that all major endpoints are up and responding (and that there are no server-side errors or backtraces), use the frontend smoke test workflow:
-
Start the application in demo mode:
make demo
This will initialize the database with test data and run the app.
-
In a separate terminal, run the frontend smoke tests:
make frontend-test
This will send HTTP requests to all major endpoints and verify:
- The endpoint responds with a 2xx or 3xx status code
- The response does not contain a Python traceback or Flask error page
You can add or adjust endpoints in tests/frontend_smoke_test.py as your app evolves.
-
Code Style
- Follow PEP 8 style guide
- Use meaningful variable and function names
- Include docstrings for functions and classes
- Keep functions focused and single-purpose
-
Testing
- Write tests for new features
- Ensure all tests pass before committing
- Include both unit and integration tests
- Test edge cases and error conditions
-
Git Workflow
- Create feature branches for new development
- Write clear, descriptive commit messages
- Keep commits focused and atomic
- Test before merging to main branch
-
Adding New Features
- Update database models in
app/models/ - Add new routes in appropriate route module
- Create/update templates in
app/templates/ - Add corresponding tests in
tests/ - Update documentation as needed
- Update database models in
- The booking calendar visually displays all aircraft and instructor conflicts for the selected week.
- Aircraft conflicts are shown in red, instructor conflicts in blue.
- The current UTC time is always displayed above the calendar widget.
- All bookings are validated to prevent double-booking of aircraft or instructors.
- The test data loader (
scripts/load_test_data.py) automatically converts date fields and ensures consistency with the models.
- Fork the repository
- Create a feature branch
- Make your changes
- Add/update tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.