Skip to main content

Flask REST API (aurora-server)

Overview

The Flask API is the primary backend service handling HTTP requests for cloud operations, user management, and integrations. Container: aurora-server
Port: 5080 (configurable via FLASK_PORT)
Entry Point: server/main_compute.py:431
Process: Gunicorn (production) or Flask dev server

Key Responsibilities

  • Cloud Provider Integration: GCP, AWS, Azure, OVH, Scaleway, Tailscale
  • OAuth Flows: GitHub, Bitbucket, Slack, PagerDuty, Confluence
  • Incident Management: Create, list, update incidents
  • User Preferences: Store/retrieve user settings
  • Health Checks: /health endpoint for monitoring
  • Knowledge Base: Document upload and management

Blueprint Structure

The Flask app uses modular blueprints organized by domain:
Reference: server/main_compute.py:195-396

Environment Variables

Dependencies

  • postgres (healthy) - Database connection
  • weaviate (healthy) - Vector search
  • redis (running) - Cache and queue
  • vault (healthy) - Secrets access
  • seaweedfs-filer (healthy) - Object storage

WebSocket Chatbot (chatbot)

Overview

WebSocket server powering the AI agent interactions with real-time streaming. Container: chatbot
Port: 5006
Entry Point: server/main_chatbot.py:604
Process: Python WebSocket server with asyncio

Key Responsibilities

  • LangGraph Workflow Execution: Run AI agent with tool calls
  • Token Streaming: Stream LLM responses token-by-token
  • Tool Execution: Execute cloud operations via agent tools
  • Session Management: Track chat sessions per user
  • Context Loading: Load historical messages for continuity
  • WebSocket Confirmations: Interactive approval for destructive operations

Message Flow

Reference: server/main_chatbot.py:217-602

Key Features

Real-Time Streaming

Rate Limiting

Session Isolation

Each session gets dedicated Terraform directories:

Celery Workers (celery_worker)

Overview

Background task processing for long-running operations. Container: celery_worker
Process: celery -A celery_config worker --loglevel=info
Configuration: server/celery_config.py

Registered Tasks

Reference: server/celery_config.py:46-64

Periodic Tasks (Celery Beat)

Reference: server/celery_config.py:66-87

Configuration


PostgreSQL Database

Overview

Primary relational database for structured data. Container: aurora-postgres
Port: 5432
Image: postgres:15-alpine
Database: aurora_db

Key Tables

  • users: User accounts and preferences
  • chat_sessions: Chat history and context
  • incidents: Incident tracking and timeline
  • incident_thoughts: RCA background analysis thoughts
  • credentials: Cloud provider OAuth tokens (references to Vault)
  • graph_services: Discovered services for graph visualization
  • llm_usage: LLM API cost tracking

Connection Management

Aurora uses a connection pool for efficient database access:

Weaviate Vector Database

Overview

Vector database for semantic search over knowledge base documents. Container: weaviate
Port: 8080 (HTTP), 50051 (gRPC)
Image: cr.weaviate.io/semitechnologies/weaviate:1.27.6
Module: text2vec-transformers with all-MiniLM-L6-v2

Usage

Data Stored

  • Knowledge Base Documents: User-uploaded documentation
  • GitHub Files: Code and documentation from connected repos
  • Confluence Pages: Synced wiki content

Redis Cache & Queue

Overview

In-memory data store for caching and message brokering. Container: redis
Port: 6379
Image: redis:7-alpine

Use Cases

  1. Celery Broker: Task queue for background jobs
  2. Celery Backend: Store task results
  3. API Cost Cache: Cache LLM usage for performance
  4. Cloud Setup Cache: Cache cloud provider resource lists
  5. Rate Limiting: Track API request counts

Cache Keys


HashiCorp Vault

Overview

Secrets management for sensitive credentials. Container: aurora-vault
Port: 8200
Image: hashicorp/vault:1.15
Storage: File-based with persistent volumes

Configuration

Secret Storage Pattern

Reference: server/utils/vault/vault_client.py

SeaweedFS Object Storage

Overview

S3-compatible object storage for files and artifacts. Containers: seaweedfs-master, seaweedfs-volume, seaweedfs-filer
Ports: 8333 (S3 API), 8888 (Web UI), 9333 (Master)
Image: chrislusf/seaweedfs:4.07
License: Apache 2.0

S3 API Access

Stored Data

  • Terraform State: Session-isolated infrastructure state
  • Knowledge Base Files: Uploaded PDFs, docs
  • GitHub Archives: Cloned repository content
  • Log Files: Captured command outputs

Memgraph Graph Database

Overview

In-memory graph database for service discovery and relationships. Container: aurora-memgraph
Port: 7687 (Bolt), 7444 (HTTP)
Image: memgraph/memgraph-mage:latest
UI: memgraph-lab on port 3001

Data Model

Discovery Tasks

Service discovery runs periodically via Celery Beat:
Reference: services/discovery/tasks.py

Frontend (Next.js)

Overview

React-based frontend with Server-Side Rendering. Container: frontend
Port: 3000
Framework: Next.js 15 with App Router
Entry Point: client/src/app/page.tsx

Technology Stack

  • React 18: Functional components with hooks
  • TypeScript: Strict mode enabled
  • Tailwind CSS: Utility-first styling
  • shadcn/ui: Component library
  • Auth.js: Authentication provider
  • WebSocket: Real-time chat connection

Environment Variables

Build Modes