-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
Complete installation instructions for TrueHour, a personal aviation flight training management and expense tracking application.
- Prerequisites
- Quick Start (Docker)
- Development Installation
- Environment Configuration
- Database Setup
- First-Time Setup
- Platform-Specific Instructions
- Troubleshooting
- Upgrading
Minimum Requirements:
- Docker 20.10 or higher
- Docker Compose 2.0 or higher
- 500MB RAM
- 1GB disk space (more with extensive flight logs)
Install Docker:
- macOS: Docker Desktop for Mac
- Linux: Docker Engine + Docker Compose
- Windows: Docker Desktop for Windows
Minimum Requirements:
- Python 3.11 or higher
- Node.js 18 or higher
- PostgreSQL 14 or higher
- Git
- 1GB RAM
- 1GB disk space
Check Versions:
python3 --version # Should be 3.11+
node --version # Should be v18+
psql --version # Should be 14+
git --versionThe fastest way to get TrueHour running is with Docker Compose.
git clone https://github.com/FliteAxis/TrueHour.git
cd TrueHourcd infrastructure
cp .env.example .envEdit .env with your preferences:
# Database Configuration
POSTGRES_USER=truehour
POSTGRES_PASSWORD=your_secure_password_here
POSTGRES_DB=truehour
# Backend Configuration
DATABASE_URL=postgresql://truehour:your_secure_password_here@db:5432/truehour
# Frontend Configuration
VITE_API_URL=http://localhost:8000
# Features
ENABLE_FAA_LOOKUP=true
# Port Configuration (change if needed)
BACKEND_PORT=8000
FRONTEND_PORT=3000Important: Change your_secure_password_here to a strong password!
# Start all services
docker compose up -d
# View logs (optional)
docker compose logs -fOpen your browser to:
- Frontend: http://localhost:8181
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
# Check all containers are running
docker compose ps
# Should see:
# - truehour-db (postgres)
# - truehour-api (fastapi)
# - truehour-frontend (react)All three containers should have status "Up".
# Stop containers (preserves data)
docker compose down
# Stop and remove volumes (β οΈ deletes all data)
docker compose down -vFor local development without Docker.
git clone https://github.com/FliteAxis/TrueHour.git
cd TrueHourbrew install postgresql@16
brew services start postgresql@16
# Create database
createdb truehour
# Create user
psql postgres -c "CREATE USER truehour WITH PASSWORD 'your_password';"
psql postgres -c "GRANT ALL PRIVILEGES ON DATABASE truehour TO truehour;"sudo apt update
sudo apt install postgresql-18
# Create database and user
sudo -u postgres psql
> CREATE DATABASE truehour;
> CREATE USER truehour WITH PASSWORD 'your_password';
> GRANT ALL PRIVILEGES ON DATABASE truehour TO truehour;
> \qDownload and install PostgreSQL
Use pgAdmin or psql to create:
- Database:
truehour - User:
truehourwith password
cd backend
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate # macOS/Linux
# OR
venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Configure environment
export DATABASE_URL="postgresql://truehour:your_password@localhost:5432/truehour"
export ENABLE_FAA_LOOKUP=true
# Run database migrations (auto-creates tables)
python -c "from app.db_migrations import run_migrations; import asyncio; asyncio.run(run_migrations())"
# Start backend server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000Backend should start at http://localhost:8000
Open a new terminal window:
cd frontend-react
# Install dependencies
npm install
# Configure environment
echo "VITE_API_URL=http://localhost:8000" > .env
# Start development server
npm run devFrontend should start at http://localhost:5173 (Vite dev server)
- Backend API: http://localhost:8000
- Backend Docs: http://localhost:8000/docs
- Frontend: http://localhost:5173
Located at backend/.env (or export in shell):
# Required
DATABASE_URL=postgresql://user:password@host:port/database
# Optional
ENABLE_FAA_LOOKUP=true # Enable FAA N-number lookups
LOG_LEVEL=INFO # DEBUG, INFO, WARNING, ERROR
CORS_ORIGINS=http://localhost:8181 # Allowed frontend originsLocated at frontend-react/.env:
# Required
VITE_API_URL=http://localhost:8000 # Backend API URL
# For production build
VITE_API_URL= # Empty = same originLocated at infrastructure/.env:
# Database
POSTGRES_USER=truehour
POSTGRES_PASSWORD=strong_password_here
POSTGRES_DB=truehour
# Backend
DATABASE_URL=postgresql://truehour:strong_password_here@db:5432/truehour
# Frontend
VITE_API_URL=http://localhost:8000
# Ports (change if conflicts)
BACKEND_PORT=8000
FRONTEND_PORT=3000
POSTGRES_PORT=5432TrueHour automatically creates/updates database tables on startup. No manual SQL needed!
What Gets Created:
-
flights- Flight log entries -
aircraft- User aircraft fleet -
budget_cards- Budget planning cards -
expenses- Expense tracking -
expense_budget_links- Many-to-many expense/budget relationships -
import_history- ForeFlight CSV import tracking -
user_data- Settings and preferences
# Connect to database container
docker exec -it truehour-db psql -U truehour truehour
# List tables
\dt
# Check schema
\d flights
# Exit
\qThe FAA aircraft database (308K+ aircraft) is automatically included in the backend:
Location: backend/data/aircraft.db (SQLite)
Contents:
- N-number registrations
- Make/Model information
- Year of manufacture
- Aircraft category/class
- Engine type
- Gear type
Updating FAA Database:
cd backend/scripts
python download_faa_data.py # Downloads latest from FAA
python build_aircraft_db.py # Rebuilds SQLite databaseAfter installation, configure TrueHour for your use:
If you use ForeFlight:
-
Export CSV from ForeFlight:
- Open ForeFlight β Logbook
- Tap Share β Export CSV
- Email or AirDrop to yourself
-
In TrueHour:
- Click hamburger menu (top-left)
- Click "Import Logbook"
- Select your ForeFlight CSV file
- Review aircraft mapping
- Click "Confirm Import"
Option A: FAA Lookup (US Aircraft)
- Go to "Aircraft" section
- Click "Add Aircraft"
- Enter N-number (e.g., N12345)
- Click "Lookup FAA Data"
- Review pre-filled information
- Add rates (wet/dry, fuel price, burn rate)
- Save
Option B: Manual Entry
- Go to "Aircraft" section
- Click "Add Aircraft"
- Fill in all details manually
- Save
- Go to Settings (gear icon)
- Set Target Certification (PPL, IR, CPL, CFI)
- Configure Training Rates:
- Instructor hourly rate
- Simulator hourly rate
- Ground training rate
- Set Training Pace (lessons per week)
- Define Budget Categories (or use defaults)
- Save settings
Option A: Quick Start Templates
- Go to "Budget" section
- Click "Add Budget Card"
- Click "Quick Start" tab
- Select template (Flight Hours, Written Exam, etc.)
- Customize as needed
- Save
Option B: Custom Budget Card
- Go to "Budget" section
- Click "Add Budget Card"
- Fill in:
- Category
- Name
- Amount (or link aircraft + hours)
- Date ("when")
- Status
- Save
- Go to "Expenses" section
- Click "Add Expense"
- Fill in:
- Date
- Category
- Description
- Amount
- Payment method
- Vendor (optional)
- Link to budget card(s) if applicable
- Save
Installation Notes:
-
Use Homebrew for dependencies:
brew install python@3.11 node@18 postgresql@16
-
Docker Desktop requires macOS 11+ (Big Sur or later)
Port Conflicts:
- AirPlay Receiver uses port 5000 (no conflict with TrueHour)
- If port 3000 or 8000 conflicts, change in
infrastructure/.env
Ubuntu/Debian:
# Install dependencies
sudo apt update
sudo apt install python3.12 python3-pip nodejs npm postgresql-18
# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
# Install Docker Compose
sudo apt install docker compose-pluginFedora/RHEL:
sudo dnf install python3.12 nodejs postgresql-server
sudo dnf install docker docker composeArch Linux:
sudo pacman -S python nodejs postgresql docker docker composeInstallation Notes:
-
Install WSL2 (Windows Subsystem for Linux):
wsl --install -
Install Docker Desktop for Windows (includes WSL2 integration)
-
Use WSL2 terminal for all commands (not Command Prompt)
-
Clone repository in WSL2 home directory:
cd ~ git clone https://github.com/FliteAxis/TrueHour.git
Path Issues:
- Use forward slashes
/not backslashes\ - Keep project in WSL2 filesystem (not
/mnt/c/)
Problem: Port already in use
# Find what's using the port
lsof -i :3000 # macOS/Linux
netstat -ano | findstr :3000 # Windows
# Change port in infrastructure/.env
APP_PORT=8182Problem: Containers won't start
# Check logs
docker compose logs backend
docker compose logs frontend
docker compose logs db
# Restart services
docker compose restart
# Full rebuild
docker compose down -v
docker compose up -d --buildProblem: Database connection failed
# Check database is running
docker compose ps
# Check database logs
docker compose logs db
# Connect to database
docker exec -it truehour-db psql -U truehour truehour
# Verify DATABASE_URL in backend container
docker exec -it truehour-api env | grep DATABASE_URLProblem: Module not found
# Reinstall dependencies
pip install -r requirements.txt
# Check Python version
python3 --version # Should be 3.11+Problem: Database migration failed
# Check DATABASE_URL is correct
echo $DATABASE_URL
# Test database connection
psql $DATABASE_URL -c "SELECT 1;"
# Run migrations manually
python -c "from app.db_migrations import run_migrations; import asyncio; asyncio.run(run_migrations())"Problem: FAA lookup not working
# Check aircraft.db exists
ls -lh backend/data/aircraft.db
# Verify ENABLE_FAA_LOOKUP=true
echo $ENABLE_FAA_LOOKUPProblem: Cannot connect to backend
# Check VITE_API_URL
cat frontend-react/.env
# Verify backend is running
curl http://localhost:8000/api/v1/health
# Check CORS configuration in backendProblem: Build failed
# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm install
# Check Node version
node --version # Should be v18+Problem: Blank page after build
# Check browser console for errors
# Verify VITE_API_URL for production
# For production (same origin):
VITE_API_URL=
# For development:
VITE_API_URL=http://localhost:8000Problem: Permission denied
# Grant privileges
psql postgres -c "GRANT ALL PRIVILEGES ON DATABASE truehour TO truehour;"
psql postgres -c "GRANT ALL ON SCHEMA public TO truehour;"Problem: Database doesn't exist
# Create database
createdb truehour
# Or in psql
psql postgres -c "CREATE DATABASE truehour;"Error: "EADDRINUSE: address already in use"
β Port conflict. Change port in .env or stop conflicting service.
Error: "Failed to connect to database"
β Check DATABASE_URL format, database is running, and credentials are correct.
Error: "Cannot find module"
β Run npm install (frontend) or pip install -r requirements.txt (backend).
Error: "CORS policy blocked"
β Check VITE_API_URL matches backend URL and CORS_ORIGINS in backend allows frontend origin.
-
Export data from v1.x:
- Export flights as CSV from v1.x
- Save any important notes/data
-
Install v2.0 (fresh installation)
-
Import data into v2.0:
- Use ForeFlight CSV import in v2.0
- Or manually re-enter aircraft and budget data
# With Docker
cd infrastructure
docker compose down
git pull origin main
docker compose up -d --build
# Development mode
git pull origin main
# Backend
cd backend
source venv/bin/activate
pip install -r requirements.txt --upgrade
uvicorn app.main:app --reload
# Frontend
cd frontend-react
npm install
npm run devDatabase migrations run automatically on startup.
# Backup database (Docker)
docker exec truehour-db pg_dump -U truehour truehour > backup_$(date +%Y%m%d).sql
# Backup database (Local)
pg_dump -U truehour truehour > backup_$(date +%Y%m%d).sql
# Backup environment files
cp infrastructure/.env infrastructure/.env.backup# Restore (Docker)
cat backup_20260103.sql | docker exec -i truehour-db psql -U truehour truehour
# Restore (Local)
psql -U truehour truehour < backup_20260103.sqlDocumentation:
Support:
Quick Checks:
- All containers running?
docker compose ps - Backend responding?
curl http://localhost:8000/api/v1/health - Frontend loading? Open http://localhost:8181
- Check logs:
docker compose logs -f
After installation:
- β Read the User Guide
- β Import your logbook or add first flight
- β Add aircraft with FAA lookup
- β Configure settings and target certification
- β Create budget cards
- β Start tracking expenses
Happy Flying! π©οΈ
π View on GitHub | π³ Docker Hub
π Report Issue | π¬ Discussions
License: MIT License | Copyright (c) 2024-2025 FliteAxis
π Getting Started
π¦ Deployment
π§ Development
π Security
- Security Setup Guide
- Security CI/CD Pipeline
- Code Quality & Linting
- SBOM Management
- Vulnerability Scanning
π Dependencies
π³ Docker
π Reference
π Links