A modern, multi-tenant aircraft tracking and mapping system built with Python/FastAPI backend and React frontend.
- Multi-tenant architecture - Support for multiple organizations
- Real-time aircraft tracking - Live aircraft data visualization
- Modular data clients - Extensible system for different data sources
- Interactive mapping - React-based map with layer management
- Feature flags - Runtime feature toggles
- PostGIS integration - Advanced geospatial data handling
- Docker-based deployment - Easy setup and deployment
- FastAPI - Modern, fast web framework
- PostgreSQL + PostGIS - Geospatial database
- SQLAlchemy - ORM with async support
- Pydantic - Data validation and serialization
- Structured logging - JSON-based logging
- Feature flags - Runtime configuration
- React 18 - Modern React with hooks
- TypeScript - Type-safe development
- MapLibre GL - High-performance mapping
- Layer management - Dynamic map layer control
- Real-time updates - Auto-refreshing data
- Docker and Docker Compose
- Make (optional, for convenience commands)
git clone <repository>
cd SkyTraceV1
# Build and start all services
make up
# or
docker-compose up -d
# Wait for services to be ready (about 30 seconds)
make load-test-data
# or
python scripts/load_test_data.py
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
SkyTraceV1/
├── backend/ # Python/FastAPI backend
│ ├── app/
│ │ ├── api/ # API endpoints
│ │ ├── core/ # Core configuration
│ │ ├── models/ # Database models
│ │ ├── schemas/ # Pydantic schemas
│ │ ├── services/ # Business logic
│ │ └── clients/ # Data collection clients
│ ├── sql/ # Database initialization
│ └── tests/ # Backend tests
├── frontend/ # React/TypeScript frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API services
│ │ ├── types/ # TypeScript types
│ │ └── utils/ # Utility functions
│ └── public/ # Static assets
├── scripts/ # Utility scripts
└── docker-compose.yml # Container orchestration
The system uses PostgreSQL with PostGIS for geospatial data:
- tenants - Multi-tenant organization support
- users - User management (for future SSO)
- feature_flags - Runtime feature toggles
- data_sources - Configurable data collection
- aircraft - Aircraft tracking data with PostGIS geometry
- map_layers - Dynamic map layer configuration
GET /api/v1/aircraft/
- List aircraft with paginationGET /api/v1/aircraft/{id}
- Get specific aircraftPOST /api/v1/aircraft/
- Create aircraftGET /api/v1/aircraft/geojson/all
- Get aircraft as GeoJSONPOST /api/v1/aircraft/bulk
- Bulk create/update aircraft
GET /api/v1/map-layers/
- List map layersPOST /api/v1/map-layers/
- Create map layerPATCH /api/v1/map-layers/{id}
- Update map layer
GET /api/v1/feature-flags/
- List feature flagsPATCH /api/v1/feature-flags/{name}
- Update feature flag
GET /api/v1/data-sources/
- List data sourcesPOST /api/v1/data-sources/
- Create data source
- Create a new client class in
backend/app/clients/
:
from .base_client import BaseDataClient
class MyDataClient(BaseDataClient):
async def fetch_data(self):
# Implement data fetching logic
pass
def validate_data(self, data):
# Implement data validation
pass
- Register the client in a data source via the API
- The system will automatically use the client for data collection
# Development
make dev # Start in development mode
make up # Start in background
make down # Stop all services
make restart # Restart services
# Database
make db-reset # Reset database with fresh data
# Testing
make test # Run backend tests
make load-test-data # Load sample aircraft data
# Monitoring
make logs # View all logs
make logs-backend # View backend logs
make health # Check service health
# Cleanup
make clean # Stop and clean all containers
Backend configuration via environment variables:
DATABASE_URL
- PostgreSQL connection stringENVIRONMENT
- Environment name (development/production)LOG_LEVEL
- Logging levelCORS_ORIGINS
- Allowed CORS originsMULTI_TENANT_ENABLED
- Enable multi-tenant modeSSO_ENABLED
- Enable SSO authentication
Runtime feature toggles available:
sso_enabled
- Single Sign-On authenticationmulti_tenant
- Multi-tenant functionalityrealtime_updates
- Real-time data updatesadvanced_filtering
- Advanced filtering options
- Create new layer type in database
- Implement data processing in backend service
- Add visualization in frontend MapView component
- Implement new client class extending
BaseDataClient
- Register client in data sources API
- Configure refresh intervals and data processing
Map layers support custom styling via style_config
JSON field:
{
"circle-radius": 8,
"circle-color": "#ff0000",
"circle-stroke-width": 2
}
- Change default database passwords
- Configure proper CORS origins
- Enable SSL/TLS termination
- Set up proper logging and monitoring
- Configure authentication when ready
- Use managed PostgreSQL service
- Add Redis for caching and Celery for background tasks
- Configure horizontal scaling for backend API
- Use CDN for frontend assets
-
Database connection failed
- Ensure PostgreSQL container is running
- Check connection string in environment variables
-
Frontend can't connect to backend
- Verify backend is running on port 8000
- Check CORS configuration
-
No aircraft data showing
- Run
make load-test-data
to load sample data - Check API endpoints are responding
- Run
# View all logs
make logs
# View specific service logs
make logs-backend
make logs-frontend
make logs-db
# Check service health
make health
- Follow PEP 8 for Python code
- Use TypeScript for frontend development
- Add tests for new features
- Update documentation for API changes
See LICENSE file for details.