# johnnykozman2007/jobassistant architecture

> Architecture diagram of the GitHub repository johnnykozman2007/jobassistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/johnnykozman2007/jobassistant
- Repository: https://github.com/johnnykozman2007/jobassistant

## Overview

This repository is a three-part product monorepo: a Next.js frontend, a Python backend, and a separate Python AI/agent service. The structure suggests a resume/job-match application with onboarding, profile management, job analysis, scoring, and resume tailoring.

The **Frontend** is a Next.js App Router app in TypeScript/React. Its routes cover the main user journey: landing, onboarding steps, dashboard, profile, and settings. The component set is strongly domain-specific: `ResumeUploader`, `JobAnalyzer`, `MatchScoreCard`, `AnalysisModal`, `AIAnswerGenerator`, and `SaveProfilePrompt` indicate the UI is built around uploading resumes, analyzing job fit, and presenting AI-generated guidance.

The **Backend** is a Python service responsible for application data and user/account state. The presence of `app/user_route.py`, `database/db_client.py`, `user.py`, and `helper.py` suggests a lightweight API layer plus persistence abstraction, likely centered on storing user profiles, preferences, and saved artifacts needed by the frontend and agent.

The **Agent** package is the AI/workflow subsystem. It is organized around `graph.py`, `state.py`, `node.py`, `route.py`, `tailor.py`, and `scorer.py`, which is a strong signal that the core logic is implemented as a graph/state machine rather than a single linear pipeline. This service owns the model-driven steps: interpreting inputs, scoring resume-job fit, and tailoring content.

A key boundary is the **tooling layer inside the Agent**. `tools/scraper.py` and `JOB_DESC_SCRAPER.md` show that the agent can fetch or parse job descriptions from external sources. That separates external web scraping from the AI orchestration layer, which is useful for reliability and testability.

The **data flow** is likely: the user enters information in the frontend, the backend stores or retrieves profile data, and the frontend then invokes the agent for job analysis or tailoring. The agent returns structured outputs such as fit scores, recommendations, or tailored resume text, which the frontend renders in the dashboard and analysis modal.

The **AI orchestration boundary** is explicit in the Agent’s layout. `prompts.py` defines prompt templates, `scorer.py` computes or ranks fit, `tailor.py` performs rewriting, and `server.py` exposes the service. This isolates model behavior from UI and persistence concerns, making the agent independently deployable and testable.

The **deployment model** is containerized and service-oriented. Each major subsystem has its own `Dockerfile`, and `docker-compose.yml` at the repo root indicates local multi-service composition. That implies the frontend, backend, and agent are intended to run as separate processes with networked communication between them.

The **tooling and runtime split** matters architecturally: the frontend uses Node/Next.js (`package.json`, `tsconfig.json`, `next.config.ts`), while the backend and agent use Python (`pyproject.toml`, `uv.lock`, `requirements.txt`). The agent’s `langgraph.json` suggests LangGraph/LangChain-style workflow orchestration, which is a central design choice for how AI steps are composed.

The **testing strategy** is divided by subsystem. The Agent has both unit and integration tests, including graph-level integration coverage and scraper tests. The repository also has GitHub Actions workflows for unit and integration tests, showing the agent is treated as a critical, independently validated component.

Overall, the architecture is best drawn as: a user-facing Next.js app on one side, a Python backend for app data in the middle, and a Python AI agent service on the other side for job scraping, scoring, and resume tailoring. The key system boundaries are presentation, persistence/auth/profile state, and AI/workflow execution.

