Developer Guide¶
Welcome to the PiTrac development documentation. This guide covers developing, building, packaging, and maintaining PiTrac.
-
System Overview
Architecture, core components, data flow, and design principles.
-
Configuration
Three-tier configuration system, web UI settings, and the C++ ConfigurationManager.
-
Service Architecture
The pitrac-web systemd service, pitrac_lm process lifecycle, and how the web server manages everything.
-
Testing
Web UI testing suite, Python pytest tests, and C++ test infrastructure.
-
Dependencies
Library versions, build-from-source dependencies, and platform differences.
Quick Start for Developers¶
Prerequisites¶
- Raspberry Pi 5 with 8GB RAM (for native development)
- Ubuntu/Debian Linux (for cross-compilation)
- Docker installed (for containerized builds)
- Git
- Basic familiarity with C++, Bash, and Linux systems
Getting Started¶
1. Clone the repository:
2. Build and install on the Pi:
3. Make changes and test:
# Edit source files in Software/LMSourceCode/ImageProcessing/
sudo ./build.sh dev # Incremental rebuild
Development Workflow¶
1. Fork and Setup¶
# Fork the repository on GitHub, then:
git clone --recursive https://github.com/YOUR_USERNAME/PiTrac.git
cd PiTrac
git remote add upstream https://github.com/pitraclm/pitrac.git
2. Develop¶
git fetch upstream
git checkout main
git merge upstream/main
git checkout -b feature/your-feature-name
3. Test¶
Access the web UI at http://your-pi-ip:8080 and use the Testing section, or run Python tests directly:
4. Submit¶
Create a pull request from your fork to upstream main.
Project Structure¶
PiTrac/
├── Software/
│ ├── LMSourceCode/ImageProcessing/ # Core C++ code (pitrac_lm)
│ └── web-server/ # Python FastAPI web server
├── packaging/
│ ├── build.sh # Main build script
│ ├── build-apt-package.sh # APT package creator
│ ├── bashly.yml # CLI specification
│ ├── generate.sh # CLI generator
│ ├── src/ # CLI command implementations
│ ├── scripts/ # Build helper scripts
│ └── templates/ # Config and service templates
├── docs/ # Source documentation
└── Hardware/ # 3D models and PCB designs
Getting Help¶
- GitHub Issues: https://github.com/pitraclm/pitrac/issues
- Discord Community: https://discord.gg/j9YWCMFVHN