# sadhguru-slayer/pagewise-backend architecture

> Architecture diagram of the GitHub repository sadhguru-slayer/pagewise-backend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sadhguru-slayer/pagewise-backend
- Repository: https://github.com/sadhguru-slayer/pagewise-backend

## Overview

PageWise Studio is a resume-building API with AI-assisted parsing and job targeting, resume exports, accounts, and paid plans. The main workflow enters through the FastAPI app, reaches resume endpoints, and can invoke parsing or job-analysis capabilities while persisting user work and usage. Separate routes support sign-in, exports, payments, feedback, and administration. Source-index references and excerpts support the links shown; unsampled implementations are represented only where their existence or relationship is documented, so some internal flow is intentionally omitted.

Main entry points: [`app/main.py`](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/main.py) (FastAPI app), [`app/database.py`](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/database.py) (Database access), [`app/routers/resumes.py`](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/routers/resumes.py) (Resume routes), [`app/routers/auth.py`](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/routers/auth.py) (Authentication routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_api["FastAPI app<br/>[main.py]"]
end

subgraph group_resume["Resume workspace"]
  node_resume_routes["Resume routes<br/>[resumes.py]"]
  node_ai_parse["Resume AI parsing<br/>[ai_extractor.py]"]
  node_job_analysis["Job analysis<br/>[jd_analyzer.py]"]
  node_ats["ATS scoring<br/>[ats_scorer.py]"]
  node_wiser["Wiser AI runtime<br/>[wiser_runtime.py]"]
  node_export_routes["Export routes<br/>[exports.py]"]
  node_export_service["Export generation<br/>[export_service.py]"]
end

subgraph group_account["Accounts and plans"]
  node_auth_routes["Authentication routes<br/>[auth.py]"]
  node_auth["Token and identity<br/>[auth.py]"]
  node_otp["One-time codes<br/>[otp.py]"]
  node_email["Email delivery<br/>[email.py]"]
  node_payment_routes["Payment routes<br/>[payments.py]"]
  node_subscriptions["Plan and quota rules<br/>[subscription.py]"]
  node_admin_routes["Administration<br/>[admin.py]"]
  node_feedback_routes["Feedback routes<br/>[feedback.py]"]
end

subgraph group_platform["Shared services"]
  node_database[("Database access<br/>[database.py]")]
  node_models["Domain records<br/>[models.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
end

node_user(("Studio user"))
node_razorpay["Razorpay"]

node_user -->|"sends requests"| node_api
node_api -->|"registers routes"| node_resume_routes
node_api -->|"registers routes"| node_auth_routes
node_api -->|"registers routes"| node_export_routes
node_api -->|"registers routes"| node_payment_routes
node_api -->|"registers routes"| node_admin_routes
node_api -->|"registers routes"| node_feedback_routes
node_resume_routes -->|"invokes parsing"| node_ai_parse
node_resume_routes -->|"invokes analysis"| node_job_analysis
node_resume_routes -->|"uses runtime"| node_wiser
node_job_analysis -->|"uses scoring"| node_ats
node_ai_parse -->|"uses runtime"| node_wiser
node_export_routes -->|"invokes exports"| node_export_service
node_auth_routes -->|"uses identity"| node_auth
node_auth_routes -->|"manages codes"| node_otp
node_auth_routes -->|"sends email"| node_email
node_otp -.->|"uses cache config"| node_database
node_payment_routes -->|"checks plans"| node_subscriptions
node_payment_routes -->|"creates payment orders"| node_razorpay
node_admin_routes -->|"configures plans"| node_subscriptions
node_resume_routes -->|"reads and writes"| node_database
node_auth_routes -->|"reads and writes"| node_database
node_payment_routes -->|"reads and writes"| node_database
node_export_routes -->|"reads and writes"| node_database
node_feedback_routes -->|"reads and writes"| node_database
node_database -->|"maps records"| node_models
node_resume_routes -->|"validates payloads"| node_schemas

click node_api "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/main.py"
click node_resume_routes "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/routers/resumes.py"
click node_ai_parse "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/ai_extractor.py"
click node_job_analysis "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/jd_analyzer.py"
click node_ats "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/ats_scorer.py"
click node_wiser "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/wiser_runtime.py"
click node_export_routes "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/routers/exports.py"
click node_export_service "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/export_service.py"
click node_auth_routes "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/routers/auth.py"
click node_auth "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/auth.py"
click node_otp "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/services/otp.py"
click node_email "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/services/email.py"
click node_payment_routes "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/routers/payments.py"
click node_subscriptions "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/services/subscription.py"
click node_admin_routes "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/routers/admin.py"
click node_feedback_routes "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/routers/feedback.py"
click node_database "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/database.py"
click node_models "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/models.py"
click node_schemas "https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/schemas.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_api,node_user toneBlue
class node_resume_routes,node_ai_parse,node_job_analysis,node_ats,node_wiser,node_export_routes,node_export_service toneAmber
class node_auth_routes,node_auth,node_otp,node_email,node_payment_routes,node_subscriptions,node_admin_routes,node_feedback_routes toneMint
class node_database,node_models,node_schemas toneRose
class node_razorpay toneIndigo
```

## Components

### API entry

- [FastAPI app](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/main.py): `app/main.py`

### Resume workspace

- [Resume routes](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/routers/resumes.py): `app/routers/resumes.py`
- [Resume AI parsing](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/ai_extractor.py): `app/ai_extractor.py`
- [Job analysis](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/jd_analyzer.py): `app/jd_analyzer.py`
- [ATS scoring](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/ats_scorer.py): `app/ats_scorer.py`
- [Wiser AI runtime](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/wiser_runtime.py): `app/wiser_runtime.py`
- [Export routes](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/routers/exports.py): `app/routers/exports.py`
- [Export generation](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/export_service.py): `app/export_service.py`

### Accounts and plans

- [Authentication routes](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/routers/auth.py): `app/routers/auth.py`
- [Token and identity](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/auth.py): `app/auth.py`
- [One-time codes](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/services/otp.py): `app/services/otp.py`
- [Email delivery](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/services/email.py): `app/services/email.py`
- [Payment routes](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/routers/payments.py): `app/routers/payments.py`
- [Plan and quota rules](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/services/subscription.py): `app/services/subscription.py`
- [Administration](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/routers/admin.py): `app/routers/admin.py`
- [Feedback routes](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/routers/feedback.py): `app/routers/feedback.py`

### Shared services

- [Database access](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/database.py): `app/database.py`
- [Domain records](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/models.py): `app/models.py`
- [API schemas](https://github.com/sadhguru-slayer/pagewise-backend/blob/main/app/schemas.py): `app/schemas.py`

### Other components

- **Studio user**
- **Razorpay**

## Connections

- Studio user → FastAPI app: sends requests (evidence: `app/main.py`)
- FastAPI app → Resume routes: registers routes (evidence: `app/main.py`)
- FastAPI app → Authentication routes: registers routes (evidence: `app/main.py`)
- FastAPI app → Export routes: registers routes (evidence: `app/main.py`)
- FastAPI app → Payment routes: registers routes (evidence: `app/main.py`)
- FastAPI app → Administration: registers routes (evidence: `app/main.py`)
- FastAPI app → Feedback routes: registers routes (evidence: `app/main.py`)
- Resume routes → Resume AI parsing: invokes parsing (evidence: `app/routers/resumes.py`)
- Resume routes → Job analysis: invokes analysis (evidence: `app/routers/resumes.py`)
- Resume routes → Wiser AI runtime: uses runtime (evidence: `app/routers/resumes.py`)
- Job analysis → ATS scoring: uses scoring (evidence: `app/jd_analyzer.py`)
- Resume AI parsing → Wiser AI runtime: uses runtime (evidence: `app/ai_extractor.py`)
- Export routes → Export generation: invokes exports (evidence: `app/routers/exports.py`)
- Authentication routes → Token and identity: uses identity (evidence: `app/routers/auth.py`)
- Authentication routes → One-time codes: manages codes (evidence: `app/routers/auth.py`)
- Authentication routes → Email delivery: sends email (evidence: `app/routers/auth.py`)
- One-time codes → Database access: uses cache config
- Payment routes → Plan and quota rules: checks plans (evidence: `app/routers/payments.py`)
- Payment routes → Razorpay: creates payment orders (evidence: `app/routers/payments.py`)
- Administration → Plan and quota rules: configures plans (evidence: `app/routers/admin.py`)
- Resume routes → Database access: reads and writes (evidence: `app/routers/resumes.py`)
- Authentication routes → Database access: reads and writes (evidence: `app/routers/auth.py`)
- Payment routes → Database access: reads and writes (evidence: `app/routers/payments.py`)
- Export routes → Database access: reads and writes (evidence: `app/routers/exports.py`)
- Feedback routes → Database access: reads and writes (evidence: `app/routers/feedback.py`)
- Database access → Domain records: maps records (evidence: `app/database.py`)
- Resume routes → API schemas: validates payloads (evidence: `app/routers/resumes.py`)
