# esardorbe/devfolio architecture

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

- Interactive diagram: https://gitdiagram.com/esardorbe/devfolio
- Repository: https://github.com/esardorbe/devfolio

## Overview

Devfolio lets engineers create and manage a portfolio, then publish a public profile and export it as PDF or DOCX. The principal flow is account registration and email verification or OAuth, authenticated editing of profile sections, and public viewing; profile analytics and AI bio generation are additional capabilities. The graph focuses on runtime product components. README documents AI, exports, uploads, analytics, and OAuth, but available excerpts do not show every integration's implementation or wiring, so some relationships are omitted.

Main entry points: [`apps/web/src/app/dashboard/page.tsx`](https://github.com/esardorbe/devfolio/blob/main/apps/web/src/app/dashboard/page.tsx) (Portfolio editor), [`apps/api/src/prisma/prisma.service.ts`](https://github.com/esardorbe/devfolio/blob/main/apps/api/src/prisma/prisma.service.ts) (PostgreSQL data), [`apps/api/src/users/users.service.ts`](https://github.com/esardorbe/devfolio/blob/main/apps/api/src/users/users.service.ts) (User profiles), [`apps/web/src/services/auth.api.ts`](https://github.com/esardorbe/devfolio/blob/main/apps/web/src/services/auth.api.ts) (Auth client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_authpages["Sign-in pages<br/>[page.tsx]"]
  node_authclient["Auth client<br/>[auth.api.ts]"]
  node_authstate["Auth state<br/>[auth.store.ts]"]
  node_dashboard["Portfolio editor<br/>[page.tsx]"]
  node_publicpage["Public portfolio<br/>[page.tsx]"]
  node_bio["AI bio endpoint<br/>[route.ts]"]
  node_export["Portfolio export<br/>[ExportModal.tsx]"]
  node_pdf["PDF rendering<br/>[pdf-templates.tsx]"]
  node_docx["DOCX generation<br/>[docx-export.ts]"]
end

subgraph group_identity["Identity"]
  node_authcontroller["Auth routes<br/>[auth.controller.ts]"]
  node_authservice["Auth service<br/>[auth.service.ts]"]
end

subgraph group_portfolio["Portfolio API"]
  node_users["User profiles<br/>[users.service.ts]"]
  node_projects["Projects"]
  node_skills["Skills<br/>[skills.service.ts]"]
  node_experience["Work experience"]
  node_education["Education"]
  node_certificates["Certificates"]
  node_analytics["Profile analytics"]
  node_uploads["File uploads"]
end

subgraph group_platform["Persistence and integrations"]
  node_email["Verification email<br/>[email.service.ts]"]
  node_database[("PostgreSQL data<br/>[prisma.service.ts]")]
end

node_engineer(("Engineer"))
node_visitor(("Profile visitor"))
node_oauth(("Google / GitHub"))
node_openai(("OpenAI"))
node_storage[("AWS S3")]

node_engineer -->|"register or sign in"| node_authpages
node_authpages -->|"calls auth"| node_authclient
node_authclient -->|"HTTP auth requests"| node_authcontroller
node_authcontroller -->|"dispatches auth"| node_authservice
node_authservice -->|"reads and writes"| node_database
node_authservice -->|"sends OTP"| node_email
node_oauth -->|"OAuth callback"| node_authcontroller
node_authclient -.->|"auth token flow"| node_authstate
node_engineer -->|"edits portfolio"| node_dashboard
node_dashboard -.->|"profile operations"| node_users
node_dashboard -.->|"manages projects"| node_projects
node_dashboard -.->|"manages skills"| node_skills
node_dashboard -.->|"manages experience"| node_experience
node_dashboard -.->|"manages education"| node_education
node_dashboard -.->|"manages certificates"| node_certificates
node_users -->|"reads and writes"| node_database
node_projects -->|"reads and writes"| node_database
node_skills -->|"reads and writes"| node_database
node_experience -->|"reads and writes"| node_database
node_education -->|"reads and writes"| node_database
node_certificates -->|"reads and writes"| node_database
node_visitor -->|"views profile"| node_publicpage
node_publicpage -.->|"fetches public profile"| node_users
node_users -->|"records profile views"| node_analytics
node_engineer -->|"requests bio"| node_bio
node_bio -.->|"generates bio"| node_openai
node_engineer -->|"exports portfolio"| node_export
node_export -.->|"renders PDF"| node_pdf
node_export -.->|"generates DOCX"| node_docx
node_engineer -->|"uploads files"| node_uploads
node_uploads -.->|"stores files"| node_storage

click node_authpages "https://github.com/esardorbe/devfolio/blob/main/apps/web/src/app/(auth)/login/page.tsx"
click node_authclient "https://github.com/esardorbe/devfolio/blob/main/apps/web/src/services/auth.api.ts"
click node_authstate "https://github.com/esardorbe/devfolio/blob/main/apps/web/src/store/auth.store.ts"
click node_dashboard "https://github.com/esardorbe/devfolio/blob/main/apps/web/src/app/dashboard/page.tsx"
click node_publicpage "https://github.com/esardorbe/devfolio/blob/main/apps/web/src/app/u/%5Busername%5D/page.tsx"
click node_bio "https://github.com/esardorbe/devfolio/blob/main/apps/web/src/app/api/generate-bio/route.ts"
click node_export "https://github.com/esardorbe/devfolio/blob/main/apps/web/src/components/ExportModal.tsx"
click node_pdf "https://github.com/esardorbe/devfolio/blob/main/apps/web/src/lib/export/pdf-templates.tsx"
click node_docx "https://github.com/esardorbe/devfolio/blob/main/apps/web/src/lib/export/docx-export.ts"
click node_authcontroller "https://github.com/esardorbe/devfolio/blob/main/apps/api/src/auth/auth.controller.ts"
click node_authservice "https://github.com/esardorbe/devfolio/blob/main/apps/api/src/auth/auth.service.ts"
click node_email "https://github.com/esardorbe/devfolio/blob/main/apps/api/src/email/email.service.ts"
click node_users "https://github.com/esardorbe/devfolio/blob/main/apps/api/src/users/users.service.ts"
click node_projects "https://github.com/esardorbe/devfolio/blob/main/apps/api/src/projects/projects.service.ts"
click node_skills "https://github.com/esardorbe/devfolio/blob/main/apps/api/src/skills/skills.service.ts"
click node_experience "https://github.com/esardorbe/devfolio/blob/main/apps/api/src/experiences/experiences.service.ts"
click node_education "https://github.com/esardorbe/devfolio/blob/main/apps/api/src/educations/educations.service.ts"
click node_certificates "https://github.com/esardorbe/devfolio/blob/main/apps/api/src/certificates/certificates.service.ts"
click node_analytics "https://github.com/esardorbe/devfolio/blob/main/apps/api/src/users/users.controller.ts"
click node_uploads "https://github.com/esardorbe/devfolio/blob/main/apps/api/src/users/users.controller.ts"
click node_database "https://github.com/esardorbe/devfolio/blob/main/apps/api/src/prisma/prisma.service.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_authpages,node_authclient,node_authstate,node_dashboard,node_publicpage,node_bio,node_export,node_pdf,node_docx toneBlue
class node_authcontroller,node_authservice,node_storage toneAmber
class node_users,node_projects,node_skills,node_experience,node_education,node_certificates,node_analytics,node_uploads toneMint
class node_email,node_database toneRose
class node_engineer,node_visitor,node_oauth,node_openai toneIndigo
```

## Components

### Web experience

- [Sign-in pages](https://github.com/esardorbe/devfolio/blob/main/apps/web/src/app/(auth)/login/page.tsx): `apps/web/src/app/(auth)/login/page.tsx`
- [Auth client](https://github.com/esardorbe/devfolio/blob/main/apps/web/src/services/auth.api.ts): `apps/web/src/services/auth.api.ts`
- [Auth state](https://github.com/esardorbe/devfolio/blob/main/apps/web/src/store/auth.store.ts): `apps/web/src/store/auth.store.ts`
- [Portfolio editor](https://github.com/esardorbe/devfolio/blob/main/apps/web/src/app/dashboard/page.tsx): `apps/web/src/app/dashboard/page.tsx`
- [Public portfolio](https://github.com/esardorbe/devfolio/blob/main/apps/web/src/app/u/%5Busername%5D/page.tsx): `apps/web/src/app/u/[username]/page.tsx`
- [AI bio endpoint](https://github.com/esardorbe/devfolio/blob/main/apps/web/src/app/api/generate-bio/route.ts): `apps/web/src/app/api/generate-bio/route.ts`
- [Portfolio export](https://github.com/esardorbe/devfolio/blob/main/apps/web/src/components/ExportModal.tsx): `apps/web/src/components/ExportModal.tsx`
- [PDF rendering](https://github.com/esardorbe/devfolio/blob/main/apps/web/src/lib/export/pdf-templates.tsx): `apps/web/src/lib/export/pdf-templates.tsx`
- [DOCX generation](https://github.com/esardorbe/devfolio/blob/main/apps/web/src/lib/export/docx-export.ts): `apps/web/src/lib/export/docx-export.ts`

### Identity

- [Auth routes](https://github.com/esardorbe/devfolio/blob/main/apps/api/src/auth/auth.controller.ts): `apps/api/src/auth/auth.controller.ts`
- [Auth service](https://github.com/esardorbe/devfolio/blob/main/apps/api/src/auth/auth.service.ts): `apps/api/src/auth/auth.service.ts`

### Portfolio API

- [User profiles](https://github.com/esardorbe/devfolio/blob/main/apps/api/src/users/users.service.ts): `apps/api/src/users/users.service.ts`
- [Projects](https://github.com/esardorbe/devfolio/blob/main/apps/api/src/projects/projects.service.ts): `apps/api/src/projects/projects.service.ts`
- [Skills](https://github.com/esardorbe/devfolio/blob/main/apps/api/src/skills/skills.service.ts): `apps/api/src/skills/skills.service.ts`
- [Work experience](https://github.com/esardorbe/devfolio/blob/main/apps/api/src/experiences/experiences.service.ts): `apps/api/src/experiences/experiences.service.ts`
- [Education](https://github.com/esardorbe/devfolio/blob/main/apps/api/src/educations/educations.service.ts): `apps/api/src/educations/educations.service.ts`
- [Certificates](https://github.com/esardorbe/devfolio/blob/main/apps/api/src/certificates/certificates.service.ts): `apps/api/src/certificates/certificates.service.ts`
- [Profile analytics](https://github.com/esardorbe/devfolio/blob/main/apps/api/src/users/users.controller.ts): `apps/api/src/users/users.controller.ts`
- [File uploads](https://github.com/esardorbe/devfolio/blob/main/apps/api/src/users/users.controller.ts): `apps/api/src/users/users.controller.ts`

### Persistence and integrations

- [Verification email](https://github.com/esardorbe/devfolio/blob/main/apps/api/src/email/email.service.ts): `apps/api/src/email/email.service.ts`
- [PostgreSQL data](https://github.com/esardorbe/devfolio/blob/main/apps/api/src/prisma/prisma.service.ts): `apps/api/src/prisma/prisma.service.ts`

### Other components

- **Engineer**
- **Profile visitor**
- **Google / GitHub**
- **OpenAI**
- **AWS S3**

## Connections

- Engineer → Sign-in pages: register or sign in (evidence: `apps/web/src/app/(auth)/login/page.tsx`)
- Sign-in pages → Auth client: calls auth (evidence: `apps/web/src/app/(auth)/login/page.tsx`)
- Auth client → Auth routes: HTTP auth requests (evidence: `apps/web/src/services/auth.api.ts`)
- Auth routes → Auth service: dispatches auth (evidence: `apps/api/src/auth/auth.controller.ts`)
- Auth service → PostgreSQL data: reads and writes (evidence: `apps/api/src/auth/auth.service.ts`)
- Auth service → Verification email: sends OTP (evidence: `apps/api/src/auth/auth.service.ts`)
- Google / GitHub → Auth routes: OAuth callback (evidence: `apps/api/src/auth/auth.controller.ts`)
- Auth client → Auth state: auth token flow
- Engineer → Portfolio editor: edits portfolio (evidence: `README.md`)
- Portfolio editor → User profiles: profile operations
- Portfolio editor → Projects: manages projects
- Portfolio editor → Skills: manages skills
- Portfolio editor → Work experience: manages experience
- Portfolio editor → Education: manages education
- Portfolio editor → Certificates: manages certificates
- User profiles → PostgreSQL data: reads and writes (evidence: `apps/api/src/users/users.service.ts`)
- Projects → PostgreSQL data: reads and writes (evidence: `apps/api/src/projects/projects.service.ts`)
- Skills → PostgreSQL data: reads and writes (evidence: `apps/api/src/skills/skills.service.ts`)
- Work experience → PostgreSQL data: reads and writes (evidence: `apps/api/src/experiences/experiences.service.ts`)
- Education → PostgreSQL data: reads and writes (evidence: `apps/api/src/educations/educations.service.ts`)
- Certificates → PostgreSQL data: reads and writes (evidence: `apps/api/src/certificates/certificates.service.ts`)
- Profile visitor → Public portfolio: views profile (evidence: `README.md`)
- Public portfolio → User profiles: fetches public profile
- User profiles → Profile analytics: records profile views (evidence: `apps/api/src/users/users.controller.ts`)
- Engineer → AI bio endpoint: requests bio (evidence: `README.md`)
- AI bio endpoint → OpenAI: generates bio
- Engineer → Portfolio export: exports portfolio (evidence: `README.md`)
- Portfolio export → PDF rendering: renders PDF
- Portfolio export → DOCX generation: generates DOCX
- Engineer → File uploads: uploads files (evidence: `README.md`)
- File uploads → AWS S3: stores files
