How debugger-demons/whoknows works
Project Type and Purpose
• This is a full-stack, two-component web application: a modern Rust-based frontend and a Rust-based backend service, replacing an earlier Python monolith. Its purpose is to serve as a high-performance, secure “WhoKnows” knowledge‐discovery search engine, with a clean HTML/JS UI and an Actix-web API layer backed by SQLx and a relational database.
File Structure
• Top level:
• backend/ – Rust backend service (Actix-web, SQLx) with its own docs, Dockerfile, migration scripts, and CI configuration
• frontend/ – Rust-based front end (likely Yew or static-server) plus static HTML/JS assets, Dockerfile
• database/ – raw schema.sql for initial DB bootstrap
• deployment/ & docker-compose.*.yml – orchestration scripts for Dev/Prod and CI/CD pipelines
• docs/ – global docs, including architecture and legacy analyses
• CI/CD: GitHub Actions workflows in .github/workflows drive build, test, CD to dev/prod environments
• Environment: .env templates for local/deployment setups
Extract Key Architectural Insights from the README
• Two distinct Rust services communicating over HTTP
• Database layer evolving from SQLite to Postgres, using SQLx for compile-time query safety
• DevOps focus with Docker, Docker Compose, GitHub Actions, and scripted deployments
• Emphasis on async runtime (Tokio), serialization (Serde), and structured logging (env_logger + log)
a. Main Components
• User’s Browser (UI) – static HTML/CSS/JS
• Frontend Service – Rust binary or static‐file server with proxy middleware
• Backend Service – Actix-web API
• Database – PostgreSQL (or SQLite in dev)
• CI/CD Pipeline – GitHub Actions workflows
• Docker/Docker Compose – orchestration layer for local/dev/prod
b. Relationships & Data Flows
• Browser → Frontend Service: HTTP GET/POST requests for pages and SPA API calls
• Frontend Service → Backend Service: proxied REST API calls over HTTP
• Backend Service → Database: SQLx queries over TCP (Postgres)
• CI/CD → Docker Registry / Kubernetes / Servers: pushes images and triggers deployments
• DevOps Scripts → Cloud Environment: secret setup, image pulls, infrastructure provisioning
c. Architectural Patterns & Principles
• Layered Architecture: clear separation of Presentation, API and Data layers
• Microservice-style boundary between frontend and backend (even if co-located)
• Infrastructure as Code: Docker Compose files, deployment scripts, CI workflows
• Compile-time safety: SQLx, Rust’s type system, strict Cargo dependency management
d. Key Technologies & Frameworks
• Rust 1.x with Actix-web 4.x for HTTP server
• SQLx 0.7 for database access
• Tokio 1.0 for async runtime
• Serde 1.0 for serialization
• env_logger/log for observability
• Docker & Docker Compose for containerization
• GitHub Actions for CI/CD