# lovanshimayank/elaris-one architecture

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

- Interactive diagram: https://gitdiagram.com/lovanshimayank/elaris-one
- Repository: https://github.com/lovanshimayank/elaris-one

## Overview

Elaris-One is an AI-powered academic platform for student study materials, academic resources, and learning assistance. The documented frontend route structure leads users into protected dashboards and AI features; the backend provides domain APIs, while a FastAPI service exposes PDF extraction, summarization, flashcard and quiz generation, and retrieval-augmented chat. The excerpts show the AI service’s internal request-to-model flow and selected backend service calls. Many backend routes and frontend data flows are not sampled, so those connections are omitted rather than inferred.

Main entry points: [`ai-service/app/api/routes.py`](https://github.com/lovanshimayank/elaris-one/blob/main/ai-service/app/api/routes.py) (AI API routes), [`frontend/src/routes/AppRoutes.tsx`](https://github.com/lovanshimayank/elaris-one/blob/main/frontend/src/routes/AppRoutes.tsx) (App routes), [`ai-service/app/services/ai_engine.py`](https://github.com/lovanshimayank/elaris-one/blob/main/ai-service/app/services/ai_engine.py) (LLM engine), [`backend/src/services/notes/note.service.ts`](https://github.com/lovanshimayank/elaris-one/blob/main/backend/src/services/notes/note.service.ts) (Notes service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Student application"]
  node_web_routes["App routes<br/>[AppRoutes.tsx]"]
  node_auth["Authentication state<br/>[AuthContext.tsx]"]
  node_study_pages["Study pages"]
  node_ai_pages["AI assistant<br/>[AIAssistant.tsx]"]
  node_web_auth_api["Auth API client<br/>[auth.service.ts]"]
end

subgraph group_api["Platform backend"]
  node_backend_ai_client["AI service client"]
  node_domain_controllers["Domain controllers"]
  node_notes_service["Notes service<br/>[note.service.ts]"]
  node_admin_service["Admin service<br/>[admin.service.ts]"]
end

subgraph group_study_ai["Academic AI"]
  node_ai_routes["AI API routes<br/>[routes.py]"]
  node_pdf_loader["PDF extraction<br/>[pdf_loader.py]"]
  node_ai_engine["LLM engine<br/>[ai_engine.py]"]
  node_vector_store[("Vector retrieval<br/>[chroma_store.py]")]
  node_ai_service["AI service runtime<br/>[main.py]"]
end

subgraph group_data["Persistence"]
  node_platform_db[("Prisma database access<br/>[prisma.ts]")]
end

node_student(("Student"))
node_ollama{{"Ollama"}}
node_gemini{{"Gemini API"}}

node_web_routes -->|"checks session"| node_auth
node_web_routes -->|"routes to"| node_study_pages
node_web_routes -->|"routes to"| node_ai_pages
node_web_auth_api -->|"serves login"| node_auth
node_domain_controllers -->|"calls"| node_notes_service
node_notes_service -->|"reads and writes"| node_platform_db
node_admin_service -->|"uses"| node_platform_db
node_ai_service -->|"mounts routes"| node_ai_routes
node_ai_routes -->|"extracts PDF"| node_pdf_loader
node_ai_routes -->|"generates content"| node_ai_engine
node_ai_routes -->|"retrieves context"| node_vector_store
node_ai_engine -->|"tries generation"| node_ollama
node_ai_engine -->|"falls back"| node_gemini
node_backend_ai_client -.->|"HTTP integration"| node_ai_routes
node_student -.->|"uses"| node_web_routes

click node_web_routes "https://github.com/lovanshimayank/elaris-one/blob/main/frontend/src/routes/AppRoutes.tsx"
click node_auth "https://github.com/lovanshimayank/elaris-one/blob/main/frontend/src/context/AuthContext.tsx"
click node_study_pages "https://github.com/lovanshimayank/elaris-one/tree/main/frontend/src/pages/dashboard"
click node_ai_pages "https://github.com/lovanshimayank/elaris-one/blob/main/frontend/src/pages/ai/AIAssistant.tsx"
click node_web_auth_api "https://github.com/lovanshimayank/elaris-one/blob/main/frontend/src/services/auth.service.ts"
click node_backend_ai_client "https://github.com/lovanshimayank/elaris-one/blob/main/backend/src/services/ai/ai-service-client.ts"
click node_domain_controllers "https://github.com/lovanshimayank/elaris-one/tree/main/backend/src/controllers"
click node_notes_service "https://github.com/lovanshimayank/elaris-one/blob/main/backend/src/services/notes/note.service.ts"
click node_admin_service "https://github.com/lovanshimayank/elaris-one/blob/main/backend/src/services/admin/admin.service.ts"
click node_platform_db "https://github.com/lovanshimayank/elaris-one/blob/main/backend/src/lib/prisma.ts"
click node_ai_routes "https://github.com/lovanshimayank/elaris-one/blob/main/ai-service/app/api/routes.py"
click node_pdf_loader "https://github.com/lovanshimayank/elaris-one/blob/main/ai-service/app/loaders/pdf_loader.py"
click node_ai_engine "https://github.com/lovanshimayank/elaris-one/blob/main/ai-service/app/services/ai_engine.py"
click node_vector_store "https://github.com/lovanshimayank/elaris-one/blob/main/ai-service/app/vectorstore/chroma_store.py"
click node_ai_service "https://github.com/lovanshimayank/elaris-one/blob/main/ai-service/main.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_web_routes,node_auth,node_study_pages,node_ai_pages,node_web_auth_api toneBlue
class node_backend_ai_client,node_domain_controllers,node_notes_service,node_admin_service toneAmber
class node_ai_routes,node_pdf_loader,node_ai_engine,node_vector_store,node_ai_service,node_gemini toneMint
class node_platform_db toneRose
class node_student,node_ollama toneIndigo
```

## Components

### Student application

- [App routes](https://github.com/lovanshimayank/elaris-one/blob/main/frontend/src/routes/AppRoutes.tsx): `frontend/src/routes/AppRoutes.tsx`
- [Authentication state](https://github.com/lovanshimayank/elaris-one/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [Study pages](https://github.com/lovanshimayank/elaris-one/tree/main/frontend/src/pages/dashboard): `frontend/src/pages/dashboard`
- [AI assistant](https://github.com/lovanshimayank/elaris-one/blob/main/frontend/src/pages/ai/AIAssistant.tsx): `frontend/src/pages/ai/AIAssistant.tsx`
- [Auth API client](https://github.com/lovanshimayank/elaris-one/blob/main/frontend/src/services/auth.service.ts): `frontend/src/services/auth.service.ts`

### Platform backend

- [AI service client](https://github.com/lovanshimayank/elaris-one/blob/main/backend/src/services/ai/ai-service-client.ts): `backend/src/services/ai/ai-service-client.ts`
- [Domain controllers](https://github.com/lovanshimayank/elaris-one/tree/main/backend/src/controllers): `backend/src/controllers`
- [Notes service](https://github.com/lovanshimayank/elaris-one/blob/main/backend/src/services/notes/note.service.ts): `backend/src/services/notes/note.service.ts`
- [Admin service](https://github.com/lovanshimayank/elaris-one/blob/main/backend/src/services/admin/admin.service.ts): `backend/src/services/admin/admin.service.ts`

### Academic AI

- [AI API routes](https://github.com/lovanshimayank/elaris-one/blob/main/ai-service/app/api/routes.py): `ai-service/app/api/routes.py`
- [PDF extraction](https://github.com/lovanshimayank/elaris-one/blob/main/ai-service/app/loaders/pdf_loader.py): `ai-service/app/loaders/pdf_loader.py`
- [LLM engine](https://github.com/lovanshimayank/elaris-one/blob/main/ai-service/app/services/ai_engine.py): `ai-service/app/services/ai_engine.py`
- [Vector retrieval](https://github.com/lovanshimayank/elaris-one/blob/main/ai-service/app/vectorstore/chroma_store.py): `ai-service/app/vectorstore/chroma_store.py`
- [AI service runtime](https://github.com/lovanshimayank/elaris-one/blob/main/ai-service/main.py): `ai-service/main.py`

### Persistence

- [Prisma database access](https://github.com/lovanshimayank/elaris-one/blob/main/backend/src/lib/prisma.ts): `backend/src/lib/prisma.ts`

### Other components

- **Student**
- **Ollama**
- **Gemini API**

## Connections

- App routes → Authentication state: checks session (evidence: `frontend/src/routes/AppRoutes.tsx`)
- App routes → Study pages: routes to (evidence: `frontend/src/routes/AppRoutes.tsx`)
- App routes → AI assistant: routes to (evidence: `frontend/src/routes/AppRoutes.tsx`)
- Auth API client → Authentication state: serves login (evidence: `frontend/src/context/AuthContext.tsx`)
- Domain controllers → Notes service: calls (evidence: `backend/src/controllers/notes/note.controller.ts`)
- Notes service → Prisma database access: reads and writes
- Admin service → Prisma database access: uses
- AI service runtime → AI API routes: mounts routes (evidence: `ai-service/main.py`)
- AI API routes → PDF extraction: extracts PDF (evidence: `ai-service/app/api/routes.py`)
- AI API routes → LLM engine: generates content (evidence: `ai-service/app/api/routes.py`)
- AI API routes → Vector retrieval: retrieves context (evidence: `ai-service/app/api/routes.py`)
- LLM engine → Ollama: tries generation (evidence: `ai-service/app/services/ai_engine.py`)
- LLM engine → Gemini API: falls back (evidence: `ai-service/app/services/ai_engine.py`)
- AI service client → AI API routes: HTTP integration
- Student → App routes: uses
