# juaanvalencia/prostasim architecture

> Architecture diagram of the GitHub repository juaanvalencia/prostasim, 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/juaanvalencia/prostasim
- Repository: https://github.com/juaanvalencia/prostasim

## Overview

PROSTA-SIM is a Spanish-language educational prostate learning platform. The current working flow is account registration or login, authentication-gated access to a dashboard, and selection of the implemented learning module, where students browse lessons on prostate anatomy, function, conditions, and diagnosis. The dashboard also presents planned 3D anatomy, clinical cases, AI tutoring, assessments, and progress, but these sections are explicitly placeholders. The graph reflects the sampled runtime; those planned capabilities are not represented as implemented subsystems.

Main entry points: [`src/context/AuthContext.jsx`](https://github.com/juaanvalencia/prostasim/blob/main/src/context/AuthContext.jsx) (Auth context), [`src/App.jsx`](https://github.com/juaanvalencia/prostasim/blob/main/src/App.jsx) (App routing), [`src/pages`](https://github.com/juaanvalencia/prostasim/tree/main/src/pages) (Login and registration), [`src/Dashboard.jsx`](https://github.com/juaanvalencia/prostasim/blob/main/src/Dashboard.jsx) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_app_shell["App routing<br/>[App.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth_pages["Login and registration"]
  node_auth_state["Auth context<br/>[AuthContext.jsx]"]
end

subgraph group_learning["Learning experience"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_learning_module["Learning lessons<br/>[Learning.jsx]"]
end

subgraph group_backend["Backend services"]
  node_supabase_client["Supabase client<br/>[supabase.js]"]
end

node_student(("Student"))
node_supabase_auth["Supabase Auth"]
node_profiles[("Profiles table")]

node_student -->|"opens app"| node_app_shell
node_app_shell -->|"checks session"| node_auth_state
node_app_shell -->|"routes unauthenticated"| node_auth_pages
node_app_shell -->|"routes authenticated"| node_dashboard
node_auth_pages -->|"invokes auth actions"| node_auth_state
node_auth_pages -->|"invokes registration"| node_auth_state
node_auth_state -->|"calls auth and profile APIs"| node_supabase_client
node_supabase_client -->|"creates client"| node_supabase_auth
node_auth_state -->|"reads profile"| node_profiles
node_dashboard -->|"uses user and logout"| node_auth_state
node_dashboard -->|"renders learning section"| node_learning_module

click node_app_shell "https://github.com/juaanvalencia/prostasim/blob/main/src/App.jsx"
click node_auth_pages "https://github.com/juaanvalencia/prostasim/tree/main/src/pages"
click node_auth_state "https://github.com/juaanvalencia/prostasim/blob/main/src/context/AuthContext.jsx"
click node_dashboard "https://github.com/juaanvalencia/prostasim/blob/main/src/Dashboard.jsx"
click node_learning_module "https://github.com/juaanvalencia/prostasim/blob/main/src/components/learning/Learning.jsx"
click node_supabase_client "https://github.com/juaanvalencia/prostasim/blob/main/src/services/supabase.js"

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_app_shell toneBlue
class node_auth_pages,node_auth_state,node_profiles toneAmber
class node_dashboard,node_learning_module toneMint
class node_supabase_client toneRose
class node_student,node_supabase_auth toneIndigo
```

## Components

### Application entry

- [App routing](https://github.com/juaanvalencia/prostasim/blob/main/src/App.jsx): `src/App.jsx`

### Identity and access

- [Login and registration](https://github.com/juaanvalencia/prostasim/tree/main/src/pages): `src/pages`
- [Auth context](https://github.com/juaanvalencia/prostasim/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`

### Learning experience

- [Dashboard](https://github.com/juaanvalencia/prostasim/blob/main/src/Dashboard.jsx): `src/Dashboard.jsx`
- [Learning lessons](https://github.com/juaanvalencia/prostasim/blob/main/src/components/learning/Learning.jsx): `src/components/learning/Learning.jsx`

### Backend services

- [Supabase client](https://github.com/juaanvalencia/prostasim/blob/main/src/services/supabase.js): `src/services/supabase.js`

### Other components

- **Student**
- **Supabase Auth**
- **Profiles table**

## Connections

- Student → App routing: opens app
- App routing → Auth context: checks session (evidence: `src/App.jsx`)
- App routing → Login and registration: routes unauthenticated (evidence: `src/App.jsx`)
- App routing → Dashboard: routes authenticated (evidence: `src/App.jsx`)
- Login and registration → Auth context: invokes auth actions (evidence: `src/pages/Login.jsx`)
- Login and registration → Auth context: invokes registration (evidence: `src/pages/Register.jsx`)
- Auth context → Supabase client: calls auth and profile APIs (evidence: `src/context/AuthContext.jsx`)
- Supabase client → Supabase Auth: creates client (evidence: `src/services/supabase.js`)
- Auth context → Profiles table: reads profile (evidence: `src/context/AuthContext.jsx`)
- Dashboard → Auth context: uses user and logout (evidence: `src/Dashboard.jsx`)
- Dashboard → Learning lessons: renders learning section (evidence: `src/Dashboard.jsx`)
