Skip to content

carverauto/chaseapp

Repository files navigation

ChaseApp

Real-time notification and community platform for live events.

Website: https://chaseapp.tv

Overview

ChaseApp delivers real-time alerts and enables community discussion around breaking events:

  • Police Chases - Live pursuit tracking with real-time location updates
  • Rocket Launches - Space launch notifications (SpaceX, NASA, etc.)
  • Weather Events - Severe weather alerts and storm tracking
  • Aircraft Tracking - Aviation monitoring with clustering detection

The platform consists of web, iOS, and Android applications backed by a self-hosted infrastructure designed for low-latency real-time updates.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         Clients                                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   Web App   β”‚  iOS App    β”‚  Android App                        β”‚
β”‚   (Nuxt.js) β”‚  (Flutter)  β”‚  (Flutter)                          β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚             β”‚             β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚ HTTPS
                     β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚     Kong     β”‚  API Gateway
              β”‚   (Ingress)  β”‚  Auth, Rate Limiting
              β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚             β”‚             β”‚
       β–Ό             β–Ό             β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   API    β”‚  β”‚   Chat   β”‚  β”‚   Auth   β”‚
β”‚  (Go)    β”‚  β”‚   (Go)   β”‚  β”‚  (OAuth) β”‚
β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
     β”‚             β”‚
     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
            β”‚
     β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”
     β”‚    NATS     β”‚  Event Bus
     β”‚ (JetStream) β”‚  Real-time Messaging
     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
            β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           β”‚           β”‚               β”‚
β–Ό           β–Ό           β–Ό               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”
β”‚PostgreSQLβ”‚ β”‚Typesenseβ”‚ β”‚  MinIO   β”‚ β”‚ ntfy  β”‚
β”‚   (DB)   β”‚ β”‚ (Search)β”‚ β”‚(Storage) β”‚ β”‚(Push) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”˜

Project Structure

chaseapp/
β”œβ”€β”€ api/                    # Go monolithic API server
β”‚   β”œβ”€β”€ cmd/server/         # Application entry point
β”‚   β”œβ”€β”€ internal/           # Private application code
β”‚   β”‚   β”œβ”€β”€ config/         # Configuration
β”‚   β”‚   β”œβ”€β”€ database/       # Database connection & migrations
β”‚   β”‚   β”œβ”€β”€ handler/        # HTTP handlers
β”‚   β”‚   β”œβ”€β”€ middleware/     # HTTP middleware
β”‚   β”‚   β”œβ”€β”€ model/          # Domain models
β”‚   β”‚   └── repository/     # Data access layer
β”‚   β”œβ”€β”€ migrations/         # PostgreSQL migrations
β”‚   └── pkg/                # Shared packages
β”œβ”€β”€ web/                    # Nuxt.js web application
β”‚   β”œβ”€β”€ components/         # Vue components
β”‚   β”œβ”€β”€ pages/              # Route pages
β”‚   β”œβ”€β”€ plugins/            # Nuxt plugins
β”‚   └── store/              # Vuex store
β”œβ”€β”€ mobile/                 # Flutter mobile app (iOS & Android)
β”‚   β”œβ”€β”€ lib/                # Dart source code
β”‚   β”œβ”€β”€ ios/                # iOS-specific code
β”‚   └── android/            # Android-specific code
β”œβ”€β”€ k8s/                    # Kubernetes manifests
β”‚   β”œβ”€β”€ base/               # Base manifests
β”‚   β”œβ”€β”€ staging/            # Staging overlay
β”‚   └── prod/               # Production overlay
β”œβ”€β”€ shared/                 # Shared code/configs
β”œβ”€β”€ openspec/               # API specifications & change proposals
└── tools/                  # Build tools & scripts

Tech Stack

Backend (api/)

Component Technology
Language Go 1.21+
HTTP Router Gorilla Mux
Database PostgreSQL 15+ (pgx driver)
Migrations golang-migrate
Messaging NATS JetStream
Search Typesense
Object Storage MinIO (S3-compatible)
Push Notifications ntfy/Gotify + APNs + FCM

