# martin226/makeitjakes architecture

> Architecture diagram of the GitHub repository martin226/makeitjakes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/martin226/makeitjakes
- Repository: https://github.com/martin226/makeitjakes

## Overview

##### Project Type and Purpose
- This is a modern web application focused on converting uploaded resumes into a standardized “Jake’s Resume” template.
- It’s a full-stack project with a Ruby on Rails API backend and a Remix.js/TypeScript frontend. The README also highlights Docker containerization, cloud deployment (GCP), and CI/CD via Cloud Build.

##### File Structure
- Notice the presence of two main top-level directories: “backend” and “frontend.”
- The “backend” directory contains a typical Ruby on Rails structure with controllers, services, configuration (including environment files and Docker-related files), as well as other Rails assets.
- The “frontend” directory holds a Remix.js application with TypeScript, Tailwind CSS, assets, and Vite configuration.
- Look at configuration files such as Dockerfiles in both backend and frontend, and cloud deployment files (cloudbuild.yaml, lb.yaml) that indicate containerized deployment and load balancing.
- Other files like .gitignore, LICENSE, and README in the root help confirm the project’s organization and open-source intentions.

##### Extract Additional Insights from the README
- The README lists the major features (resume file upload and processing, LaTeX output generation, responsive UI, RESTful API) and provides detailed API documentation for resume processing endpoints.
- The README identifies external dependencies such as Redis for job processing and calls attention to interactions via external APIs (services for Anthropic, Gemini, and Llama).
- The infrastructure section mentions GCP deployment, load balancer configuration, and CI/CD pipelines.

a. Main Components:
- Frontend Component:
- Remix.js web application handling user interactions, file upload, and status updates.
- Uses TypeScript and Tailwind CSS for UI/UX.
- Backend Component:
- Ruby on Rails API server handling RESTful endpoints for resume upload, preview generation, and status streaming.
- Controllers, such as those under /api/v1, manage endpoints like /api/v1/resumes (for upload) and /api/v1/status/events (for SSE updates).
- Services performing external API calls and processing business logic (e.g., resume formatting, LaTeX generation).
- External Services and Dependencies:
- Redis for job processing and caching processed results.
- External API integrations (Anthropic, Gemini, Llama) invoked by service modules.
- Infrastructure and Deployment:
- Docker for containerizing both backend and frontend.
- Cloud Build configuration for CI/CD.
- Google Cloud Platform deployment elements including load balancer settings from lb.yaml.

b. Relationships and Interactions:
- Client (frontend) sends resume file uploads to the backend’s RESTful endpoint.
- The backend initiates processing by communicating with external API services and dispatches jobs to Redis.
- The backend streams real-time processing status back to the frontend via SSE.
- After processing, the backend serves a preview (PDF) that the frontend displays.
- Both components are containerized and deployed via Docker, then orchestrated through GCP’s infrastructure (load balancer, Cloud Build pipelines).

c. Architectural Patterns and Design Principles:
- Separation of Concerns – Clear distinction between frontend (presentation layer) and backend (service and API layer).
- RESTful API architecture – Modular controllers and services.
- Containerization – Use of Dockerfiles in both frontend and backend directories indicates modular deployment.
- Asynchronous Processing – Redis integration for offloading background jobs and caching.
- Cloud Deployment Best Practices – GCP integration with CI/CD and load balancer configuration.

d. Technologies and Frameworks:
- Backend: Ruby on Rails, Redis, Docker.
- Frontend: Remix.js, TypeScript, Tailwind CSS, Vite.
- Infrastructure: Google Cloud Platform, Cloud Build.

## Diagram (Mermaid)

```mermaid
graph TD
    FE["Frontend (Remix.js Application)"]:::frontend
    BE["Backend (Rails API Server)"]:::backend
    FE -->|"sends_resume"| BE

    subgraph "API Endpoints"
        RUE["Resume Upload Endpoint"]:::endpoint
        SSE["Status SSE Endpoint"]:::endpoint
    end

    BE -->|"handles_upload"| RUE
    BE -->|"provides_SSE"| SSE

    subgraph "Processing Services"
        RAS["Resume API Service"]:::service
        RFS["Resume Formatter Service"]:::service
        RP["Resume Prompts"]:::service
    end

    RUE -->|"processes_resume"| RAS
    RAS -->|"formats_resume"| RFS
    RAS -->|"uses_prompts"| RP

    RI["Redis Integration"]:::service
    RAS -->|"queues_job"| RI

    subgraph "External API Integrations"
        AA["Anthropic API Service"]:::external
        GA["Gemini API Service"]:::external
        LA["Llama API Service"]:::external
    end

    RAS -->|"calls_anthropic"| AA
    RAS -->|"calls_gemini"| GA
    RAS -->|"calls_llama"| LA

    SSE -->|"streams_status"| FE

    subgraph "Infrastructure & Deployment"
        BD["Backend Dockerfile"]:::infra
        FD["Frontend Dockerfile"]:::infra
        CICD["CI/CD Pipeline"]:::infra
        LB["Load Balancer Config"]:::infra
    end

    CICD -->|"builds_backend"| BD
    CICD -->|"builds_frontend"| FD
    BD -->|"deploys_to"| LB
    FD -->|"deploys_to"| LB
    LB -->|"routes_to"| FE
    LB -->|"routes_to"| BE

    classDef frontend fill:#bbdefb,stroke:#1e88e5,stroke-width:2px;
    classDef backend fill:#c8e6c9,stroke:#43a047,stroke-width:2px;
    classDef endpoint fill:#f0f4c3,stroke:#afb42b,stroke-width:2px;
    classDef service fill:#ffe082,stroke:#ffa000,stroke-width:2px;
    classDef external fill:#ffcdd2,stroke:#e53935,stroke-width:2px;
    classDef infra fill:#d1c4e9,stroke:#7e57c2,stroke-width:2px;

    click FE "https://github.com/martin226/makeitjakes/tree/main/frontend/"
    click BE "https://github.com/martin226/makeitjakes/tree/main/backend/"
    click RUE "https://github.com/martin226/makeitjakes/blob/main/backend/app/controllers/api/v1/resumes_controller.rb"
    click SSE "https://github.com/martin226/makeitjakes/blob/main/backend/app/controllers/api/v1/status_controller.rb"
    click AA "https://github.com/martin226/makeitjakes/blob/main/backend/app/services/anthropic_api_service.rb"
    click GA "https://github.com/martin226/makeitjakes/blob/main/backend/app/services/gemini_api_service.rb"
    click LA "https://github.com/martin226/makeitjakes/blob/main/backend/app/services/llama_api_service.rb"
    click RAS "https://github.com/martin226/makeitjakes/blob/main/backend/app/services/resume_api_service.rb"
    click RFS "https://github.com/martin226/makeitjakes/blob/main/backend/app/services/resume_formatter_service.rb"
    click RP "https://github.com/martin226/makeitjakes/blob/main/backend/app/services/resume_prompts.rb"
    click RI "https://github.com/martin226/makeitjakes/blob/main/backend/config/initializers/redis.rb"
    click BD "https://github.com/martin226/makeitjakes/tree/main/backend/Dockerfile"
    click FD "https://github.com/martin226/makeitjakes/tree/main/frontend/Dockerfile"
    click CICD "https://github.com/martin226/makeitjakes/blob/main/cloudbuild.yaml"
    click LB "https://github.com/martin226/makeitjakes/blob/main/lb.yaml"
```
