# gjunio0-web/elite90 architecture

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

- Interactive diagram: https://gitdiagram.com/gjunio0-web/elite90
- Repository: https://github.com/gjunio0-web/elite90

## Overview

ELITE90 PRO is a coaching platform spanning public lead intake and professional operations, plus athlete follow-up, plan authoring, and content. The clearest evidenced runtime flow is lead submission: the Netlify handler scores the lead, persists it, records traceability, and sends email. Other domain stages are represented by their endpoint and module paths in the tree, but their internal calls were not sampled; those links are therefore dashed and unverified. No README was provided, so capability coverage is based on the file tree and SOURCE INDEX.

Main entry points: [`netlify/functions/submit-lead.ts`](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/submit-lead.ts) (Lead Submission), [`netlify/functions/criar-conta-profissional.ts`](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/criar-conta-profissional.ts) (Professional Accounts), [`packages/editor-plano/nucleo.js`](https://github.com/gjunio0-web/elite90/blob/main/packages/editor-plano/nucleo.js) (Plan Editing), [`netlify/functions/registrar-checkin.ts`](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/registrar-checkin.ts) (Athlete Check-ins)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Lead Intake"]
  node_lead["Lead Submission<br/>[submit-lead.ts]"]
end

subgraph group_operations["Coach Operations"]
  node_professional_admin["Professional Accounts"]
  node_lead_review["Lead Promotion<br/>[promote-lead.ts]"]
end

subgraph group_athlete["Athlete Follow-up"]
  node_athlete_records["Athlete Check-ins"]
  node_assessment["Physical Assessment"]
  node_athlete_status["Follow-up Status<br/>[nucleo.js]"]
end

subgraph group_plans["Plans and Content"]
  node_plan_editing["Plan Editing<br/>[nucleo.js]"]
  node_plan_document["Plan Document<br/>[plano-documento.ts]"]
  node_plan_publish["Plan Publishing"]
  node_suggestions["Plan Suggestions"]
  node_content_catalog["Food and Exercise Catalogs"]
end

subgraph group_shared["Shared Services"]
  node_lead_score["Lead Scoring<br/>[_scoring.ts]"]
  node_llm_adapter["Model Access<br/>[_llm.ts]"]
  node_llm_core["Model Request Core<br/>[_llm-nucleo.js]"]
  node_firebase_helpers["Firebase Access<br/>[_firebase.ts]"]
  node_trace["Traceability"]
  node_mailer["Mail Delivery<br/>[_mailer.ts]"]
  node_email_header["Email Header<br/>[_email-header.ts]"]
  node_email_badge["Email Brand Asset<br/>[_email-emblema.ts]"]
end

node_prospect(("Prospective Client"))
node_gemini{{"Gemini API"}}
node_firestore[("Firestore")]

node_prospect -->|"submits"| node_lead
node_lead -->|"scores lead"| node_lead_score
node_lead -->|"uses Firebase"| node_firebase_helpers
node_firebase_helpers -.->|"accesses"| node_firestore
node_lead -->|"records event"| node_trace
node_lead -->|"sends email"| node_mailer
node_lead -->|"builds email"| node_email_header
node_email_header -->|"uses asset"| node_email_badge
node_lead_score -->|"requests model"| node_llm_adapter
node_llm_adapter -->|"delegates to"| node_llm_core
node_llm_core -.->|"calls model"| node_gemini
node_lead -.->|"may promote"| node_professional_admin
node_professional_admin -.->|"manages leads"| node_lead_review
node_professional_admin -.->|"manages athletes"| node_athlete_records
node_athlete_records -.->|"derives status"| node_athlete_status
node_professional_admin -.->|"records assessment"| node_assessment
node_professional_admin -.->|"authors plans"| node_plan_editing
node_plan_editing -.->|"builds document"| node_plan_document
node_professional_admin -.->|"publishes plans"| node_plan_publish
node_professional_admin -.->|"reviews proposals"| node_suggestions
node_plan_editing -.->|"uses catalog"| node_content_catalog

click node_lead "https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/submit-lead.ts"
click node_lead_score "https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_scoring.ts"
click node_llm_adapter "https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_llm.ts"
click node_llm_core "https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_llm-nucleo.js"
click node_firebase_helpers "https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_firebase.ts"
click node_trace "https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_rastreabilidade.ts"
click node_mailer "https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_mailer.ts"
click node_email_header "https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_email-header.ts"
click node_email_badge "https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_email-emblema.ts"
click node_professional_admin "https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/criar-conta-profissional.ts"
click node_lead_review "https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/promote-lead.ts"
click node_athlete_records "https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/registrar-checkin.ts"
click node_assessment "https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/registrar-avaliacao-fisica.ts"
click node_athlete_status "https://github.com/gjunio0-web/elite90/blob/main/packages/situacao/nucleo.js"
click node_plan_editing "https://github.com/gjunio0-web/elite90/blob/main/packages/editor-plano/nucleo.js"
click node_plan_document "https://github.com/gjunio0-web/elite90/blob/main/apps/site/src/lib/plano-documento.ts"
click node_plan_publish "https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/publicar-plano-direto.ts"
click node_suggestions "https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/submeter-sugestao.ts"
click node_content_catalog "https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_vocabulario-alimentos.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_lead,node_prospect toneBlue
class node_professional_admin,node_lead_review,node_firestore toneAmber
class node_athlete_records,node_assessment,node_athlete_status,node_gemini toneMint
class node_plan_editing,node_plan_document,node_plan_publish,node_suggestions,node_content_catalog toneRose
class node_lead_score,node_llm_adapter,node_llm_core,node_firebase_helpers,node_trace,node_mailer,node_email_header,node_email_badge toneIndigo
```

## Components

### Lead Intake

- [Lead Submission](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/submit-lead.ts): `netlify/functions/submit-lead.ts`

### Coach Operations

- [Professional Accounts](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/criar-conta-profissional.ts): `netlify/functions/criar-conta-profissional.ts`
- [Lead Promotion](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/promote-lead.ts): `netlify/functions/promote-lead.ts`

### Athlete Follow-up

- [Athlete Check-ins](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/registrar-checkin.ts): `netlify/functions/registrar-checkin.ts`
- [Physical Assessment](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/registrar-avaliacao-fisica.ts): `netlify/functions/registrar-avaliacao-fisica.ts`
- [Follow-up Status](https://github.com/gjunio0-web/elite90/blob/main/packages/situacao/nucleo.js): `packages/situacao/nucleo.js`

### Plans and Content

- [Plan Editing](https://github.com/gjunio0-web/elite90/blob/main/packages/editor-plano/nucleo.js): `packages/editor-plano/nucleo.js`
- [Plan Document](https://github.com/gjunio0-web/elite90/blob/main/apps/site/src/lib/plano-documento.ts): `apps/site/src/lib/plano-documento.ts`
- [Plan Publishing](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/publicar-plano-direto.ts): `netlify/functions/publicar-plano-direto.ts`
- [Plan Suggestions](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/submeter-sugestao.ts): `netlify/functions/submeter-sugestao.ts`
- [Food and Exercise Catalogs](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_vocabulario-alimentos.ts): `netlify/functions/_vocabulario-alimentos.ts`

### Shared Services

- [Lead Scoring](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_scoring.ts): `netlify/functions/_scoring.ts`
- [Model Access](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_llm.ts): `netlify/functions/_llm.ts`
- [Model Request Core](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_llm-nucleo.js): `netlify/functions/_llm-nucleo.js`
- [Firebase Access](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_firebase.ts): `netlify/functions/_firebase.ts`
- [Traceability](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_rastreabilidade.ts): `netlify/functions/_rastreabilidade.ts`
- [Mail Delivery](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_mailer.ts): `netlify/functions/_mailer.ts`
- [Email Header](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_email-header.ts): `netlify/functions/_email-header.ts`
- [Email Brand Asset](https://github.com/gjunio0-web/elite90/blob/main/netlify/functions/_email-emblema.ts): `netlify/functions/_email-emblema.ts`

### Other components

- **Prospective Client**
- **Gemini API**
- **Firestore**

## Connections

- Prospective Client → Lead Submission: submits (evidence: `netlify/functions/submit-lead.ts`)
- Lead Submission → Lead Scoring: scores lead (evidence: `netlify/functions/submit-lead.ts`)
- Lead Submission → Firebase Access: uses Firebase (evidence: `netlify/functions/submit-lead.ts`)
- Firebase Access → Firestore: accesses
- Lead Submission → Traceability: records event (evidence: `netlify/functions/submit-lead.ts`)
- Lead Submission → Mail Delivery: sends email (evidence: `netlify/functions/submit-lead.ts`)
- Lead Submission → Email Header: builds email (evidence: `netlify/functions/submit-lead.ts`)
- Email Header → Email Brand Asset: uses asset (evidence: `netlify/functions/_email-header.ts`)
- Lead Scoring → Model Access: requests model (evidence: `netlify/functions/_scoring.ts`)
- Model Access → Model Request Core: delegates to (evidence: `netlify/functions/_llm.ts`)
- Model Request Core → Gemini API: calls model
- Lead Submission → Professional Accounts: may promote
- Professional Accounts → Lead Promotion: manages leads
- Professional Accounts → Athlete Check-ins: manages athletes
- Athlete Check-ins → Follow-up Status: derives status
- Professional Accounts → Physical Assessment: records assessment
- Professional Accounts → Plan Editing: authors plans
- Plan Editing → Plan Document: builds document
- Professional Accounts → Plan Publishing: publishes plans
- Professional Accounts → Plan Suggestions: reviews proposals
- Plan Editing → Food and Exercise Catalogs: uses catalog
