# poornachandra35/multi-service-api-with-fastapi-go-machine-learning architecture

> Architecture diagram of the GitHub repository poornachandra35/multi-service-api-with-fastapi-go-machine-learning, 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/poornachandra35/multi-service-api-with-fastapi-go-machine-learning
- Repository: https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning

## Overview

This is a FastAPI backend that exposes a central gateway and five capabilities: CSV exploration/cleaning, sentiment classification, animal-image classification, stock prediction, and number-series prediction, plus an HTML API guide. The user workflow is an HTTP request routed to a capability, validated or processed by its service/model, and returned as a response. The CSV workflow also keeps uploaded data in process-local sessions. The README documents the stock model artifacts and broad capabilities; those documented relationships are shown, while unsampled implementation details are not inferred.

Main entry points: [`main.py`](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/main.py) (FastAPI gateway), [`guides/api_guide.py`](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/guides/api_guide.py) (API guide route), [`modules/csv_analyzer/routes.py`](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/csv_analyzer/routes.py) (CSV endpoints), [`modules/csv_analyzer/service.py`](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/csv_analyzer/service.py) (CSV processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gateway["API gateway and guide"]
  node_app["FastAPI gateway<br/>[main.py]"]
  node_guide["API guide route<br/>[api_guide.py]"]
  node_guide_template["HTML guide<br/>[api_guide.html]"]
end

subgraph group_csv["CSV analysis"]
  node_csv_routes["CSV endpoints<br/>[routes.py]"]
  node_csv_service["CSV processing<br/>[service.py]"]
  node_csv_sessions[("Data sessions<br/>[session_store.py]")]
end

subgraph group_ml["ML prediction services"]
  node_sentiment_routes["Sentiment endpoints<br/>[routes.py]"]
  node_sentiment_model["Sentiment inference<br/>[model_loader.py]"]
  node_animal_routes["Animal endpoint<br/>[routes.py]"]
  node_animal_model["Image classifier<br/>[model_loader.py]"]
  node_animal_labels["Animal label map<br/>[labels_map.py]"]
  node_stock_routes["Stock endpoint<br/>[routes.py]"]
  node_stock_model["Stock inference<br/>[model_loader.py]"]
  node_stock_artifacts["Stock model files"]
end

subgraph group_series["Series analysis"]
  node_series_routes["Series endpoint<br/>[routes.py]"]
  node_series_service["Pattern prediction<br/>[service.py]"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_app
node_app -->|"registers routes"| node_csv_routes
node_app -->|"registers routes"| node_sentiment_routes
node_app -->|"registers routes"| node_animal_routes
node_app -->|"registers routes"| node_stock_routes
node_app -->|"registers routes"| node_series_routes
node_app -->|"registers route"| node_guide
node_guide -->|"renders template"| node_guide_template
node_csv_routes -->|"calls processing"| node_csv_service
node_csv_service -->|"reads and writes"| node_csv_sessions
node_sentiment_routes -->|"calls inference"| node_sentiment_model
node_animal_routes -->|"calls inference"| node_animal_model
node_animal_model -->|"maps labels"| node_animal_labels
node_stock_routes -->|"calls prediction"| node_stock_model
node_stock_model -.->|"uses model files"| node_stock_artifacts
node_series_routes -->|"calls prediction"| node_series_service

click node_app "https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/main.py"
click node_guide "https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/guides/api_guide.py"
click node_guide_template "https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/templates/api_guide.html"
click node_csv_routes "https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/csv_analyzer/routes.py"
click node_csv_service "https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/csv_analyzer/service.py"
click node_csv_sessions "https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/csv_analyzer/session_store.py"
click node_sentiment_routes "https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/sentiment_analyzer/routes.py"
click node_sentiment_model "https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/sentiment_analyzer/model_loader.py"
click node_animal_routes "https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/animal_classifier/routes.py"
click node_animal_model "https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/animal_classifier/model_loader.py"
click node_animal_labels "https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/animal_classifier/labels_map.py"
click node_stock_routes "https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/stock_predictor/routes.py"
click node_stock_model "https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/stock_predictor/model_loader.py"
click node_stock_artifacts "https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/tree/main/modules/stock_predictor/model"
click node_series_routes "https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/series_analyzer/routes.py"
click node_series_service "https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/series_analyzer/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_app,node_guide,node_guide_template,node_client toneBlue
class node_csv_routes,node_csv_service,node_csv_sessions toneAmber
class node_sentiment_routes,node_sentiment_model,node_animal_routes,node_animal_model,node_animal_labels,node_stock_routes,node_stock_model,node_stock_artifacts toneMint
class node_series_routes,node_series_service toneRose
```

## Components

### API gateway and guide

- [FastAPI gateway](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/main.py): `main.py`
- [API guide route](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/guides/api_guide.py): `guides/api_guide.py`
- [HTML guide](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/templates/api_guide.html): `templates/api_guide.html`

### CSV analysis

- [CSV endpoints](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/csv_analyzer/routes.py): `modules/csv_analyzer/routes.py`
- [CSV processing](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/csv_analyzer/service.py): `modules/csv_analyzer/service.py`
- [Data sessions](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/csv_analyzer/session_store.py): `modules/csv_analyzer/session_store.py`

### ML prediction services

- [Sentiment endpoints](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/sentiment_analyzer/routes.py): `modules/sentiment_analyzer/routes.py`
- [Sentiment inference](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/sentiment_analyzer/model_loader.py): `modules/sentiment_analyzer/model_loader.py`
- [Animal endpoint](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/animal_classifier/routes.py): `modules/animal_classifier/routes.py`
- [Image classifier](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/animal_classifier/model_loader.py): `modules/animal_classifier/model_loader.py`
- [Animal label map](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/animal_classifier/labels_map.py): `modules/animal_classifier/labels_map.py`
- [Stock endpoint](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/stock_predictor/routes.py): `modules/stock_predictor/routes.py`
- [Stock inference](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/stock_predictor/model_loader.py): `modules/stock_predictor/model_loader.py`
- [Stock model files](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/tree/main/modules/stock_predictor/model): `modules/stock_predictor/model`

### Series analysis

- [Series endpoint](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/series_analyzer/routes.py): `modules/series_analyzer/routes.py`
- [Pattern prediction](https://github.com/poornachandra35/multi-service-api-with-fastapi-go-machine-learning/blob/main/modules/series_analyzer/service.py): `modules/series_analyzer/service.py`

### Other components

- **API client**

## Connections

- API client → FastAPI gateway: sends requests (evidence: `README.md`)
- FastAPI gateway → CSV endpoints: registers routes (evidence: `main.py`)
- FastAPI gateway → Sentiment endpoints: registers routes (evidence: `main.py`)
- FastAPI gateway → Animal endpoint: registers routes (evidence: `main.py`)
- FastAPI gateway → Stock endpoint: registers routes (evidence: `main.py`)
- FastAPI gateway → Series endpoint: registers routes (evidence: `main.py`)
- FastAPI gateway → API guide route: registers route (evidence: `main.py`)
- API guide route → HTML guide: renders template (evidence: `guides/api_guide.py`)
- CSV endpoints → CSV processing: calls processing (evidence: `modules/csv_analyzer/routes.py`)
- CSV processing → Data sessions: reads and writes (evidence: `modules/csv_analyzer/service.py`)
- Sentiment endpoints → Sentiment inference: calls inference (evidence: `modules/sentiment_analyzer/routes.py`)
- Animal endpoint → Image classifier: calls inference (evidence: `modules/animal_classifier/routes.py`)
- Image classifier → Animal label map: maps labels (evidence: `modules/animal_classifier/model_loader.py`)
- Stock endpoint → Stock inference: calls prediction (evidence: `modules/stock_predictor/routes.py`)
- Stock inference → Stock model files: uses model files (evidence: `README.md`)
- Series endpoint → Pattern prediction: calls prediction (evidence: `modules/series_analyzer/routes.py`)
