# rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds- architecture

> Architecture diagram of the GitHub repository rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-
- Repository: https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-

## Overview

This is a Flask web application for classifying respiratory disorders from uploaded lung sounds. A patient uploads a recording; the app passes it to the classifier, which extracts audio features and predicts the leading and runner-up conditions. The app also creates waveform and MFCC visualizations for the result page. Separate routes provide login, registration, and chart pages. The model and prediction path are supported by sampled source; chart content and other template details are inferred only from routes and the file tree.

Main entry points: [`app.py`](https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/app.py) (Flask routes), [`rdc_model.py`](https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/rdc_model.py) (Classifier), [`model/model.h5`](https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/model/model.h5) (Trained model), [`templates/first.html`](https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/templates/first.html) (Landing and auth views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Flask routes<br/>[app.py]"]
  node_accounts["Account state<br/>[app.py]"]
  node_upload["Temporary audio<br/>[app.py]"]
  node_visualizations["Audio visualizations<br/>[app.py]"]
end

subgraph group_inference["Audio classification"]
  node_classifier["Classifier<br/>[rdc_model.py]"]
  node_features["Audio features<br/>[rdc_model.py]"]
  node_model["Trained model<br/>[model.h5]"]
end

subgraph group_views["User interface"]
  node_first["Landing and auth views<br/>[first.html]"]
  node_authviews["Login and registration views<br/>[login.html]"]
  node_mainview["Upload and result view<br/>[index.html]"]
  node_chartviews["Chart views<br/>[chart.html]"]
  node_pieview["Pie chart view<br/>[piechart.html]"]
end

node_patient(("Patient"))

node_patient -->|"uploads audio"| node_app
node_patient -->|"submits credentials"| node_app
node_app -->|"saves audio"| node_upload
node_app -->|"classifies recording"| node_classifier
node_classifier -->|"extracts features"| node_features
node_classifier -->|"predicts with"| node_model
node_classifier -->|"returns predictions"| node_app
node_app -->|"generates plots"| node_visualizations
node_app -->|"reads and updates"| node_accounts
node_app -->|"renders landing"| node_first
node_app -->|"renders auth"| node_authviews
node_app -->|"renders upload and results"| node_mainview
node_app -->|"renders chart"| node_chartviews
node_app -->|"renders pie chart"| node_pieview

click node_app "https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/app.py"
click node_accounts "https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/app.py"
click node_upload "https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/app.py"
click node_visualizations "https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/app.py"
click node_classifier "https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/rdc_model.py"
click node_features "https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/rdc_model.py"
click node_model "https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/model/model.h5"
click node_first "https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/templates/first.html"
click node_authviews "https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/templates/login.html"
click node_mainview "https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/templates/index.html"
click node_chartviews "https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/templates/chart.html"
click node_pieview "https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/templates/piechart.html"

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_accounts,node_upload,node_visualizations toneBlue
class node_classifier,node_features,node_model toneAmber
class node_first,node_authviews,node_mainview,node_chartviews,node_pieview toneMint
class node_patient toneIndigo
```

## Components

### Web application

- [Flask routes](https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/app.py): `app.py`
- [Account state](https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/app.py): `app.py`
- [Temporary audio](https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/app.py): `app.py`
- [Audio visualizations](https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/app.py): `app.py`

### Audio classification

- [Classifier](https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/rdc_model.py): `rdc_model.py`
- [Audio features](https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/rdc_model.py): `rdc_model.py`
- [Trained model](https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/model/model.h5): `model/model.h5`

### User interface

- [Landing and auth views](https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/templates/first.html): `templates/first.html`
- [Login and registration views](https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/templates/login.html): `templates/login.html`
- [Upload and result view](https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/templates/index.html): `templates/index.html`
- [Chart views](https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/templates/chart.html): `templates/chart.html`
- [Pie chart view](https://github.com/rakesh-mora/classification-of-pulmonary-diseases-using-respiratory-sounds-/blob/main/templates/piechart.html): `templates/piechart.html`

### Other components

- **Patient**

## Connections

- Patient → Flask routes: uploads audio
- Patient → Flask routes: submits credentials
- Flask routes → Temporary audio: saves audio
- Flask routes → Classifier: classifies recording
- Classifier → Audio features: extracts features
- Classifier → Trained model: predicts with
- Classifier → Flask routes: returns predictions
- Flask routes → Audio visualizations: generates plots
- Flask routes → Account state: reads and updates
- Flask routes → Landing and auth views: renders landing
- Flask routes → Login and registration views: renders auth
- Flask routes → Upload and result view: renders upload and results
- Flask routes → Chart views: renders chart
- Flask routes → Pie chart view: renders pie chart
