# thansiyaraja-2003/pocketsmart-ai architecture

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

- Interactive diagram: https://gitdiagram.com/thansiyaraja-2003/pocketsmart-ai
- Repository: https://github.com/thansiyaraja-2003/pocketsmart-ai

## Overview

PocketSmart AI is a FastAPI web app for generating AI-assisted home, party, and jewelry plans. Users submit planner forms; app.py prepares inputs, calls the corresponding recommendation function, and renders a results template. Jewelry planning can also pass an uploaded outfit image. The excerpts establish these routes and the service dependency, but do not show all service internals or template behavior; unsampled pages such as history and dashboard are represented only as rendered views.

Main entry points: [`app.py`](https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/app.py) (FastAPI routes), [`services/gemini_service.py`](https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/services/gemini_service.py) (Gemini recommendation service), [`templates/index.html`](https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/index.html) (Landing and account pages), [`templates/dashboard.html`](https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/dashboard.html) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_router["FastAPI routes<br/>[app.py]"]
  node_landing["Landing and account pages<br/>[index.html]"]
  node_dashboard["Dashboard<br/>[dashboard.html]"]
  node_history["History page<br/>[history.html]"]
  node_testimonials["Testimonials<br/>[testimonials.html]"]
end

subgraph group_planning["Planning workflows"]
  node_homeform["Home planner form<br/>[home_planner.html]"]
  node_homeplan["Home recommendations"]
  node_partyform["Party planner form<br/>[party_planner.html]"]
  node_partyplan["Party recommendations"]
  node_jewelryform["Jewelry planner form"]
  node_jewelryplan["Jewelry recommendations"]
end

subgraph group_ai["Recommendation engine"]
  node_gemini["Gemini recommendation service<br/>[gemini_service.py]"]
end

node_visitor(("Visitor"))
node_gemini_api{{"Google Gemini API"}}

node_visitor -->|"submits requests"| node_router
node_router -->|"renders pages"| node_landing
node_router -->|"renders dashboard"| node_dashboard
node_router -->|"renders history"| node_history
node_router -->|"renders testimonials"| node_testimonials
node_router -->|"renders form"| node_homeform
node_router -->|"renders results"| node_homeplan
node_router -->|"renders form"| node_partyform
node_router -->|"renders results"| node_partyplan
node_router -->|"renders form"| node_jewelryform
node_router -->|"renders results"| node_jewelryplan
node_router -->|"requests home plan"| node_gemini
node_router -->|"requests party plan"| node_gemini
node_router -->|"requests jewelry plan"| node_gemini
node_gemini -.->|"generates recommendations"| node_gemini_api

click node_router "https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/app.py"
click node_landing "https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/index.html"
click node_dashboard "https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/dashboard.html"
click node_history "https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/history.html"
click node_homeform "https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/home_planner.html"
click node_homeplan "https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/home_recommendations.html"
click node_partyform "https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/party_planner.html"
click node_partyplan "https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/party_recommendations.html"
click node_jewelryform "https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/jewelry_planner.html"
click node_jewelryplan "https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/jewelry_recommendations.html"
click node_testimonials "https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/testimonials.html"
click node_gemini "https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/services/gemini_service.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_router,node_landing,node_dashboard,node_history,node_testimonials toneBlue
class node_homeform,node_homeplan,node_partyform,node_partyplan,node_jewelryform,node_jewelryplan toneAmber
class node_gemini,node_gemini_api toneMint
class node_visitor toneIndigo
```

## Components

### Web interface

- [FastAPI routes](https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/app.py): `app.py`
- [Landing and account pages](https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/index.html): `templates/index.html`
- [Dashboard](https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/dashboard.html): `templates/dashboard.html`
- [History page](https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/history.html): `templates/history.html`
- [Testimonials](https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/testimonials.html): `templates/testimonials.html`

### Planning workflows

- [Home planner form](https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/home_planner.html): `templates/home_planner.html`
- [Home recommendations](https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/home_recommendations.html): `templates/home_recommendations.html`
- [Party planner form](https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/party_planner.html): `templates/party_planner.html`
- [Party recommendations](https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/party_recommendations.html): `templates/party_recommendations.html`
- [Jewelry planner form](https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/jewelry_planner.html): `templates/jewelry_planner.html`
- [Jewelry recommendations](https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/templates/jewelry_recommendations.html): `templates/jewelry_recommendations.html`

### Recommendation engine

- [Gemini recommendation service](https://github.com/thansiyaraja-2003/pocketsmart-ai/blob/main/services/gemini_service.py): `services/gemini_service.py`

### Other components

- **Visitor**
- **Google Gemini API**

## Connections

- Visitor → FastAPI routes: submits requests (evidence: `app.py`)
- FastAPI routes → Landing and account pages: renders pages (evidence: `app.py`)
- FastAPI routes → Dashboard: renders dashboard (evidence: `app.py`)
- FastAPI routes → History page: renders history (evidence: `app.py`)
- FastAPI routes → Testimonials: renders testimonials (evidence: `app.py`)
- FastAPI routes → Home planner form: renders form (evidence: `app.py`)
- FastAPI routes → Home recommendations: renders results (evidence: `app.py`)
- FastAPI routes → Party planner form: renders form (evidence: `app.py`)
- FastAPI routes → Party recommendations: renders results (evidence: `app.py`)
- FastAPI routes → Jewelry planner form: renders form (evidence: `app.py`)
- FastAPI routes → Jewelry recommendations: renders results (evidence: `app.py`)
- FastAPI routes → Gemini recommendation service: requests home plan (evidence: `app.py`)
- FastAPI routes → Gemini recommendation service: requests party plan (evidence: `app.py`)
- FastAPI routes → Gemini recommendation service: requests jewelry plan (evidence: `app.py`)
- Gemini recommendation service → Google Gemini API: generates recommendations
