# phani-stack/atlas architecture

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

- Interactive diagram: https://gitdiagram.com/phani-stack/atlas
- Repository: https://github.com/phani-stack/atlas

## Overview

Atlas is an adaptive-learning prototype: learners create a goal-based learning space, receive a roadmap and resources, then practice with a tutor that tracks progress. The React app calls a FastAPI backend; the backend exposes account, space, learning-path, and tutoring APIs. Generation and retrieval use dedicated services and infrastructure, with SQLite-backed repositories for users and spaces. The README describes a broader assessment-and-adaptation cycle; sampled files show tutor progress and answer operations, but do not establish every internal adaptation link, so those connections are omitted.

Main entry points: [`ui/src/lib/api.ts`](https://github.com/phani-stack/atlas/blob/main/ui/src/lib/api.ts) (API client), [`ui/src/App.tsx`](https://github.com/phani-stack/atlas/blob/main/ui/src/App.tsx) (Application shell), [`src/atlas/api/main.py`](https://github.com/phani-stack/atlas/blob/main/src/atlas/api/main.py) (FastAPI app), [`src/atlas/learning_spaces.py`](https://github.com/phani-stack/atlas/blob/main/src/atlas/learning_spaces.py) (Learning-space orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Learner interface"]
  node_app["Application shell<br/>[App.tsx]"]
  node_authui["Authentication UI<br/>[AuthPage.tsx]"]
  node_spacesui["Space creation UI"]
  node_pathui["Roadmap view<br/>[PathScreen.tsx]"]
  node_practiceui["Practice screen<br/>[PracticeScreen.tsx]"]
  node_webapi["API client<br/>[api.ts]"]
end

subgraph group_api["API and identity"]
  node_server["FastAPI app<br/>[main.py]"]
  node_authroutes["Account endpoints<br/>[auth_routes.py]"]
  node_learningroutes["Learning endpoint<br/>[routes.py]"]
  node_spaceroutes["Space endpoints<br/>[spaces.py]"]
  node_tutorroutes["Tutor endpoints<br/>[space_tutor.py]"]
end

subgraph group_learning["Learning generation"]
  node_learningflow["Learning-space orchestration<br/>[learning_spaces.py]"]
  node_roadmap["Roadmap generation<br/>[roadmap_service.py]"]
  node_resources["Resource discovery"]
  node_search["Search providers<br/>[providers.py]"]
  node_downloader["Resource downloader<br/>[downloader.py]"]
end

subgraph group_tutor["Tutoring and retrieval"]
  node_tutorservice["Tutor service<br/>[tutor_service.py]"]
  node_knowledge["Knowledge index<br/>[store.py]"]
  node_llm["Groq model client<br/>[groq_client.py]"]
end

subgraph group_data["Persistence and providers"]
  node_database["Database facade<br/>[database.py]"]
  node_spacesrepo["Space repository"]
  node_usersrepo["User repository<br/>[user_repository.py]"]
  node_sqlite[("SQLite database<br/>[config.py]")]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_app
node_app -->|"renders"| node_authui
node_app -->|"renders"| node_spacesui
node_app -->|"renders"| node_pathui
node_app -->|"renders"| node_practiceui
node_app -->|"loads spaces"| node_webapi
node_authui -->|"authenticates via"| node_webapi
node_spacesui -->|"creates space"| node_webapi
node_practiceui -->|"tutors via"| node_webapi
node_webapi -->|"calls auth routes"| node_authroutes
node_webapi -->|"calls learning route"| node_learningroutes
node_webapi -->|"calls space routes"| node_spaceroutes
node_webapi -->|"calls tutor routes"| node_tutorroutes
node_server -->|"registers"| node_authroutes
node_server -->|"registers"| node_learningroutes
node_server -->|"registers"| node_spaceroutes
node_server -->|"registers"| node_tutorroutes
node_learningroutes -->|"creates learning space"| node_learningflow
node_authroutes -->|"reads and writes users"| node_database
node_learningflow -.->|"generates roadmap"| node_roadmap
node_learningflow -.->|"finds resources"| node_resources
node_resources -->|"searches providers"| node_search
node_resources -->|"downloads resources"| node_downloader
node_roadmap -->|"requests generation"| node_llm
node_tutorservice -->|"uses index"| node_knowledge
node_tutorservice -.->|"requests model output"| node_llm
node_tutorroutes -.->|"delegates tutoring"| node_tutorservice
node_database -->|"delegates space data"| node_spacesrepo
node_database -->|"delegates user data"| node_usersrepo
node_spacesrepo -->|"stores space records"| node_sqlite
node_usersrepo -.->|"stores user records"| node_sqlite

click node_app "https://github.com/phani-stack/atlas/blob/main/ui/src/App.tsx"
click node_authui "https://github.com/phani-stack/atlas/blob/main/ui/src/components/AuthPage.tsx"
click node_spacesui "https://github.com/phani-stack/atlas/blob/main/ui/src/components/modals/CreateSpaceModal.tsx"
click node_pathui "https://github.com/phani-stack/atlas/blob/main/ui/src/components/screens/PathScreen.tsx"
click node_practiceui "https://github.com/phani-stack/atlas/blob/main/ui/src/components/screens/PracticeScreen.tsx"
click node_webapi "https://github.com/phani-stack/atlas/blob/main/ui/src/lib/api.ts"
click node_server "https://github.com/phani-stack/atlas/blob/main/src/atlas/api/main.py"
click node_authroutes "https://github.com/phani-stack/atlas/blob/main/src/atlas/api/auth_routes.py"
click node_learningroutes "https://github.com/phani-stack/atlas/blob/main/src/atlas/api/routes.py"
click node_spaceroutes "https://github.com/phani-stack/atlas/blob/main/src/atlas/api/spaces.py"
click node_tutorroutes "https://github.com/phani-stack/atlas/blob/main/src/atlas/api/space_tutor.py"
click node_learningflow "https://github.com/phani-stack/atlas/blob/main/src/atlas/learning_spaces.py"
click node_roadmap "https://github.com/phani-stack/atlas/blob/main/src/atlas/services/roadmap_service.py"
click node_resources "https://github.com/phani-stack/atlas/blob/main/src/atlas/services/resource_service.py"
click node_tutorservice "https://github.com/phani-stack/atlas/blob/main/src/atlas/services/tutor_service.py"
click node_knowledge "https://github.com/phani-stack/atlas/blob/main/src/atlas/infrastructure/knowledge/store.py"
click node_llm "https://github.com/phani-stack/atlas/blob/main/src/atlas/infrastructure/llm/groq_client.py"
click node_search "https://github.com/phani-stack/atlas/blob/main/src/atlas/infrastructure/search/providers.py"
click node_downloader "https://github.com/phani-stack/atlas/blob/main/src/atlas/infrastructure/search/downloader.py"
click node_database "https://github.com/phani-stack/atlas/blob/main/src/atlas/database.py"
click node_spacesrepo "https://github.com/phani-stack/atlas/blob/main/src/atlas/repositories/space_repository.py"
click node_usersrepo "https://github.com/phani-stack/atlas/blob/main/src/atlas/repositories/user_repository.py"
click node_sqlite "https://github.com/phani-stack/atlas/blob/main/src/atlas/core/config.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_app,node_authui,node_spacesui,node_pathui,node_practiceui,node_webapi toneBlue
class node_server,node_authroutes,node_learningroutes,node_spaceroutes,node_tutorroutes toneAmber
class node_learningflow,node_roadmap,node_resources,node_search,node_downloader toneMint
class node_tutorservice,node_knowledge,node_llm toneRose
class node_database,node_spacesrepo,node_usersrepo,node_sqlite,node_learner toneIndigo
```

## Components

### Learner interface

- [Application shell](https://github.com/phani-stack/atlas/blob/main/ui/src/App.tsx): `ui/src/App.tsx`
- [Authentication UI](https://github.com/phani-stack/atlas/blob/main/ui/src/components/AuthPage.tsx): `ui/src/components/AuthPage.tsx`
- [Space creation UI](https://github.com/phani-stack/atlas/blob/main/ui/src/components/modals/CreateSpaceModal.tsx): `ui/src/components/modals/CreateSpaceModal.tsx`
- [Roadmap view](https://github.com/phani-stack/atlas/blob/main/ui/src/components/screens/PathScreen.tsx): `ui/src/components/screens/PathScreen.tsx`
- [Practice screen](https://github.com/phani-stack/atlas/blob/main/ui/src/components/screens/PracticeScreen.tsx): `ui/src/components/screens/PracticeScreen.tsx`
- [API client](https://github.com/phani-stack/atlas/blob/main/ui/src/lib/api.ts): `ui/src/lib/api.ts`

### API and identity

- [FastAPI app](https://github.com/phani-stack/atlas/blob/main/src/atlas/api/main.py): `src/atlas/api/main.py`
- [Account endpoints](https://github.com/phani-stack/atlas/blob/main/src/atlas/api/auth_routes.py): `src/atlas/api/auth_routes.py`
- [Learning endpoint](https://github.com/phani-stack/atlas/blob/main/src/atlas/api/routes.py): `src/atlas/api/routes.py`
- [Space endpoints](https://github.com/phani-stack/atlas/blob/main/src/atlas/api/spaces.py): `src/atlas/api/spaces.py`
- [Tutor endpoints](https://github.com/phani-stack/atlas/blob/main/src/atlas/api/space_tutor.py): `src/atlas/api/space_tutor.py`

### Learning generation

- [Learning-space orchestration](https://github.com/phani-stack/atlas/blob/main/src/atlas/learning_spaces.py): `src/atlas/learning_spaces.py`
- [Roadmap generation](https://github.com/phani-stack/atlas/blob/main/src/atlas/services/roadmap_service.py): `src/atlas/services/roadmap_service.py`
- [Resource discovery](https://github.com/phani-stack/atlas/blob/main/src/atlas/services/resource_service.py): `src/atlas/services/resource_service.py`
- [Search providers](https://github.com/phani-stack/atlas/blob/main/src/atlas/infrastructure/search/providers.py): `src/atlas/infrastructure/search/providers.py`
- [Resource downloader](https://github.com/phani-stack/atlas/blob/main/src/atlas/infrastructure/search/downloader.py): `src/atlas/infrastructure/search/downloader.py`

### Tutoring and retrieval

- [Tutor service](https://github.com/phani-stack/atlas/blob/main/src/atlas/services/tutor_service.py): `src/atlas/services/tutor_service.py`
- [Knowledge index](https://github.com/phani-stack/atlas/blob/main/src/atlas/infrastructure/knowledge/store.py): `src/atlas/infrastructure/knowledge/store.py`
- [Groq model client](https://github.com/phani-stack/atlas/blob/main/src/atlas/infrastructure/llm/groq_client.py): `src/atlas/infrastructure/llm/groq_client.py`

### Persistence and providers

- [Database facade](https://github.com/phani-stack/atlas/blob/main/src/atlas/database.py): `src/atlas/database.py`
- [Space repository](https://github.com/phani-stack/atlas/blob/main/src/atlas/repositories/space_repository.py): `src/atlas/repositories/space_repository.py`
- [User repository](https://github.com/phani-stack/atlas/blob/main/src/atlas/repositories/user_repository.py): `src/atlas/repositories/user_repository.py`
- [SQLite database](https://github.com/phani-stack/atlas/blob/main/src/atlas/core/config.py): `src/atlas/core/config.py`

### Other components

- **Learner**

## Connections

- Learner → Application shell: uses (evidence: `ui/src/App.tsx`)
- Application shell → Authentication UI: renders (evidence: `ui/src/App.tsx`)
- Application shell → Space creation UI: renders (evidence: `ui/src/App.tsx`)
- Application shell → Roadmap view: renders (evidence: `ui/src/App.tsx`)
- Application shell → Practice screen: renders (evidence: `ui/src/App.tsx`)
- Application shell → API client: loads spaces (evidence: `ui/src/App.tsx`)
- Authentication UI → API client: authenticates via (evidence: `ui/src/components/AuthPage.tsx`)
- Space creation UI → API client: creates space (evidence: `ui/src/components/modals/CreateSpaceModal.tsx`)
- Practice screen → API client: tutors via (evidence: `ui/src/components/screens/PracticeScreen.tsx`)
- API client → Account endpoints: calls auth routes (evidence: `ui/src/lib/api.ts`)
- API client → Learning endpoint: calls learning route (evidence: `ui/src/lib/api.ts`)
- API client → Space endpoints: calls space routes (evidence: `ui/src/lib/api.ts`)
- API client → Tutor endpoints: calls tutor routes (evidence: `ui/src/lib/api.ts`)
- FastAPI app → Account endpoints: registers (evidence: `src/atlas/api/main.py`)
- FastAPI app → Learning endpoint: registers (evidence: `src/atlas/api/main.py`)
- FastAPI app → Space endpoints: registers (evidence: `src/atlas/api/main.py`)
- FastAPI app → Tutor endpoints: registers (evidence: `src/atlas/api/main.py`)
- Learning endpoint → Learning-space orchestration: creates learning space (evidence: `src/atlas/api/routes.py`)
- Account endpoints → Database facade: reads and writes users (evidence: `src/atlas/api/auth_routes.py`)
- Learning-space orchestration → Roadmap generation: generates roadmap
- Learning-space orchestration → Resource discovery: finds resources
- Resource discovery → Search providers: searches providers (evidence: `src/atlas/services/resource_service.py`)
- Resource discovery → Resource downloader: downloads resources (evidence: `src/atlas/services/resource_service.py`)
- Roadmap generation → Groq model client: requests generation (evidence: `src/atlas/services/roadmap_service.py`)
- Tutor service → Knowledge index: uses index (evidence: `src/atlas/services/tutor_service.py`)
- Tutor service → Groq model client: requests model output
- Tutor endpoints → Tutor service: delegates tutoring
- Database facade → Space repository: delegates space data (evidence: `src/atlas/database.py`)
- Database facade → User repository: delegates user data (evidence: `src/atlas/database.py`)
- Space repository → SQLite database: stores space records (evidence: `src/atlas/repositories/space_repository.py`)
- User repository → SQLite database: stores user records
