# lokesh-81/lumora-ai architecture

> Architecture diagram of the GitHub repository lokesh-81/lumora-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lokesh-81/lumora-ai
- Repository: https://github.com/lokesh-81/lumora-ai

## Overview

Lumora is a market-research and trading-assistance web application. A typical workflow begins with a user searching for an instrument, then viewing market data and requesting AI analysis or research. Separate capabilities cover chat, news and market summaries, options data, trade planning, and authenticated personal workspaces. Sampled routes confirm several API-to-library calls; the README gives no additional product detail, and unsampled implementations are represented without speculative internal wiring.

Main entry points: [`lib/ai/provider.ts`](https://github.com/lokesh-81/lumora-ai/blob/main/lib/ai/provider.ts) (AI provider), [`app/api/chat/route.ts`](https://github.com/lokesh-81/lumora-ai/blob/main/app/api/chat/route.ts) (AI chat), [`lib/db`](https://github.com/lokesh-81/lumora-ai/tree/main/lib/db) (Application database), [`app/api/search/route.ts`](https://github.com/lokesh-81/lumora-ai/blob/main/app/api/search/route.ts) (Instrument search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_dashboard["Market dashboard"]
end

subgraph group_intelligence["Market intelligence"]
  node_search["Instrument search<br/>[route.ts]"]
  node_instrument["Instrument catalog<br/>[instrument.ts]"]
  node_market["Market data<br/>[market.ts]"]
  node_analysis["AI analysis API<br/>[route.ts]"]
  node_context["Instrument context<br/>[context.ts]"]
  node_research["Investment research<br/>[route.ts]"]
  node_market_summary["Market summary<br/>[route.ts]"]
  node_news["News sentiment<br/>[route.ts]"]
  node_ai["AI provider<br/>[provider.ts]"]
  node_chat["AI chat<br/>[route.ts]"]
end

subgraph group_derivatives["Options and derivatives"]
  node_options_api["Options API<br/>[route.ts]"]
  node_derivative_manager["Provider manager<br/>[manager.ts]"]
  node_broker_providers["Broker providers"]
  node_trade_planner["Trade planner<br/>[route.ts]"]
end

subgraph group_workspace["Personal workspace"]
  node_workspace["Workspace actions"]
  node_notifications["Notifications<br/>[notifications.ts]"]
end

subgraph group_platform["Platform services"]
  node_auth_api["Authentication API<br/>[route.ts]"]
  node_auth_service["Authentication service<br/>[auth.ts]"]
  node_database[("Application database")]
end

node_investor(("Investor"))
node_ai_service{{"AI model service"}}

node_investor -->|"uses"| node_dashboard
node_dashboard -.->|"searches"| node_search
node_search -->|"parses symbols"| node_instrument
node_search -->|"searches online"| node_market
node_investor -->|"requests analysis"| node_analysis
node_analysis -->|"builds context"| node_context
node_analysis -->|"generates analysis"| node_ai
node_investor -->|"requests research"| node_research
node_research -->|"builds context"| node_context
node_research -->|"generates research"| node_ai
node_investor -->|"views summary"| node_market_summary
node_market_summary -->|"loads quotes"| node_market
node_market_summary -->|"generates summary"| node_ai
node_investor -->|"views news"| node_news
node_news -->|"analyzes sentiment"| node_ai
node_investor -->|"chats"| node_chat
node_chat -->|"checks session"| node_auth_service
node_chat -->|"stores conversations"| node_database
node_chat -->|"builds context"| node_context
node_chat -->|"streams replies"| node_ai
node_ai -.->|"calls model"| node_ai_service
node_investor -->|"requests options"| node_options_api
node_derivative_manager -->|"queries providers"| node_broker_providers
node_investor -->|"submits plan"| node_trade_planner
node_trade_planner -->|"generates assessment"| node_ai
node_investor -->|"signs in"| node_auth_api
node_auth_api -->|"forwards auth"| node_auth_service
node_auth_api -->|"reads user records"| node_database
node_investor -.->|"manages workspace"| node_workspace
node_workspace -.->|"persists workspace"| node_database
node_notifications -.->|"uses stored data"| node_database

click node_dashboard "https://github.com/lokesh-81/lumora-ai/blob/main/app/(dashboard)/dashboard/dashboard-client.tsx"
click node_search "https://github.com/lokesh-81/lumora-ai/blob/main/app/api/search/route.ts"
click node_instrument "https://github.com/lokesh-81/lumora-ai/blob/main/lib/instrument.ts"
click node_market "https://github.com/lokesh-81/lumora-ai/blob/main/lib/market.ts"
click node_analysis "https://github.com/lokesh-81/lumora-ai/blob/main/app/api/analyze/route.ts"
click node_context "https://github.com/lokesh-81/lumora-ai/blob/main/lib/context.ts"
click node_research "https://github.com/lokesh-81/lumora-ai/blob/main/app/api/research/route.ts"
click node_market_summary "https://github.com/lokesh-81/lumora-ai/blob/main/app/api/market-summary/route.ts"
click node_news "https://github.com/lokesh-81/lumora-ai/blob/main/app/api/news/route.ts"
click node_ai "https://github.com/lokesh-81/lumora-ai/blob/main/lib/ai/provider.ts"
click node_options_api "https://github.com/lokesh-81/lumora-ai/blob/main/app/api/options/route.ts"
click node_derivative_manager "https://github.com/lokesh-81/lumora-ai/blob/main/lib/derivatives/manager.ts"
click node_broker_providers "https://github.com/lokesh-81/lumora-ai/tree/main/lib/derivatives/providers"
click node_trade_planner "https://github.com/lokesh-81/lumora-ai/blob/main/app/api/trade-planner/route.ts"
click node_chat "https://github.com/lokesh-81/lumora-ai/blob/main/app/api/chat/route.ts"
click node_auth_api "https://github.com/lokesh-81/lumora-ai/blob/main/app/api/auth/%5B...all%5D/route.ts"
click node_auth_service "https://github.com/lokesh-81/lumora-ai/blob/main/lib/auth.ts"
click node_workspace "https://github.com/lokesh-81/lumora-ai/tree/main/app/actions"
click node_notifications "https://github.com/lokesh-81/lumora-ai/blob/main/lib/notifications.ts"
click node_database "https://github.com/lokesh-81/lumora-ai/tree/main/lib/db"

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_dashboard toneBlue
class node_search,node_instrument,node_market,node_analysis,node_context,node_research,node_market_summary,node_news,node_ai,node_chat toneAmber
class node_options_api,node_derivative_manager,node_broker_providers,node_trade_planner toneMint
class node_workspace,node_notifications toneRose
class node_auth_api,node_auth_service,node_database,node_investor,node_ai_service toneIndigo
```

## Components

### User experience

- [Market dashboard](https://github.com/lokesh-81/lumora-ai/blob/main/app/(dashboard)/dashboard/dashboard-client.tsx): `app/(dashboard)/dashboard/dashboard-client.tsx`

### Market intelligence

- [Instrument search](https://github.com/lokesh-81/lumora-ai/blob/main/app/api/search/route.ts): `app/api/search/route.ts`
- [Instrument catalog](https://github.com/lokesh-81/lumora-ai/blob/main/lib/instrument.ts): `lib/instrument.ts`
- [Market data](https://github.com/lokesh-81/lumora-ai/blob/main/lib/market.ts): `lib/market.ts`
- [AI analysis API](https://github.com/lokesh-81/lumora-ai/blob/main/app/api/analyze/route.ts): `app/api/analyze/route.ts`
- [Instrument context](https://github.com/lokesh-81/lumora-ai/blob/main/lib/context.ts): `lib/context.ts`
- [Investment research](https://github.com/lokesh-81/lumora-ai/blob/main/app/api/research/route.ts): `app/api/research/route.ts`
- [Market summary](https://github.com/lokesh-81/lumora-ai/blob/main/app/api/market-summary/route.ts): `app/api/market-summary/route.ts`
- [News sentiment](https://github.com/lokesh-81/lumora-ai/blob/main/app/api/news/route.ts): `app/api/news/route.ts`
- [AI provider](https://github.com/lokesh-81/lumora-ai/blob/main/lib/ai/provider.ts): `lib/ai/provider.ts`
- [AI chat](https://github.com/lokesh-81/lumora-ai/blob/main/app/api/chat/route.ts): `app/api/chat/route.ts`

### Options and derivatives

- [Options API](https://github.com/lokesh-81/lumora-ai/blob/main/app/api/options/route.ts): `app/api/options/route.ts`
- [Provider manager](https://github.com/lokesh-81/lumora-ai/blob/main/lib/derivatives/manager.ts): `lib/derivatives/manager.ts`
- [Broker providers](https://github.com/lokesh-81/lumora-ai/tree/main/lib/derivatives/providers): `lib/derivatives/providers`
- [Trade planner](https://github.com/lokesh-81/lumora-ai/blob/main/app/api/trade-planner/route.ts): `app/api/trade-planner/route.ts`

### Personal workspace

- [Workspace actions](https://github.com/lokesh-81/lumora-ai/tree/main/app/actions): `app/actions`
- [Notifications](https://github.com/lokesh-81/lumora-ai/blob/main/lib/notifications.ts): `lib/notifications.ts`

### Platform services

- [Authentication API](https://github.com/lokesh-81/lumora-ai/blob/main/app/api/auth/%5B...all%5D/route.ts): `app/api/auth/[...all]/route.ts`
- [Authentication service](https://github.com/lokesh-81/lumora-ai/blob/main/lib/auth.ts): `lib/auth.ts`
- [Application database](https://github.com/lokesh-81/lumora-ai/tree/main/lib/db): `lib/db`

### Other components

- **Investor**
- **AI model service**

## Connections

- Investor → Market dashboard: uses
- Market dashboard → Instrument search: searches
- Instrument search → Instrument catalog: parses symbols
- Instrument search → Market data: searches online
- Investor → AI analysis API: requests analysis
- AI analysis API → Instrument context: builds context
- AI analysis API → AI provider: generates analysis
- Investor → Investment research: requests research
- Investment research → Instrument context: builds context
- Investment research → AI provider: generates research
- Investor → Market summary: views summary
- Market summary → Market data: loads quotes
- Market summary → AI provider: generates summary
- Investor → News sentiment: views news
- News sentiment → AI provider: analyzes sentiment
- Investor → AI chat: chats
- AI chat → Authentication service: checks session
- AI chat → Application database: stores conversations
- AI chat → Instrument context: builds context
- AI chat → AI provider: streams replies
- AI provider → AI model service: calls model
- Investor → Options API: requests options
- Provider manager → Broker providers: queries providers
- Investor → Trade planner: submits plan
- Trade planner → AI provider: generates assessment
- Investor → Authentication API: signs in
- Authentication API → Authentication service: forwards auth
- Authentication API → Application database: reads user records
- Investor → Workspace actions: manages workspace
- Workspace actions → Application database: persists workspace
- Notifications → Application database: uses stored data
