Skip to content

corinm/aircraft-go

Repository files navigation

Aircraft

Combines local ADS-B data with other data sources and notifies about interesting aircraft.

About the project

AI-generated art representing the project

Key features

  • Triggers Push Notifications when interesting aircraft are spotted by tar1090
  • Keeps track of all seen aircraft (in progress)
  • Displays statistics about aircraft seen (to do)

Diagram

C4 Model-style "Container" diagram

Roadmap / TO DO list

  • Re-implementdiscoverer service using Go
    • Publish aircraft when found
  • Re-add NATS
  • Implement enricher service
    • Enrich with HexDB data
    • Enrich with PlaneAlertDb data (i.e. whether it's an interesting aircraft and why)
    • What should happen if an enricher fails? Should it continue? Later enricher may be able to fill in gaps
    • Use Context appropriately with enrichers (e.g. set deadline, cancel gracefully)
    • Investigate any other potential data sources
  • Implement evaluator service
    • Implement logic to identify interesting aircraft
  • Implement notifier service
    • Publish notifications using Pushover
  • Add Postgres
  • Add historian service
  • Add stats service
  • Add a monitoring service to keep track of enrichment failures (could use this to compare sources and find backup enrichers for when one source doesn't have any details)
  • Other / refactoring / future
    • Try out https://github.com/caarlos0/env
    • Back-off approach for enrichers if they fail with certain error codes (not 404)
    • Add a "system context" C4-style diagram
    • Add some architecture docs explaining design choices

Getting started

Pre-requisites

  • A tar1090 API endpoint available e.g. by running Readsb on your local network
  • A Kubernetes (K8s) cluster
  • kubectl or your preferred K8s tool
  • A K8s namespace of your choosing e.g. aircraft
    kubectl create namespace aircraft
  • Install DevSpace
  • Install NATS on your K8s cluster
    helm repo add nats https://nats-io.github.io/k8s/helm/charts/
    helm repo update
    helm install my-nats nats/nats
  • Install Postgres Operator into your K8s cluster
    helm repo add cnpg https://cloudnative-pg.github.io/charts
    helm upgrade --install cnpg \
      --namespace cnpg-system \
      --create-namespace \
      cnpg/cloudnative-pg
  • Setup Postgres
    kubectl create secret generic postgres-historian-password-secret \
    --from-literal=username=historian \
    --from-literal=password=password \
    -n aircraft
    kubectl apply -f ./infrastructure/cnpg-cluster.yaml
  • Generate any generated code
    make generate

My ADS-B setup

Installation

  1. Clone the repository
    git clone https://github.com/corinm/aircraft-go.git
  2. Create and populate .env files in each service (refer to .env.example files)
  3. Ensure you are in your chosen namespace
    devspace use namespace
    # Select your namespace from the drop-down
    
  4. Optional: For a production-like deployment use devspace's deploy command
    devspace deploy
  5. Optional: To develop a specific service cd into the service directory and use devspace's dev command
    cd ./notifier
    devspace dev

Usage

  • Polling for aircraft will start automatically when the discoverer starts up
  • In future there will be API endpoints and a dashboard to view aircraft data and statistics

Tests

Testing strategy

This is a personal project I'm using to learn and experiment. I want to be able to make changes as easily as possible, therefore I'm intentionally keeping automated testing very minimal for now. I’ll add tests where they make sense and where they help me understand or validate something specific, but I’m not aiming for the type of test coverage I'd expect from production-grade software.

Running unit tests

Currently only the enricher service has unit tests

make unit-tests

Acknowledgements

About

Combines ADS-B data with other data sources and notifies about interesting aircraft

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors