# elifasik1/luma architecture

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

- Interactive diagram: https://gitdiagram.com/elifasik1/luma
- Repository: https://github.com/elifasik1/luma

## Overview

LUMA is an AI-powered life-planning companion: a user describes a desired future, then develops goals, daily actions, progress, and reflections in an ongoing cycle. The Next.js experience communicates with an ASP.NET Core API; application services coordinate domain operations, persistence, and AI generation. Documented capabilities include adaptive daily plans, a journey calendar, and conversational guidance. The README establishes the product flow and technology boundary; sampled API and service excerpts support only selected backend links, so uncertain frontend routing is shown as unverified.

Main entry points: [`LUMA/Luma.Api/Program.cs`](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Api/Program.cs) (HTTP API), [`LUMA/Luma.Application/Services/DreamAnalysisService.cs`](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/DreamAnalysisService.cs) (Future discovery service), [`LUMA/Luma.Application/AI/IAIService.cs`](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/AI/IAIService.cs) (AI service contract), [`LUMA/Luma.Infrastructure/Persistence/LumaDbContext.cs`](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Infrastructure/Persistence/LumaDbContext.cs) (Application database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_web["Next.js experience"]
  node_discover["Future discovery<br/>[page.tsx]"]
  node_world["Life planning views"]
  node_webapi["Frontend API routes"]
end

subgraph group_api["API and identity"]
  node_backend["HTTP API<br/>[Program.cs]"]
  node_auth["Authentication<br/>[AuthService.cs]"]
end

subgraph group_planning["Planning services"]
  node_dream["Future discovery service"]
  node_future["Future scenarios"]
  node_goals["Goal planning<br/>[GoalService.cs]"]
  node_daily["Daily action planning"]
  node_adaptive["Adaptive planning"]
  node_reflection["Reflection"]
  node_journey["Journey calendar"]
  node_conversation["LUMA conversation"]
  node_agent["Tool-using agent<br/>[AgentService.cs]"]
end

subgraph group_platform["AI and persistence"]
  node_ai["AI service contract<br/>[IAIService.cs]"]
  node_gemini["Gemini integration<br/>[GeminiAIService.cs]"]
  node_fallback["AI fallback"]
  node_developmentai["Development AI"]
  node_store[("Application database<br/>[LumaDbContext.cs]")]
  node_entities["Life-plan records<br/>[Entities]"]
end

node_user(("LUMA user"))
node_geminisvc{{"Gemini API"}}

node_user -->|"uses"| node_web
node_web -->|"starts discovery"| node_discover
node_web -->|"explores plans"| node_world
node_discover -.->|"submits vision"| node_webapi
node_world -.->|"requests planning"| node_webapi
node_webapi -.->|"calls API"| node_backend
node_backend -->|"registers and logs in"| node_auth
node_auth -->|"reads and saves users"| node_store
node_backend -->|"creates future profile"| node_dream
node_dream -->|"analyzes vision"| node_ai
node_dream -->|"loads and saves dream"| node_store
node_backend -->|"requests goals"| node_goals
node_backend -.->|"requests daily path"| node_daily
node_backend -->|"applies plan change"| node_adaptive
node_backend -->|"creates reflection"| node_reflection
node_backend -.->|"requests calendar"| node_journey
node_backend -.->|"starts conversation"| node_conversation
node_backend -->|"executes agent request"| node_agent
node_agent -.->|"uses AI"| node_ai
node_ai -->|"implemented by"| node_gemini
node_ai -->|"served with fallback"| node_fallback
node_fallback -->|"tries primary"| node_gemini
node_fallback -->|"falls back to"| node_developmentai
node_gemini -->|"sends generation requests"| node_geminisvc
node_store -->|"maps records"| node_entities
node_journey -->|"reads snapshots"| node_store
node_dream -.->|"continues future work"| node_future
node_future -->|"informs goals"| node_goals
node_goals -->|"guides actions"| node_daily
node_daily -->|"prompts reflection"| node_reflection
node_reflection -->|"informs future"| node_future

click node_web "https://github.com/elifasik1/luma/tree/main/luma-frontend/src/app"
click node_discover "https://github.com/elifasik1/luma/blob/main/luma-frontend/src/app/discover/page.tsx"
click node_world "https://github.com/elifasik1/luma/tree/main/luma-frontend/src/components/world"
click node_webapi "https://github.com/elifasik1/luma/tree/main/luma-frontend/src/app/api"
click node_backend "https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Api/Program.cs"
click node_auth "https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Api/Auth/AuthService.cs"
click node_dream "https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/DreamAnalysisService.cs"
click node_future "https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/FutureScenarioService.cs"
click node_goals "https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/GoalService.cs"
click node_daily "https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/DailyPathService.cs"
click node_adaptive "https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/AdaptiveDailyPlanCapability.cs"
click node_reflection "https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/ReflectionService.cs"
click node_journey "https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Infrastructure/Persistence/JourneyCalendarQuery.cs"
click node_conversation "https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/TalkToLumaService.cs"
click node_agent "https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/AgentService.cs"
click node_ai "https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/AI/IAIService.cs"
click node_gemini "https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Infrastructure/AI/GeminiAIService.cs"
click node_fallback "https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Infrastructure/AI/FallbackAIService.cs"
click node_developmentai "https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/AI/DevelopmentAIService.cs"
click node_store "https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Infrastructure/Persistence/LumaDbContext.cs"
click node_entities "https://github.com/elifasik1/luma/tree/main/LUMA/Luma.Domain/Entities"

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,node_discover,node_world,node_webapi,node_user toneBlue
class node_backend,node_auth toneAmber
class node_dream,node_future,node_goals,node_daily,node_adaptive,node_reflection,node_journey,node_conversation,node_agent,node_geminisvc toneMint
class node_ai,node_gemini,node_fallback,node_developmentai,node_store,node_entities toneRose
```

## Components

### User experience

- [Next.js experience](https://github.com/elifasik1/luma/tree/main/luma-frontend/src/app): `luma-frontend/src/app`
- [Future discovery](https://github.com/elifasik1/luma/blob/main/luma-frontend/src/app/discover/page.tsx): `luma-frontend/src/app/discover/page.tsx`
- [Life planning views](https://github.com/elifasik1/luma/tree/main/luma-frontend/src/components/world): `luma-frontend/src/components/world`
- [Frontend API routes](https://github.com/elifasik1/luma/tree/main/luma-frontend/src/app/api): `luma-frontend/src/app/api`

### API and identity

- [HTTP API](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Api/Program.cs): `LUMA/Luma.Api/Program.cs`
- [Authentication](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Api/Auth/AuthService.cs): `LUMA/Luma.Api/Auth/AuthService.cs`

### Planning services

- [Future discovery service](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/DreamAnalysisService.cs): `LUMA/Luma.Application/Services/DreamAnalysisService.cs`
- [Future scenarios](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/FutureScenarioService.cs): `LUMA/Luma.Application/Services/FutureScenarioService.cs`
- [Goal planning](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/GoalService.cs): `LUMA/Luma.Application/Services/GoalService.cs`
- [Daily action planning](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/DailyPathService.cs): `LUMA/Luma.Application/Services/DailyPathService.cs`
- [Adaptive planning](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/AdaptiveDailyPlanCapability.cs): `LUMA/Luma.Application/Services/AdaptiveDailyPlanCapability.cs`
- [Reflection](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/ReflectionService.cs): `LUMA/Luma.Application/Services/ReflectionService.cs`
- [Journey calendar](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Infrastructure/Persistence/JourneyCalendarQuery.cs): `LUMA/Luma.Infrastructure/Persistence/JourneyCalendarQuery.cs`
- [LUMA conversation](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/TalkToLumaService.cs): `LUMA/Luma.Application/Services/TalkToLumaService.cs`
- [Tool-using agent](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/Services/AgentService.cs): `LUMA/Luma.Application/Services/AgentService.cs`

### AI and persistence

- [AI service contract](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/AI/IAIService.cs): `LUMA/Luma.Application/AI/IAIService.cs`
- [Gemini integration](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Infrastructure/AI/GeminiAIService.cs): `LUMA/Luma.Infrastructure/AI/GeminiAIService.cs`
- [AI fallback](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Infrastructure/AI/FallbackAIService.cs): `LUMA/Luma.Infrastructure/AI/FallbackAIService.cs`
- [Development AI](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Application/AI/DevelopmentAIService.cs): `LUMA/Luma.Application/AI/DevelopmentAIService.cs`
- [Application database](https://github.com/elifasik1/luma/blob/main/LUMA/Luma.Infrastructure/Persistence/LumaDbContext.cs): `LUMA/Luma.Infrastructure/Persistence/LumaDbContext.cs`
- [Life-plan records](https://github.com/elifasik1/luma/tree/main/LUMA/Luma.Domain/Entities): `LUMA/Luma.Domain/Entities`

### Other components

- **LUMA user**
- **Gemini API**

## Connections

- LUMA user → Next.js experience: uses (evidence: `README.md`)
- Next.js experience → Future discovery: starts discovery (evidence: `README.md`)
- Next.js experience → Life planning views: explores plans (evidence: `README.md`)
- Future discovery → Frontend API routes: submits vision
- Life planning views → Frontend API routes: requests planning
- Frontend API routes → HTTP API: calls API
- HTTP API → Authentication: registers and logs in (evidence: `LUMA/Luma.Api/Program.cs`)
- Authentication → Application database: reads and saves users (evidence: `LUMA/Luma.Api/Auth/AuthService.cs`)
- HTTP API → Future discovery service: creates future profile (evidence: `LUMA/Luma.Api/Program.cs`)
- Future discovery service → AI service contract: analyzes vision (evidence: `LUMA/Luma.Application/Services/DreamAnalysisService.cs`)
- Future discovery service → Application database: loads and saves dream (evidence: `LUMA/Luma.Application/Services/DreamAnalysisService.cs`)
- HTTP API → Goal planning: requests goals (evidence: `LUMA/Luma.Api/Program.cs`)
- HTTP API → Daily action planning: requests daily path
- HTTP API → Adaptive planning: applies plan change (evidence: `LUMA/Luma.Api/Program.cs`)
- HTTP API → Reflection: creates reflection (evidence: `LUMA/Luma.Api/Program.cs`)
- HTTP API → Journey calendar: requests calendar (evidence: `LUMA/Luma.Api/Program.cs`)
- HTTP API → LUMA conversation: starts conversation
- HTTP API → Tool-using agent: executes agent request (evidence: `LUMA/Luma.Api/Program.cs`)
- Tool-using agent → AI service contract: uses AI
- AI service contract → Gemini integration: implemented by (evidence: `LUMA/Luma.Infrastructure/AI/GeminiAIService.cs`)
- AI service contract → AI fallback: served with fallback (evidence: `LUMA/Luma.Infrastructure/AI/FallbackAIService.cs`)
- AI fallback → Gemini integration: tries primary (evidence: `LUMA/Luma.Infrastructure/AI/FallbackAIService.cs`)
- AI fallback → Development AI: falls back to (evidence: `LUMA/Luma.Infrastructure/AI/FallbackAIService.cs`)
- Gemini integration → Gemini API: sends generation requests (evidence: `LUMA/Luma.Infrastructure/AI/GeminiAIService.cs`)
- Application database → Life-plan records: maps records (evidence: `LUMA/Luma.Infrastructure/Persistence/LumaDbContext.cs`)
- Journey calendar → Application database: reads snapshots (evidence: `LUMA/Luma.Infrastructure/Persistence/JourneyCalendarQuery.cs`)
- Future discovery service → Future scenarios: continues future work
- Future scenarios → Goal planning: informs goals (evidence: `README.md`)
- Goal planning → Daily action planning: guides actions (evidence: `README.md`)
- Daily action planning → Reflection: prompts reflection (evidence: `README.md`)
- Reflection → Future scenarios: informs future (evidence: `README.md`)
