# ajaygupta005/nlp-app-api-and-flask-project architecture

> Architecture diagram of the GitHub repository ajaygupta005/nlp-app-api-and-flask-project, 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/ajaygupta005/nlp-app-api-and-flask-project
- Repository: https://github.com/ajaygupta005/nlp-app-api-and-flask-project

## Overview

This is a Flask web app for user registration and login plus three text-analysis features: named-entity recognition, sentiment analysis, and summarization. Users submit requests through the app; protected profile and analysis routes use session state, and analysis handlers call Hugging Face inference endpoints before rendering results. The app delegates account checks and writes to a MySQL-backed database layer. The README is empty and template contents were not sampled, so the graph shows documented route and render relationships without assuming template details.

Main entry points: [`app.py`](https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/app.py) (Flask routes), [`templates/profile.html`](https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/templates/profile.html) (Profile view), [`db.py`](https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/db.py) (Database access), [`templates/login.html`](https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/templates/login.html) (Login view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web app"]
  node_routes["Flask routes<br/>[app.py]"]
  node_auth["Registration and login<br/>[app.py]"]
  node_profile["Protected profile<br/>[app.py]"]
  node_login_view["Login view<br/>[login.html]"]
  node_register_view["Registration view<br/>[register.html]"]
  node_profile_view["Profile view<br/>[profile.html]"]
end

subgraph group_nlp["Text analysis"]
  node_ner["Entity recognition<br/>[app.py]"]
  node_sentiment["Sentiment analysis<br/>[app.py]"]
  node_summarize["Text summarization<br/>[app.py]"]
  node_ner_api["NER inference API"]
  node_sentiment_api["Sentiment inference API"]
  node_summary_api["Summarization inference API"]
end

subgraph group_data["Account data"]
  node_db_layer["Database access<br/>[db.py]"]
  node_mysql[("MySQL database")]
end

node_user(("User"))

node_user -->|"sends requests"| node_routes
node_routes -->|"renders"| node_login_view
node_routes -->|"renders"| node_register_view
node_auth -->|"checks and writes"| node_db_layer
node_db_layer -->|"queries and updates"| node_mysql
node_routes -->|"dispatches"| node_auth
node_routes -->|"dispatches"| node_profile
node_profile -->|"renders"| node_profile_view
node_routes -->|"dispatches"| node_ner
node_routes -->|"dispatches"| node_sentiment
node_routes -->|"dispatches"| node_summarize
node_ner -->|"sends text"| node_ner_api
node_sentiment -->|"sends text"| node_sentiment_api
node_summarize -->|"sends text"| node_summary_api
node_ner -->|"renders results"| node_profile_view
node_sentiment -->|"renders results"| node_profile_view
node_summarize -->|"renders results"| node_profile_view

click node_routes "https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/app.py"
click node_auth "https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/app.py"
click node_profile "https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/app.py"
click node_login_view "https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/templates/login.html"
click node_register_view "https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/templates/register.html"
click node_profile_view "https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/templates/profile.html"
click node_ner "https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/app.py"
click node_sentiment "https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/app.py"
click node_summarize "https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/app.py"
click node_db_layer "https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/db.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_routes,node_auth,node_profile,node_login_view,node_register_view,node_profile_view,node_user toneBlue
class node_ner,node_sentiment,node_summarize,node_ner_api,node_sentiment_api,node_summary_api toneAmber
class node_db_layer,node_mysql toneMint
```

## Components

### Web app

- [Flask routes](https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/app.py): `app.py`
- [Registration and login](https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/app.py): `app.py`
- [Protected profile](https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/app.py): `app.py`
- [Login view](https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/templates/login.html): `templates/login.html`
- [Registration view](https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/templates/register.html): `templates/register.html`
- [Profile view](https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/templates/profile.html): `templates/profile.html`

### Text analysis

- [Entity recognition](https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/app.py): `app.py`
- [Sentiment analysis](https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/app.py): `app.py`
- [Text summarization](https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/app.py): `app.py`
- **NER inference API**
- **Sentiment inference API**
- **Summarization inference API**

### Account data

- [Database access](https://github.com/ajaygupta005/nlp-app-api-and-flask-project/blob/main/db.py): `db.py`
- **MySQL database**

### Other components

- **User**

## Connections

- User → Flask routes: sends requests
- Flask routes → Login view: renders
- Flask routes → Registration view: renders
- Registration and login → Database access: checks and writes
- Database access → MySQL database: queries and updates
- Flask routes → Registration and login: dispatches
- Flask routes → Protected profile: dispatches
- Protected profile → Profile view: renders
- Flask routes → Entity recognition: dispatches
- Flask routes → Sentiment analysis: dispatches
- Flask routes → Text summarization: dispatches
- Entity recognition → NER inference API: sends text
- Sentiment analysis → Sentiment inference API: sends text
- Text summarization → Summarization inference API: sends text
- Entity recognition → Profile view: renders results
- Sentiment analysis → Profile view: renders results
- Text summarization → Profile view: renders results
