# vn6295337/justask architecture

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

- Interactive diagram: https://gitdiagram.com/vn6295337/justask
- Repository: https://github.com/vn6295337/justask

## Overview

JustAsk is a privacy-focused AI assistant backed by a query API, model-discovery and ranking data, and an analytics dashboard. The user workflow is to submit a question in the mobile app, have the API classify it and try ranked models with failover, then display the answer; the app also supports local history, caching, and offline queuing. The graph combines explicit README architecture with shown source calls. Registry internals and several app/API modules were not sampled, so their detailed wiring is not asserted.

Main entry points: [`justask/app/App.js`](https://github.com/vn6295337/justask/blob/main/justask/app/App.js) (Mobile app shell), [`justask/app/src/services/SyncManager.js`](https://github.com/vn6295337/justask/blob/main/justask/app/src/services/SyncManager.js) (Offline sync), [`justask-registry/src/main.py`](https://github.com/vn6295337/justask/blob/main/justask-registry/src/main.py) (Registry runner), [`justask-dashboard/src/pages/Analytics.tsx`](https://github.com/vn6295337/justask/blob/main/justask-dashboard/src/pages/Analytics.tsx) (Analytics page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_app["Mobile app shell<br/>[App.js]"]
  node_home["Chat screen<br/>[HomeScreen.js]"]
  node_api_client["API client<br/>[APIClient.js]"]
  node_cache["Response cache<br/>[CacheManager.js]"]
  node_local_db[("Local database<br/>[Database.js]")]
  node_sync["Offline sync<br/>[SyncManager.js]"]
  node_query_state["Chat state<br/>[querySlice.js]"]
end

subgraph group_api["Query API"]
  node_query_route["Query routes<br/>[query.js]"]
  node_classifier["Query classifier<br/>[classifier.js]"]
  node_failover["Ranked failover<br/>[failover.js]"]
  node_provider_calls["Provider adapters"]
  node_api["Query API<br/>[index.js]"]
end

subgraph group_models["Model data"]
  node_supabase[("Supabase model data")]
  node_registry_entry["Registry runner<br/>[main.py]"]
  node_google_pipeline["Google pipeline"]
  node_groq_pipeline["Groq pipeline"]
  node_openrouter_pipeline["OpenRouter pipeline"]
  node_ranking_builder["Ranking builder"]
end

subgraph group_dashboard["Analytics dashboard"]
  node_analytics_page["Analytics page<br/>[Analytics.tsx]"]
  node_model_visuals["Model visualizations"]
  node_model_counts["Model count graph"]
end

node_user(("User"))
node_llm_providers{{"AI providers"}}

node_user -->|"asks question"| node_app
node_app -->|"shows chat"| node_home
node_home -.->|"submits query"| node_api_client
node_app -->|"sends query"| node_api
node_api -.->|"handles request"| node_query_route
node_query_route -->|"classifies query"| node_classifier
node_query_route -->|"executes fallback"| node_failover
node_failover -->|"tries models"| node_llm_providers
node_provider_calls -.->|"calls providers"| node_llm_providers
node_api -->|"reads ranking"| node_supabase
node_app -.->|"checks cache"| node_cache
node_cache -->|"reads and writes"| node_local_db
node_app -->|"stores history"| node_local_db
node_sync -->|"reads queue"| node_local_db
node_sync -->|"sends batch"| node_api_client
node_sync -->|"updates messages"| node_query_state
node_registry_entry -.->|"runs pipeline"| node_google_pipeline
node_registry_entry -.->|"runs pipeline"| node_groq_pipeline
node_registry_entry -.->|"runs pipeline"| node_openrouter_pipeline
node_google_pipeline -->|"publishes models"| node_supabase
node_groq_pipeline -->|"publishes models"| node_supabase
node_openrouter_pipeline -->|"publishes models"| node_supabase
node_ranking_builder -->|"writes ranking"| node_supabase
node_analytics_page -.->|"renders models"| node_model_visuals
node_analytics_page -.->|"renders counts"| node_model_counts
node_analytics_page -->|"visualizes data"| node_supabase

click node_app "https://github.com/vn6295337/justask/blob/main/justask/app/App.js"
click node_home "https://github.com/vn6295337/justask/blob/main/justask/app/src/screens/HomeScreen.js"
click node_api_client "https://github.com/vn6295337/justask/blob/main/justask/app/src/services/APIClient.js"
click node_cache "https://github.com/vn6295337/justask/blob/main/justask/app/src/services/CacheManager.js"
click node_local_db "https://github.com/vn6295337/justask/blob/main/justask/app/src/services/Database.js"
click node_sync "https://github.com/vn6295337/justask/blob/main/justask/app/src/services/SyncManager.js"
click node_query_state "https://github.com/vn6295337/justask/blob/main/justask/app/src/store/querySlice.js"
click node_query_route "https://github.com/vn6295337/justask/blob/main/justask/api/src/routes/query.js"
click node_classifier "https://github.com/vn6295337/justask/blob/main/justask/api/src/classification/classifier.js"
click node_failover "https://github.com/vn6295337/justask/blob/main/justask/api/src/failover/failover.js"
click node_provider_calls "https://github.com/vn6295337/justask/tree/main/justask/api/src/providers"
click node_registry_entry "https://github.com/vn6295337/justask/blob/main/justask-registry/src/main.py"
click node_google_pipeline "https://github.com/vn6295337/justask/tree/main/justask-registry/src/pipelines/google"
click node_groq_pipeline "https://github.com/vn6295337/justask/tree/main/justask-registry/src/pipelines/groq"
click node_openrouter_pipeline "https://github.com/vn6295337/justask/tree/main/justask-registry/src/pipelines/openrouter"
click node_ranking_builder "https://github.com/vn6295337/justask/blob/main/justask-router/selector-service/scripts/db/populate_model_selection_score.js"
click node_analytics_page "https://github.com/vn6295337/justask/blob/main/justask-dashboard/src/pages/Analytics.tsx"
click node_model_visuals "https://github.com/vn6295337/justask/blob/main/justask-dashboard/src/components/AiModelsVisualization.tsx"
click node_model_counts "https://github.com/vn6295337/justask/blob/main/justask-dashboard/src/components/ModelCountLineGraph.tsx"
click node_api "https://github.com/vn6295337/justask/blob/main/justask/api/src/index.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,node_home,node_api_client,node_cache,node_local_db,node_sync,node_query_state,node_user toneBlue
class node_query_route,node_classifier,node_failover,node_provider_calls,node_api toneAmber
class node_supabase,node_registry_entry,node_google_pipeline,node_groq_pipeline,node_openrouter_pipeline,node_ranking_builder toneMint
class node_analytics_page,node_model_visuals,node_model_counts toneRose
class node_llm_providers toneIndigo
```

## Components

### Mobile app

- [Mobile app shell](https://github.com/vn6295337/justask/blob/main/justask/app/App.js): `justask/app/App.js`
- [Chat screen](https://github.com/vn6295337/justask/blob/main/justask/app/src/screens/HomeScreen.js): `justask/app/src/screens/HomeScreen.js`
- [API client](https://github.com/vn6295337/justask/blob/main/justask/app/src/services/APIClient.js): `justask/app/src/services/APIClient.js`
- [Response cache](https://github.com/vn6295337/justask/blob/main/justask/app/src/services/CacheManager.js): `justask/app/src/services/CacheManager.js`
- [Local database](https://github.com/vn6295337/justask/blob/main/justask/app/src/services/Database.js): `justask/app/src/services/Database.js`
- [Offline sync](https://github.com/vn6295337/justask/blob/main/justask/app/src/services/SyncManager.js): `justask/app/src/services/SyncManager.js`
- [Chat state](https://github.com/vn6295337/justask/blob/main/justask/app/src/store/querySlice.js): `justask/app/src/store/querySlice.js`

### Query API

- [Query routes](https://github.com/vn6295337/justask/blob/main/justask/api/src/routes/query.js): `justask/api/src/routes/query.js`
- [Query classifier](https://github.com/vn6295337/justask/blob/main/justask/api/src/classification/classifier.js): `justask/api/src/classification/classifier.js`
- [Ranked failover](https://github.com/vn6295337/justask/blob/main/justask/api/src/failover/failover.js): `justask/api/src/failover/failover.js`
- [Provider adapters](https://github.com/vn6295337/justask/tree/main/justask/api/src/providers): `justask/api/src/providers`
- [Query API](https://github.com/vn6295337/justask/blob/main/justask/api/src/index.js): `justask/api/src/index.js`

### Model data

- **Supabase model data**
- [Registry runner](https://github.com/vn6295337/justask/blob/main/justask-registry/src/main.py): `justask-registry/src/main.py`
- [Google pipeline](https://github.com/vn6295337/justask/tree/main/justask-registry/src/pipelines/google): `justask-registry/src/pipelines/google`
- [Groq pipeline](https://github.com/vn6295337/justask/tree/main/justask-registry/src/pipelines/groq): `justask-registry/src/pipelines/groq`
- [OpenRouter pipeline](https://github.com/vn6295337/justask/tree/main/justask-registry/src/pipelines/openrouter): `justask-registry/src/pipelines/openrouter`
- [Ranking builder](https://github.com/vn6295337/justask/blob/main/justask-router/selector-service/scripts/db/populate_model_selection_score.js): `justask-router/selector-service/scripts/db/populate_model_selection_score.js`

### Analytics dashboard

- [Analytics page](https://github.com/vn6295337/justask/blob/main/justask-dashboard/src/pages/Analytics.tsx): `justask-dashboard/src/pages/Analytics.tsx`
- [Model visualizations](https://github.com/vn6295337/justask/blob/main/justask-dashboard/src/components/AiModelsVisualization.tsx): `justask-dashboard/src/components/AiModelsVisualization.tsx`
- [Model count graph](https://github.com/vn6295337/justask/blob/main/justask-dashboard/src/components/ModelCountLineGraph.tsx): `justask-dashboard/src/components/ModelCountLineGraph.tsx`

### Other components

- **User**
- **AI providers**

## Connections

- User → Mobile app shell: asks question (evidence: `README.md`)
- Mobile app shell → Chat screen: shows chat (evidence: `justask/app/App.js`)
- Chat screen → API client: submits query
- Mobile app shell → Query API: sends query (evidence: `README.md`)
- Query API → Query routes: handles request
- Query routes → Query classifier: classifies query (evidence: `justask/api/src/routes/query.js`)
- Query routes → Ranked failover: executes fallback (evidence: `justask/api/src/routes/query.js`)
- Ranked failover → AI providers: tries models (evidence: `README.md`)
- Provider adapters → AI providers: calls providers
- Query API → Supabase model data: reads ranking (evidence: `README.md`)
- Mobile app shell → Response cache: checks cache
- Response cache → Local database: reads and writes (evidence: `justask/app/src/services/CacheManager.js`)
- Mobile app shell → Local database: stores history (evidence: `README.md`)
- Offline sync → Local database: reads queue (evidence: `justask/app/src/services/SyncManager.js`)
- Offline sync → API client: sends batch (evidence: `justask/app/src/services/SyncManager.js`)
- Offline sync → Chat state: updates messages (evidence: `justask/app/src/services/SyncManager.js`)
- Registry runner → Google pipeline: runs pipeline
- Registry runner → Groq pipeline: runs pipeline
- Registry runner → OpenRouter pipeline: runs pipeline
- Google pipeline → Supabase model data: publishes models (evidence: `README.md`)
- Groq pipeline → Supabase model data: publishes models (evidence: `README.md`)
- OpenRouter pipeline → Supabase model data: publishes models (evidence: `README.md`)
- Ranking builder → Supabase model data: writes ranking (evidence: `README.md`)
- Analytics page → Model visualizations: renders models
- Analytics page → Model count graph: renders counts
- Analytics page → Supabase model data: visualizes data (evidence: `README.md`)
