How king-defender/ai-analyst works
Project type and purpose
• This is a full-stack AI-powered analyst MVP.
• Frontend: React + TypeScript web app for uploading pitch decks and viewing results.
• Backend: Python FastAPI service exposing REST endpoints for ingestion, benchmarking, risk assessment, memo generation.
• ML pipeline: standalone Python modules (in ml/) that orchestrate document processing, risk engines, memo generation, using Vertex AI/LLM.
• Infrastructure: GCP services (Vision API, Vertex AI, BigQuery, Cloud Storage, Firestore) and Docker for local/dev environments.
File structure
• Top level:
• frontend/ – Next.js + React + Tailwind code, components, hooks, tests.
• backend/ – FastAPI app with routers/, services/, models/, schemas/, configuration, Dockerfiles, tests.
• ml/ – ML pipeline modules, prompts, tests.
• infra/ – SQL schemas/queries for BigQuery, Firestore emulator Dockerfile.
• docs/, scripts/, sample_data/ for documentation, automation, examples.
• Patterns:
• Backend uses layered architecture: routers → services → core/config.
• Frontend follows component-based pattern with hooks and API abstraction in lib/api.ts.
• ML pipeline is modular: document_processing, risk_assessment, memo_generation, orchestrated via ml/main.py.
• Config and deployment:
• Docker Compose for dev environment.
• Dockerfiles for backend and frontend.
• GitHub Actions CI in .github/workflows.
README for additional insights
• Tech stack and service dependencies are documented.
• GCP services interplay: Cloud Vision for OCR, BigQuery for data warehousing, Vertex AI/Vector Search, Cloud Storage for file storage, Firestore for low-latency storage.
Final recommendations
• Backend sub-module only if it’s relevant to high-level flows (e.g., OCR, Benchmark Service, Risk Service).
• Maintain numbering/order for job workflows (1→2→3…) to aid readability.
• Review with domain experts to ensure all interactions (retry logic, error handling) are documented separately if needed.