Main entry points: [`Agent/src/agent/graph.py`](https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/graph.py) (Workflow graph), [`Frontend/app/layout.tsx`](https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/app/layout.tsx) (App shell), [`Frontend/app/dashboard/page.tsx`](https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/app/dashboard/page.tsx) (Dashboard), [`Backend/app/user_route.py`](https://github.com/johnnykozman2007/jobassistant/blob/main/Backend/app/user_route.py) (User API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_root["Root"]
  node_docker_compose[("Compose<br/>deployment<br/>[docker-compose.yml]")]
  node_root_main["Entry<br/>[main.py]"]
end

subgraph group_frontend["Frontend"]
  node_frontend_shell["App shell<br/>next layout<br/>[layout.tsx]"]
  node_frontend_home["Landing<br/>route<br/>[page.tsx]"]
  node_frontend_onboarding["Onboarding<br/>route flow<br/>[page.tsx]"]
  node_frontend_dashboard["Dashboard<br/>route<br/>[page.tsx]"]
  node_frontend_profile["Profile<br/>route<br/>[page.tsx]"]
  node_frontend_settings["Settings<br/>route<br/>[page.tsx]"]
  node_frontend_upload["Resume upload<br/>ui component<br/>[ResumeUploader.tsx]"]
  node_frontend_analysis["Analysis UI<br/>ui component<br/>[JobAnalyzer.tsx]"]
  node_frontend_modal["Result modal<br/>ui component<br/>[AnalysisModal.tsx]"]
  node_frontend_score["Match score<br/>ui component<br/>[MatchScoreCard.tsx]"]
  node_frontend_ai["AI answer<br/>ui component"]
  node_frontend_prompt["Save prompt<br/>ui component"]
end

subgraph group_backend["Backend"]
  node_backend_api["User API<br/>api route<br/>[user_route.py]"]
  node_backend_db[("DB client<br/>persistence<br/>[db_client.py]")]
  node_backend_model["User model<br/>domain model<br/>[user.py]"]
  node_backend_helper["Helpers<br/>backend util<br/>[helper.py]"]
end

subgraph group_agent["Agent"]
  node_agent_server["Agent API<br/>service entry<br/>[server.py]"]
  node_agent_graph{{"Workflow graph<br/>orchestration<br/>[graph.py]"}}
  node_agent_route["Routing<br/>[route.py]"]
  node_agent_score["Scoring<br/>ai logic<br/>[scorer.py]"]
  node_agent_tailor["Tailoring<br/>ai logic<br/>[tailor.py]"]
  node_agent_prompts["Prompts<br/>prompt library<br/>[prompts.py]"]
  node_agent_state["State<br/>[state.py]"]
  node_agent_node["Nodes<br/>workflow node<br/>[node.py]"]
  node_agent_scraper["Scraper<br/>tooling<br/>[scraper.py]"]
end

node_docker_compose -->|"runs"| node_frontend_shell
node_docker_compose -->|"runs"| node_backend_api
node_docker_compose -->|"runs"| node_agent_server
node_root_main -.->|"bootstraps"| node_docker_compose
node_frontend_shell -->|"hosts"| node_frontend_home
node_frontend_shell -->|"hosts"| node_frontend_onboarding
node_frontend_shell -->|"hosts"| node_frontend_dashboard
node_frontend_shell -->|"hosts"| node_frontend_profile
node_frontend_shell -->|"hosts"| node_frontend_settings
node_frontend_onboarding -->|"uses"| node_frontend_upload
node_frontend_dashboard -->|"uses"| node_frontend_analysis
node_frontend_dashboard -->|"uses"| node_frontend_score
node_frontend_dashboard -->|"opens"| node_frontend_modal
node_frontend_dashboard -->|"uses"| node_frontend_ai
node_frontend_profile -->|"uses"| node_frontend_prompt
node_frontend_upload -->|"submits"| node_backend_api
node_frontend_analysis -->|"calls"| node_agent_server
node_frontend_ai -->|"calls"| node_agent_server
node_backend_api -->|"persists"| node_backend_db
node_backend_api -->|"uses"| node_backend_model
node_backend_api -->|"uses"| node_backend_helper
node_agent_server -->|"executes"| node_agent_graph
node_agent_graph -->|"passes"| node_agent_state
node_agent_graph -->|"routes"| node_agent_route
node_agent_graph -->|"scores"| node_agent_score
node_agent_graph -->|"tailors"| node_agent_tailor
node_agent_graph -->|"uses"| node_agent_prompts
node_agent_graph -->|"builds"| node_agent_node
node_agent_route -->|"uses"| node_agent_scraper
node_agent_score -->|"uses"| node_agent_prompts
node_agent_tailor -->|"uses"| node_agent_prompts

click node_docker_compose "https://github.com/johnnykozman2007/jobassistant/blob/main/docker-compose.yml"
click node_root_main "https://github.com/johnnykozman2007/jobassistant/blob/main/main.py"
click node_frontend_shell "https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/app/layout.tsx"
click node_frontend_home "https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/app/page.tsx"
click node_frontend_onboarding "https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/app/onboarding/step-1/page.tsx"
click node_frontend_dashboard "https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/app/dashboard/page.tsx"
click node_frontend_profile "https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/app/profile/page.tsx"
click node_frontend_settings "https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/app/settings/page.tsx"
click node_frontend_upload "https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/components/ResumeUploader.tsx"
click node_frontend_analysis "https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/components/JobAnalyzer.tsx"
click node_frontend_modal "https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/components/AnalysisModal.tsx"
click node_frontend_score "https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/components/MatchScoreCard.tsx"
click node_frontend_ai "https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/components/AIAnswerGenerator.tsx"
click node_frontend_prompt "https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/components/SaveProfilePrompt.tsx"
click node_backend_api "https://github.com/johnnykozman2007/jobassistant/blob/main/Backend/app/user_route.py"
click node_backend_db "https://github.com/johnnykozman2007/jobassistant/blob/main/Backend/database/db_client.py"
click node_backend_model "https://github.com/johnnykozman2007/jobassistant/blob/main/Backend/user.py"
click node_backend_helper "https://github.com/johnnykozman2007/jobassistant/blob/main/Backend/helper.py"
click node_agent_server "https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/server.py"
click node_agent_graph "https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/graph.py"
click node_agent_route "https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/route.py"
click node_agent_score "https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/scorer.py"
click node_agent_tailor "https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/tailor.py"
click node_agent_prompts "https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/prompts.py"
click node_agent_state "https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/state.py"
click node_agent_node "https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/node.py"
click node_agent_scraper "https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/tools/scraper.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_docker_compose,node_root_main toneBlue
class node_frontend_shell,node_frontend_home,node_frontend_onboarding,node_frontend_dashboard,node_frontend_profile,node_frontend_settings,node_frontend_upload,node_frontend_analysis,node_frontend_modal,node_frontend_score,node_frontend_ai,node_frontend_prompt toneAmber
class node_backend_api,node_backend_db,node_backend_model,node_backend_helper toneMint
class node_agent_server,node_agent_graph,node_agent_route,node_agent_score,node_agent_tailor,node_agent_prompts,node_agent_state,node_agent_node,node_agent_scraper toneRose
```

## Components

### Root

Repo orchestration and deployment

- [Compose](https://github.com/johnnykozman2007/jobassistant/blob/main/docker-compose.yml): deployment · Local multi-service runtime composition · `docker-compose.yml`
- [Entry](https://github.com/johnnykozman2007/jobassistant/blob/main/main.py): app entry · Top-level application entrypoint · `main.py`

### Frontend

Next.js user interface

- [App shell](https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/app/layout.tsx): next layout · Global Next.js layout and shared styling · `Frontend/app/layout.tsx`
- [Landing](https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/app/page.tsx): route · Public entry page for the product · `Frontend/app/page.tsx`
- [Onboarding](https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/app/onboarding/step-1/page.tsx): route flow · Multi-step profile and resume setup · `Frontend/app/onboarding/step-1/page.tsx`
- [Dashboard](https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/app/dashboard/page.tsx): route · Main analysis and match-results view · `Frontend/app/dashboard/page.tsx`
- [Profile](https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/app/profile/page.tsx): route · User profile management page · `Frontend/app/profile/page.tsx`
- [Settings](https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/app/settings/page.tsx): route · Account and preference settings · `Frontend/app/settings/page.tsx`
- [Resume upload](https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/components/ResumeUploader.tsx): ui component · Collects resume input for analysis · `Frontend/components/ResumeUploader.tsx`
- [Analysis UI](https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/components/JobAnalyzer.tsx): ui component · Job fit analysis and score presentation · `Frontend/components/JobAnalyzer.tsx`
- [Result modal](https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/components/AnalysisModal.tsx): ui component · Detailed analysis and recommendation modal · `Frontend/components/AnalysisModal.tsx`
- [Match score](https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/components/MatchScoreCard.tsx): ui component · Displays resume-job fit scoring · `Frontend/components/MatchScoreCard.tsx`
- [AI answer](https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/components/AIAnswerGenerator.tsx): ui component · Generates AI-written guidance in the UI · `Frontend/components/AIAnswerGenerator.tsx`
- [Save prompt](https://github.com/johnnykozman2007/jobassistant/blob/main/Frontend/components/SaveProfilePrompt.tsx): ui component · Prompts users to persist profile data · `Frontend/components/SaveProfilePrompt.tsx`

### Backend

Python app data API

- [User API](https://github.com/johnnykozman2007/jobassistant/blob/main/Backend/app/user_route.py): api route · Backend endpoint for user and profile state · `Backend/app/user_route.py`
- [DB client](https://github.com/johnnykozman2007/jobassistant/blob/main/Backend/database/db_client.py): persistence · Database access abstraction · `Backend/database/db_client.py`
- [User model](https://github.com/johnnykozman2007/jobassistant/blob/main/Backend/user.py): domain model · Stored user/profile schema · `Backend/user.py`
- [Helpers](https://github.com/johnnykozman2007/jobassistant/blob/main/Backend/helper.py): backend util · Shared backend support logic · `Backend/helper.py`

### Agent

AI workflow service

- [Agent API](https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/server.py): service entry · HTTP entrypoint for AI workflow service · `Agent/src/agent/server.py`
- [Workflow graph](https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/graph.py): orchestration · LangGraph state-machine execution core · `Agent/src/agent/graph.py`
- [Routing](https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/route.py): workflow routing · Determines next workflow step · `Agent/src/agent/route.py`
- [Scoring](https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/scorer.py): ai logic · Evaluates resume-job fit · `Agent/src/agent/scorer.py`
- [Tailoring](https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/tailor.py): ai logic · Rewrites resume content for a job · `Agent/src/agent/tailor.py`
- [Prompts](https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/prompts.py): prompt library · Shared model prompt templates · `Agent/src/agent/prompts.py`
- [State](https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/state.py): workflow state · Typed state passed between nodes · `Agent/src/agent/state.py`
- [Nodes](https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/node.py): workflow node · Reusable graph node definitions · `Agent/src/agent/node.py`
- [Scraper](https://github.com/johnnykozman2007/jobassistant/blob/main/Agent/src/agent/tools/scraper.py): tooling · Fetches and parses job descriptions · `Agent/src/agent/tools/scraper.py`

## Connections

- Compose → App shell: runs · Starts the frontend service
- Compose → User API: runs · Starts the backend service
- Compose → Agent API: runs · Starts the AI agent service
- Entry → Compose: bootstraps · Top-level runtime entry hooks into compose-based setup
- App shell → Landing: hosts · Provides app-wide shell for public entry page
- App shell → Onboarding: hosts · Provides app-wide shell for onboarding flow
- App shell → Dashboard: hosts · Provides app-wide shell for dashboard
- App shell → Profile: hosts · Provides app-wide shell for profile page
- App shell → Settings: hosts · Provides app-wide shell for settings page
- Onboarding → Resume upload: uses · Collects resume input during setup
- Dashboard → Analysis UI: uses · Runs job analysis workflow from the dashboard
- Dashboard → Match score: uses · Renders match scoring for jobs and resumes
- Dashboard → Result modal: opens · Shows deeper analysis details
- Dashboard → AI answer: uses · Displays AI-generated guidance
- Profile → Save prompt: uses · Encourages persistence of user profile data
- Resume upload → User API: submits · Sends user and resume data to backend state
- Analysis UI → Agent API: calls · Requests job analysis and scoring from agent
- AI answer → Agent API: calls · Requests AI-generated recommendations from agent
- User API → DB client: persists · Stores and retrieves user state
- User API → User model: uses · Maps API payloads to stored user schema
- User API → Helpers: uses · Shares backend utilities and business rules
- Agent API → Workflow graph: executes · Serves the workflow graph as the core runtime
- Workflow graph → State: passes · Carries structured workflow state between steps
- Workflow graph → Routing: routes · Selects the next node in the workflow
- Workflow graph → Scoring: scores · Computes resume-job fit
- Workflow graph → Tailoring: tailors · Generates job-specific resume changes
- Workflow graph → Prompts: uses · Supplies prompt templates to model steps
- Workflow graph → Nodes: builds · Composes reusable workflow nodes
- Routing → Scraper: uses · Obtains external job descriptions when needed
- Scoring → Prompts: uses · Scoring is guided by prompt templates
- Tailoring → Prompts: uses · Tailoring is guided by prompt templates
