# theunstopabble/texfolio architecture

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

- Interactive diagram: https://gitdiagram.com/theunstopabble/texfolio
- Repository: https://github.com/theunstopabble/texfolio

## Overview

TexFolio is an AI-assisted LaTeX resume-building SaaS. The main journey is a user creating or editing resume content in the web app, saving it through the API, then previewing or generating a PDF; AI analysis and team sharing are related branches. The README documents additional AI, import, payment, organization, and compliance capabilities whose internal wiring is not fully shown in the sampled source, so those links are limited to documented responsibilities and visible route/service calls.

Main entry points: [`apps/api/src/models/index.ts`](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/models/index.ts) (Domain models), [`apps/web/src/App.tsx`](https://github.com/theunstopabble/texfolio/blob/main/apps/web/src/App.tsx) (Web app and routes), [`apps/api/src/routes.hono/resume.routes.ts`](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/routes.hono/resume.routes.ts) (Resume routes), [`apps/api/src/routes.hono/ai.routes.ts`](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/routes.hono/ai.routes.ts) (AI routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Web app and routes<br/>[App.tsx]"]
  node_create["Resume creation<br/>[useCreateResume.ts]"]
  node_editor["Resume editor<br/>[useResumeEditor.ts]"]
  node_preview["Resume preview<br/>[ResumePreview.tsx]"]
  node_webapi["Web API client<br/>[api.ts]"]
  node_aiweb["AI client<br/>[ai.ts]"]
end

subgraph group_api["API and domain"]
  node_resume_routes["Resume routes<br/>[resume.routes.ts]"]
  node_ai_routes["AI routes<br/>[ai.routes.ts]"]
  node_payment_routes["Payment routes<br/>[payment.routes.ts]"]
  node_resume_svc["Resume service<br/>[resume.service.ts]"]
  node_pdf_svc["LaTeX PDF renderer<br/>[pdf.service.ts]"]
  node_payment_svc["Payment service<br/>[payment.service.ts]"]
  node_analytics_svc["Analytics service"]
end

subgraph group_storage["Persistence and jobs"]
  node_pdf_queue["PDF job queue<br/>[pdf.queue.ts]"]
  node_models["Domain models<br/>[index.ts]"]
  node_mongo[("MongoDB<br/>[database.ts]")]
  node_redis[("Redis and BullMQ")]
end

subgraph group_integrations["AI and integrations"]
  node_ai_svc["AI service<br/>[ai.service.ts]"]
  node_coach["Resume coach agent"]
  node_linkedin["LinkedIn import"]
  node_latex["pdflatex runtime"]
  node_llm["LLM providers"]
  node_razorpay["Razorpay"]
  node_brevo["Brevo email"]
end

subgraph group_governance["Teams and governance"]
  node_org_routes["Organization routes"]
  node_gdpr_routes["GDPR routes<br/>[gdpr.routes.ts]"]
  node_org_svc["Organization service"]
  node_audit["Audit service<br/>[audit.service.ts]"]
  node_clerk["Clerk identity"]
end

node_user(("Resume user"))

node_user -->|"uses"| node_webapp
node_webapp -->|"opens creation"| node_create
node_webapp -->|"opens editor"| node_editor
node_create -->|"creates resume"| node_webapi
node_editor -->|"loads and saves"| node_webapi
node_editor -->|"requests analysis"| node_aiweb
node_webapi -->|"sends requests"| node_resume_routes
node_aiweb -->|"sends requests"| node_ai_routes
node_resume_routes -->|"manages resumes"| node_resume_svc
node_resume_routes -->|"enqueues PDF job"| node_pdf_queue
node_resume_routes -->|"generates PDF"| node_pdf_svc
node_resume_routes -.->|"sends resume email"| node_brevo
node_resume_svc -->|"uses models"| node_models
node_models -->|"persists data"| node_mongo
node_pdf_queue -->|"queues jobs"| node_redis
node_pdf_svc -->|"compiles LaTeX"| node_latex
node_ai_routes -->|"requests AI tasks"| node_ai_svc
node_ai_routes -->|"runs coaching"| node_coach
node_ai_svc -->|"calls provider"| node_llm
node_coach -->|"calls provider"| node_llm
node_ai_routes -->|"imports profile"| node_linkedin
node_org_routes -->|"manages teams"| node_org_svc
node_org_routes -->|"records actions"| node_audit
node_org_routes -->|"retrieves team resumes"| node_resume_svc
node_org_svc -->|"uses models"| node_models
node_audit -->|"uses models"| node_models
node_payment_routes -->|"handles payment"| node_payment_svc
node_payment_routes -->|"verifies webhook"| node_razorpay
node_payment_routes -->|"updates subscription"| node_models
node_gdpr_routes -->|"exports or deletes data"| node_models
node_webapp -->|"authenticates user"| node_clerk
node_webapp -->|"renders resume"| node_preview

click node_webapp "https://github.com/theunstopabble/texfolio/blob/main/apps/web/src/App.tsx"
click node_create "https://github.com/theunstopabble/texfolio/blob/main/apps/web/src/features/create-resume/useCreateResume.ts"
click node_editor "https://github.com/theunstopabble/texfolio/blob/main/apps/web/src/features/resume-editor/hooks/useResumeEditor.ts"
click node_preview "https://github.com/theunstopabble/texfolio/blob/main/apps/web/src/components/ResumePreview.tsx"
click node_webapi "https://github.com/theunstopabble/texfolio/blob/main/apps/web/src/services/api.ts"
click node_aiweb "https://github.com/theunstopabble/texfolio/blob/main/apps/web/src/services/ai.ts"
click node_resume_routes "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/routes.hono/resume.routes.ts"
click node_ai_routes "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/routes.hono/ai.routes.ts"
click node_org_routes "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/routes.hono/organization.routes.ts"
click node_payment_routes "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/routes.hono/payment.routes.ts"
click node_gdpr_routes "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/routes.hono/gdpr.routes.ts"
click node_resume_svc "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/services/resume.service.ts"
click node_pdf_svc "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/services/pdf.service.ts"
click node_pdf_queue "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/queues/pdf.queue.ts"
click node_ai_svc "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/services/ai.service.ts"
click node_coach "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/agents/resume-coach.agent.ts"
click node_linkedin "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/services/linkedin.service.ts"
click node_org_svc "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/services/organization.service.ts"
click node_audit "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/services/audit.service.ts"
click node_payment_svc "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/services/payment.service.ts"
click node_analytics_svc "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/services/analytics.service.ts"
click node_models "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/models/index.ts"
click node_mongo "https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/config/database.ts"

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_webapp,node_create,node_editor,node_preview,node_webapi,node_aiweb,node_user toneBlue
class node_resume_routes,node_ai_routes,node_payment_routes,node_resume_svc,node_pdf_svc,node_payment_svc,node_analytics_svc toneAmber
class node_pdf_queue,node_models,node_mongo,node_redis toneMint
class node_ai_svc,node_coach,node_linkedin,node_latex,node_llm,node_razorpay,node_brevo toneRose
class node_org_routes,node_gdpr_routes,node_org_svc,node_audit,node_clerk toneIndigo
```

## Components

### Web experience

- [Web app and routes](https://github.com/theunstopabble/texfolio/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Resume creation](https://github.com/theunstopabble/texfolio/blob/main/apps/web/src/features/create-resume/useCreateResume.ts): `apps/web/src/features/create-resume/useCreateResume.ts`
- [Resume editor](https://github.com/theunstopabble/texfolio/blob/main/apps/web/src/features/resume-editor/hooks/useResumeEditor.ts): `apps/web/src/features/resume-editor/hooks/useResumeEditor.ts`
- [Resume preview](https://github.com/theunstopabble/texfolio/blob/main/apps/web/src/components/ResumePreview.tsx): `apps/web/src/components/ResumePreview.tsx`
- [Web API client](https://github.com/theunstopabble/texfolio/blob/main/apps/web/src/services/api.ts): `apps/web/src/services/api.ts`
- [AI client](https://github.com/theunstopabble/texfolio/blob/main/apps/web/src/services/ai.ts): `apps/web/src/services/ai.ts`

### API and domain

- [Resume routes](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/routes.hono/resume.routes.ts): `apps/api/src/routes.hono/resume.routes.ts`
- [AI routes](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/routes.hono/ai.routes.ts): `apps/api/src/routes.hono/ai.routes.ts`
- [Payment routes](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/routes.hono/payment.routes.ts): `apps/api/src/routes.hono/payment.routes.ts`
- [Resume service](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/services/resume.service.ts): `apps/api/src/services/resume.service.ts`
- [LaTeX PDF renderer](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/services/pdf.service.ts): `apps/api/src/services/pdf.service.ts`
- [Payment service](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/services/payment.service.ts): `apps/api/src/services/payment.service.ts`
- [Analytics service](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/services/analytics.service.ts): `apps/api/src/services/analytics.service.ts`

### Persistence and jobs

- [PDF job queue](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/queues/pdf.queue.ts): `apps/api/src/queues/pdf.queue.ts`
- [Domain models](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/models/index.ts): `apps/api/src/models/index.ts`
- [MongoDB](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/config/database.ts): `apps/api/src/config/database.ts`
- **Redis and BullMQ**

### AI and integrations

- [AI service](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/services/ai.service.ts): `apps/api/src/services/ai.service.ts`
- [Resume coach agent](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/agents/resume-coach.agent.ts): `apps/api/src/agents/resume-coach.agent.ts`
- [LinkedIn import](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/services/linkedin.service.ts): `apps/api/src/services/linkedin.service.ts`
- **pdflatex runtime**
- **LLM providers**
- **Razorpay**
- **Brevo email**

### Teams and governance

- [Organization routes](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/routes.hono/organization.routes.ts): `apps/api/src/routes.hono/organization.routes.ts`
- [GDPR routes](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/routes.hono/gdpr.routes.ts): `apps/api/src/routes.hono/gdpr.routes.ts`
- [Organization service](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/services/organization.service.ts): `apps/api/src/services/organization.service.ts`
- [Audit service](https://github.com/theunstopabble/texfolio/blob/main/apps/api/src/services/audit.service.ts): `apps/api/src/services/audit.service.ts`
- **Clerk identity**

### Other components

- **Resume user**

## Connections

- Resume user → Web app and routes: uses
- Web app and routes → Resume creation: opens creation
- Web app and routes → Resume editor: opens editor
- Resume creation → Web API client: creates resume
- Resume editor → Web API client: loads and saves
- Resume editor → AI client: requests analysis
- Web API client → Resume routes: sends requests
- AI client → AI routes: sends requests
- Resume routes → Resume service: manages resumes
- Resume routes → PDF job queue: enqueues PDF job
- Resume routes → LaTeX PDF renderer: generates PDF
- Resume routes → Brevo email: sends resume email
- Resume service → Domain models: uses models
- Domain models → MongoDB: persists data
- PDF job queue → Redis and BullMQ: queues jobs
- LaTeX PDF renderer → pdflatex runtime: compiles LaTeX
- AI routes → AI service: requests AI tasks
- AI routes → Resume coach agent: runs coaching
- AI service → LLM providers: calls provider
- Resume coach agent → LLM providers: calls provider
- AI routes → LinkedIn import: imports profile
- Organization routes → Organization service: manages teams
- Organization routes → Audit service: records actions
- Organization routes → Resume service: retrieves team resumes
- Organization service → Domain models: uses models
- Audit service → Domain models: uses models
- Payment routes → Payment service: handles payment
- Payment routes → Razorpay: verifies webhook
- Payment routes → Domain models: updates subscription
- GDPR routes → Domain models: exports or deletes data
- Web app and routes → Clerk identity: authenticates user
- Web app and routes → Resume preview: renders resume
