Overview
FreeTAKServer (FTS) uses a Model-View-Controller (MVC) pattern with a Model-Driven Architecture (MDA) approach. The architecture is built on the DigitalPy framework and follows enterprise design patterns for modularity, scalability, and maintainability.Architectural Layers
MVC Pattern
FTS implements a clear separation of concerns:Model Layer
Model Layer
- Domain Model: CoT (Cursor on Target) objects generated from UML models
- Protocol Objects: Base class
FTSProtocolObjectfor all domain entities - Core Domain: Event, Point, Detail and other fundamental CoT components
- Location:
FreeTAKServer/model/andFreeTAKServer/components/core/domain/
Controller Layer
Controller Layer
- Service Controllers: Handle business logic for each service (TCP CoT, SSL CoT, REST API)
- CoT Controllers: Process specific CoT types (presence, chat, emergency)
- Serialization Controllers: XML/JSON serialization and deserialization
- Location:
FreeTAKServer/controllers/and service-specific controllers
View Layer
View Layer
- REST API Views: Flask-based endpoints for web interface
- WebSocket Handlers: Real-time communication via SocketIO
- Response Formatters: XML and JSON output formatting
- Location:
FreeTAKServer/services/rest_api_service/views/
Core Architecture Components
DigitalPy Framework Integration
FTS is built on top of DigitalPy, which provides:- Service Management: Dynamic service registration and lifecycle management
- Action Mapper: Routes requests to appropriate controllers
- Object Factory: Dependency injection and object creation
- Component System: Modular component architecture
Domain Model Architecture
CoT Node System
All CoT objects inherit fromCoTNode, which provides tree-based data structure:
- Parent-child relationship management
- XML serialization support
- Property-based attribute access via
@CoTPropertydecorator - Support for nested CoT structures
Event Model
The Event class is the root CoT object:- Attributes: version, uid, type, how, time, start, stale
- Children: point (location), detail (additional data)
- Properties: Exposed via
@CoTPropertydecorator with getters/setters
Request-Response Pattern
FTS uses an action-based request-response pattern: Implementation Example:Service Architecture
Service Lifecycle
Each service extendsDigitalPyService:
- Connection Management: Accept and manage client connections
- Message Processing: Parse, validate, and route CoT messages
- Event Distribution: Broadcast messages to connected clients
- State Management: Track active clients and sessions
Multi-Threading Architecture
FTS uses thread pools for concurrent client handling:Data Flow
CoT Message Processing Pipeline
XML to Domain Object Conversion
Persistence Layer
Database Architecture
- ORM: SQLAlchemy for database abstraction
- Database Controller:
FreeTAKServer/core/persistence/DatabaseController.py - Models: SQLAlchemy models in
FreeTAKServer/model/SQLAlchemy/
- User authentication and sessions
- CoT event history
- Mission data and packages
- Video stream metadata
- Client connection information
Configuration Management
Main Configuration
- INI Files: Primary configuration via
config.ini - Environment Variables: Override configuration values
- Command Line Arguments: Runtime configuration
- Component Configs: Component-specific settings
Telemetry and Monitoring
OpenTelemetry Integration
Logging Architecture
Security Architecture
SSL/TLS Support
- Certificate Generation:
AtakOfTheCertsutility for certificate management - SSL Services: Separate SSL CoT and HTTPS TAK API services
- Client Authentication: Certificate-based client authentication
Authentication and Authorization
- Flask-Login: Session management for REST API
- API Keys: Token-based authentication support
- Certificate Auth: x.509 certificate validation
Extensibility
The architecture supports extension through:- Component System: Add new components in
components/extended/ - Service Plugins: Create new services implementing
DigitalPyService - CoT Handlers: Register handlers for specific CoT types
- Action Mappers: Add new actions to the request-response system
Design Patterns
Patterns Used
- MVC: Model-View-Controller separation
- Factory: Object creation via
ObjectFactory - Singleton: Configuration and service instances
- Strategy: Multiple serialization strategies (XML, JSON, Protobuf)
- Observer: Event-based message distribution
- Command: Action-based request handling
- Repository: Database access abstraction
Performance Considerations
Optimization Strategies
- Connection Pooling: Reuse database connections
- Thread Pools: Limit thread creation overhead
- Caching: Type mapping and configuration caching
- Lazy Loading: Load domain objects on demand
- Asynchronous I/O: EventLet for concurrent operations
Related Documentation
Services
Learn about FTS service architecture
Components
Explore the component system
CoT Messages
Understand CoT message format
Installation
Get started with FTS