Web (web/)

Component Technology
Framework Nuxt.js 2 (Bridge) + Vue.js
Language TypeScript
Styling TailwindCSS (WindiCSS)
State Vuex
Maps Mapbox GL JS
Real-time NATS WebSocket

Mobile (mobile/)

Component Technology
Framework Flutter 2.17+
Language Dart
State Riverpod
Maps Mapbox GL
Push APNs/FCM direct
Payments RevenueCat

Infrastructure

Component Technology
Build System Bazel
Container Runtime Docker
Orchestration Kubernetes
Config Management Kustomize
API Gateway Kong
SSL Let's Encrypt (cert-manager)
Observability Prometheus + Grafana + Loki

Getting Started

Prerequisites

  • Go 1.21+
  • Node.js 18+ (via Volta)
  • Flutter SDK 2.17+
  • Docker & Docker Compose
  • Bazel (optional, for full builds)

Quick Start (API Development)

# Clone the repository
git clone https://github.com/carverauto/chaseapp.git
cd chaseapp

# Start infrastructure services
cd api
cp .env.example .env
docker-compose up -d postgres nats typesense

# Run database migrations
go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
migrate -path migrations -database "postgres://chaseapp:chaseapp_dev@localhost:5432/chaseapp?sslmode=disable" up

# Start the API server
go run cmd/server/main.go

API available at http://localhost:8080

Web Development

cd web
npm install
npm run dev

Web app available at http://localhost:3000

Mobile Development

cd mobile
flutter pub get
flutter run

API Endpoints

Core Endpoints

Method Endpoint Description
GET /health Health check
GET /ready Readiness check
GET /metrics Prometheus metrics

Chases API

Method Endpoint Description
GET /api/v1/chases List chases (paginated)
POST /api/v1/chases Create chase
GET /api/v1/chases/{id} Get chase
PUT /api/v1/chases/{id} Update chase
DELETE /api/v1/chases/{id} Delete chase
GET /api/v1/chases/bundle Offline data bundle

Aircraft API

Method Endpoint Description
GET /api/v1/aircraft List aircraft
POST /api/v1/aircraft/cluster DBSCAN clustering

Push Notifications

Method Endpoint Description
POST /api/v1/push/subscribe Register device
POST /api/v1/push/unsubscribe Unregister device

External Data

Method Endpoint Description
GET /api/v1/quakes USGS earthquake data
GET /api/v1/launches Rocket launch data
GET /api/v1/weather/alerts NOAA weather alerts
GET /api/v1/boats AIS vessel data

Configuration

Environment Variables

See api/.env.example for full configuration options.

Key variables:

# Server
SERVER_PORT=8080

# Database
DB_HOST=localhost
DB_PORT=5432
DB_USER=chaseapp
DB_PASSWORD=secret
DB_NAME=chaseapp

# NATS
NATS_URL=nats://localhost:4222

# Typesense
TYPESENSE_HOST=localhost
TYPESENSE_API_KEY=your_key

Deployment

Docker

# Build API image
docker build -t chaseapp-api ./api

# Run with Docker Compose
docker-compose up

Kubernetes

# Deploy to staging
kubectl apply -k k8s/staging

# Deploy to production
kubectl apply -k k8s/prod

Development Workflow

Branch Naming

  • feature/<description> - New features
  • fix/<description> - Bug fixes
  • chore/<description> - Maintenance tasks

Code Style

  • Go: gofmt + golangci-lint
  • TypeScript: ESLint + Prettier
  • Dart: very_good_analysis

Testing

# Go tests
cd api && go test ./...

# Web tests
cd web && npm test

# Mobile tests
cd mobile && flutter test

Documentation

  • api/README.md - API-specific documentation
  • openspec/ - API specifications and change proposals
  • openspec/project.md - Detailed project context

Contributing

  1. Create a feature branch from main
  2. Make changes following code style guidelines
  3. Write/update tests as needed
  4. Submit a pull request

License

Proprietary - CarverAuto / ChaseApp

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages