# devamaresh/skinsenseai architecture

> Architecture diagram of the GitHub repository devamaresh/skinsenseai, 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/devamaresh/skinsenseai
- Repository: https://github.com/devamaresh/skinsenseai

## Overview

SkinSenseAI is a mobile skincare companion backed by a FastAPI service. Users authenticate, complete a skin assessment, analyze products, and then review results; chat and skin memory support ongoing personalized guidance. The graph includes documented product capabilities whose detailed wiring is not shown in the sampled source, but omits uncertain links. In particular, excerpts do not show every screen-to-API call or router-to-storage interaction.

Main entry points: [`SkinSenseAI/App.js`](https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/App.js) (App navigation), [`SkinSenseAI/src/services/api.js`](https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/services/api.js) (API client), [`fastapi-backend/main.py`](https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/main.py) (FastAPI app), [`SkinSenseAI/src/contexts/AuthContext.js`](https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/contexts/AuthContext.js) (Auth state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_app["App navigation<br/>[App.js]"]
  node_auth_screens["Sign-in screens<br/>[LoginScreen.js]"]
  node_assessment["Skin assessment"]
  node_product_analysis["Product analysis"]
  node_analysis_result["Analysis results"]
  node_chat_screens["Chat screens<br/>[ChatScreen.js]"]
  node_memory_screen["Skin memory screen"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_identity["Identity and profile"]
  node_auth_context["Auth state<br/>[AuthContext.js]"]
  node_auth_guard["Route guards<br/>[AuthGuard.js]"]
  node_google_auth["Google sign-in<br/>[googleAuth.js]"]
  node_auth_router["Auth routes<br/>[auth.py]"]
end

subgraph group_guidance["Skincare guidance"]
  node_skin_router["Skin routes<br/>[skin.py]"]
  node_chat_router["Chat routes<br/>[chat.py]"]
  node_gemini["Product AI service<br/>[gemini.py]"]
  node_gemini_chat["Chat AI service<br/>[gemini_chat.py]"]
end

subgraph group_memory["Skin memory"]
  node_memory_context["Memory state"]
  node_memory_service["Memory API service"]
  node_memory_router["Memory routes<br/>[skin_memory.py]"]
end

subgraph group_backend["Backend foundation"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_db_config["Database sessions<br/>[database.py]"]
  node_database[("Application database")]
end

node_user(("User"))
node_firebase["Firebase Auth"]
node_gemini_external["Google Gemini"]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_auth_screens
node_app -->|"routes to"| node_assessment
node_app -->|"routes to"| node_product_analysis
node_app -->|"routes to"| node_analysis_result
node_app -->|"routes to"| node_chat_screens
node_app -->|"routes to"| node_memory_screen
node_app -->|"provides state"| node_auth_context
node_app -->|"protects routes"| node_auth_guard
node_auth_screens -->|"authenticates"| node_auth_context
node_auth_context -->|"calls"| node_api_client
node_auth_context -->|"signs out"| node_google_auth
node_google_auth -->|"authenticates with"| node_firebase
node_product_analysis -->|"requests analysis"| node_api_client
node_assessment -->|"submits profile"| node_api_client
node_chat_screens -->|"sends messages"| node_api_client
node_memory_screen -->|"reads and edits"| node_memory_context
node_memory_context -->|"requests memory"| node_memory_service
node_memory_service -->|"uses"| node_api_client
node_api_client -->|"HTTP requests"| node_api_app
node_api_app -->|"dispatches"| node_auth_router
node_api_app -->|"dispatches"| node_skin_router
node_api_app -->|"dispatches"| node_chat_router
node_api_app -->|"dispatches"| node_memory_router
node_auth_router -->|"gets sessions"| node_db_config
node_db_config -->|"connects"| node_database
node_skin_router -->|"analyzes products"| node_gemini
node_chat_router -->|"generates replies"| node_gemini_chat
node_gemini -->|"requests inference"| node_gemini_external
node_gemini_chat -->|"requests inference"| node_gemini_external

click node_app "https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/App.js"
click node_auth_screens "https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/screens/LoginScreen.js"
click node_assessment "https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/screens/SkinTypeQuestionsScreen.js"
click node_product_analysis "https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/screens/ProductAnalysisScreen.js"
click node_analysis_result "https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/screens/AnalysisResultScreen.js"
click node_chat_screens "https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/screens/ChatScreen.js"
click node_memory_screen "https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/screens/SkinMemoryScreen.js"
click node_auth_context "https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/contexts/AuthContext.js"
click node_auth_guard "https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/components/AuthGuard.js"
click node_google_auth "https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/services/googleAuth.js"
click node_api_client "https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/services/api.js"
click node_memory_context "https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/contexts/SkinMemoryContext.js"
click node_memory_service "https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/services/skinMemoryService.js"
click node_api_app "https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/main.py"
click node_auth_router "https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/app/routers/auth.py"
click node_skin_router "https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/app/routers/skin.py"
click node_chat_router "https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/app/routers/chat.py"
click node_memory_router "https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/app/routers/skin_memory.py"
click node_gemini "https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/app/services/gemini.py"
click node_gemini_chat "https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/app/services/gemini_chat.py"
click node_db_config "https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/app/core/database.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_auth_screens,node_assessment,node_product_analysis,node_analysis_result,node_chat_screens,node_memory_screen,node_api_client,node_user toneBlue
class node_auth_context,node_auth_guard,node_google_auth,node_auth_router toneAmber
class node_skin_router,node_chat_router,node_gemini,node_gemini_chat toneMint
class node_memory_context,node_memory_service,node_memory_router toneRose
class node_api_app,node_db_config,node_database,node_firebase,node_gemini_external toneIndigo
```

## Components

### Mobile app

- [App navigation](https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/App.js): `SkinSenseAI/App.js`
- [Sign-in screens](https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/screens/LoginScreen.js): `SkinSenseAI/src/screens/LoginScreen.js`
- [Skin assessment](https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/screens/SkinTypeQuestionsScreen.js): `SkinSenseAI/src/screens/SkinTypeQuestionsScreen.js`
- [Product analysis](https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/screens/ProductAnalysisScreen.js): `SkinSenseAI/src/screens/ProductAnalysisScreen.js`
- [Analysis results](https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/screens/AnalysisResultScreen.js): `SkinSenseAI/src/screens/AnalysisResultScreen.js`
- [Chat screens](https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/screens/ChatScreen.js): `SkinSenseAI/src/screens/ChatScreen.js`
- [Skin memory screen](https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/screens/SkinMemoryScreen.js): `SkinSenseAI/src/screens/SkinMemoryScreen.js`
- [API client](https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/services/api.js): `SkinSenseAI/src/services/api.js`

### Identity and profile

- [Auth state](https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/contexts/AuthContext.js): `SkinSenseAI/src/contexts/AuthContext.js`
- [Route guards](https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/components/AuthGuard.js): `SkinSenseAI/src/components/AuthGuard.js`
- [Google sign-in](https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/services/googleAuth.js): `SkinSenseAI/src/services/googleAuth.js`
- [Auth routes](https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/app/routers/auth.py): `fastapi-backend/app/routers/auth.py`

### Skincare guidance

- [Skin routes](https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/app/routers/skin.py): `fastapi-backend/app/routers/skin.py`
- [Chat routes](https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/app/routers/chat.py): `fastapi-backend/app/routers/chat.py`
- [Product AI service](https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/app/services/gemini.py): `fastapi-backend/app/services/gemini.py`
- [Chat AI service](https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/app/services/gemini_chat.py): `fastapi-backend/app/services/gemini_chat.py`

### Skin memory

- [Memory state](https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/contexts/SkinMemoryContext.js): `SkinSenseAI/src/contexts/SkinMemoryContext.js`
- [Memory API service](https://github.com/devamaresh/skinsenseai/blob/master/SkinSenseAI/src/services/skinMemoryService.js): `SkinSenseAI/src/services/skinMemoryService.js`
- [Memory routes](https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/app/routers/skin_memory.py): `fastapi-backend/app/routers/skin_memory.py`

### Backend foundation

- [FastAPI app](https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/main.py): `fastapi-backend/main.py`
- [Database sessions](https://github.com/devamaresh/skinsenseai/blob/master/fastapi-backend/app/core/database.py): `fastapi-backend/app/core/database.py`
- **Application database**

### Other components

- **User**
- **Firebase Auth**
- **Google Gemini**

## Connections

- User → App navigation: uses
- App navigation → Sign-in screens: routes to
- App navigation → Skin assessment: routes to
- App navigation → Product analysis: routes to
- App navigation → Analysis results: routes to
- App navigation → Chat screens: routes to
- App navigation → Skin memory screen: routes to
- App navigation → Auth state: provides state
- App navigation → Route guards: protects routes
- Sign-in screens → Auth state: authenticates
- Auth state → API client: calls
- Auth state → Google sign-in: signs out
- Google sign-in → Firebase Auth: authenticates with
- Product analysis → API client: requests analysis
- Skin assessment → API client: submits profile
- Chat screens → API client: sends messages
- Skin memory screen → Memory state: reads and edits
- Memory state → Memory API service: requests memory
- Memory API service → API client: uses
- API client → FastAPI app: HTTP requests
- FastAPI app → Auth routes: dispatches
- FastAPI app → Skin routes: dispatches
- FastAPI app → Chat routes: dispatches
- FastAPI app → Memory routes: dispatches
- Auth routes → Database sessions: gets sessions
- Database sessions → Application database: connects
- Skin routes → Product AI service: analyzes products
- Chat routes → Chat AI service: generates replies
- Product AI service → Google Gemini: requests inference
- Chat AI service → Google Gemini: requests inference
