James Pattinson 6e760a3e96 New date picker
2025-10-25 13:57:19 +00:00
2025-10-25 13:57:19 +00:00
2025-10-25 13:57:19 +00:00
2025-10-21 17:33:19 +00:00
2025-10-23 16:43:01 +00:00
2025-10-25 13:31:03 +00:00
2025-10-21 19:53:32 +00:00
2025-10-23 15:56:54 +00:00

NextGen PPR System

A modern, containerized Prior Permission Required (PPR) system for aircraft operations management.

Architecture

  • Backend: FastAPI with Python 3.11
  • Database: MySQL 8.0
  • Cache: Redis 7
  • Container: Docker & Docker Compose

Features

  • 🚀 Modern API: RESTful API with automatic OpenAPI documentation
  • 🔐 Authentication: JWT-based authentication system
  • 📊 Real-time Updates: WebSocket support for live tower updates
  • 🗄️ Self-contained: Fully dockerized with local database
  • 🔍 Documentation: Auto-generated API docs at /docs
  • 🧪 Testing: Comprehensive test suite
  • 📱 Mobile Ready: Responsive design for tower operations

Quick Start

Prerequisites

  • Docker and Docker Compose installed

1. Start the System

cd nextgen
./start.sh

2. Access the Services

3. Default Login

  • Username: admin
  • Password: admin123

API Endpoints

Authentication

  • POST /api/v1/auth/login - Login and get JWT token

PPR Management

  • GET /api/v1/pprs - List PPR records
  • POST /api/v1/pprs - Create new PPR
  • GET /api/v1/pprs/{id} - Get specific PPR
  • PUT /api/v1/pprs/{id} - Update PPR
  • PATCH /api/v1/pprs/{id}/status - Update PPR status
  • DELETE /api/v1/pprs/{id} - Delete PPR

Public Endpoints (No Auth Required)

  • GET /api/v1/public/arrivals - Today's arrivals
  • GET /api/v1/public/departures - Today's departures

Real-time

  • WebSocket /ws/tower-updates - Live updates for tower operations

Development

Local Development

cd backend
pip install -r requirements.txt
uvicorn app.main:app --reload

Database Management

# Connect to database
docker exec -it ppr_nextgen_db mysql -u ppr_user -p ppr_nextgen

# View logs
docker-compose logs -f api
docker-compose logs -f db

# Restart services
docker-compose restart

Testing

cd backend
pytest tests/

Environment Variables

Key environment variables (configured in docker-compose.yml):

  • DB_HOST - Database host
  • DB_USER - Database username
  • DB_PASSWORD - Database password
  • DB_NAME - Database name
  • SECRET_KEY - JWT secret key
  • ACCESS_TOKEN_EXPIRE_MINUTES - Token expiration time

Database Schema

The system uses an improved version of the original schema with:

  • users - User authentication
  • submitted - PPR records with status tracking
  • journal - Activity logs with foreign keys
  • airports - Airport reference data
  • aircraft - Aircraft registration database

Data Migration

To migrate data from the old system:

  1. Export data from the old database
  2. Transform to new schema format
  3. Import into the new system

Time Zone Handling

The system uses UTC (Coordinated Universal Time) as the standard for all time storage and display in aviation contexts:

  • Database Storage: All times are stored in UTC
  • Admin Console Display: Times are displayed in UTC (with Z suffix)
  • Data Entry: Times are entered as local time in the New PPR entry form, then automatically converted to UTC for storage
  • API: All datetime fields in API responses are UTC ISO strings

This ensures consistency across different time zones and complies with aviation standards where UTC is the international standard.

Performance

  • Database connection pooling
  • Indexed columns for fast queries
  • Redis caching (ready for implementation)
  • Async/await for non-blocking operations

Monitoring

Access logs and monitoring:

# View API logs
docker-compose logs -f api

# View database logs  
docker-compose logs -f db

# System health check
curl http://localhost:8001/health

Stopping the System

docker-compose down

To remove volumes (database data):

docker-compose down -v
Description
No description provided
Readme 12 MiB
Languages
HTML 64.2%
Python 29.3%
JavaScript 3%
CSS 2.2%
Shell 1.1%
Other 0.1%