# randomlyclueless/financialriskanalysis architecture

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

- Interactive diagram: https://gitdiagram.com/randomlyclueless/financialriskanalysis
- Repository: https://github.com/randomlyclueless/financialriskanalysis

## Overview

This repository is a financial-risk and loan-prediction platform with Django authentication and loan workflows, a separate Flask goals API, and a scikit-learn prediction service. The main evidenced path is a user submitting loan details through Django, which calls the predictor and saves application results. The README also describes financial tracking, visualizations, advice, and loan-term recommendations; some of these capabilities are not verifiable in the sampled source, so their links are not inferred. The Flask goals endpoint uses a separate database filename from the README’s documented SQLite database.

Main entry points: [`authapp/views.py`](https://github.com/randomlyclueless/financialriskanalysis/blob/main/authapp/views.py) (Loan views), [`app.py`](https://github.com/randomlyclueless/financialriskanalysis/blob/main/app.py) (Goals API), [`bankrisk/urls.py`](https://github.com/randomlyclueless/financialriskanalysis/blob/main/bankrisk/urls.py) (Django routes), [`authapp/urls.py`](https://github.com/randomlyclueless/financialriskanalysis/blob/main/authapp/urls.py) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web applications"]
  node_django_routes["Django routes<br/>[urls.py]"]
  node_auth_routes["Auth routes<br/>[urls.py]"]
end

subgraph group_loan["Loan workflow"]
  node_loan_views["Loan views<br/>[views.py]"]
  node_loan_forms["Loan forms<br/>[forms.py]"]
  node_loan_models["Loan records<br/>[models.py]"]
  node_django_store[("Django database<br/>[settings.py]")]
  node_result["Loan results<br/>[views.py]"]
end

subgraph group_ml["Prediction"]
  node_predictor["Loan predictor<br/>[predictor.py]"]
  node_trained_model["Trained model<br/>[model.py]"]
end

subgraph group_finance["Financial tracking"]
  node_flask_app["Goals API<br/>[app.py]"]
  node_goals_store[("Goals database<br/>[app.py]")]
  node_goal_results["Goal data<br/>[app.py]"]
  node_financial_tools["Financial analysis"]
  node_eda["Data analysis<br/>[eda_analysis.py]"]
  node_advice["Financial advice"]
  node_visualizations["Financial visualizations"]
end

node_user(("User"))

node_user -->|"requests pages"| node_django_routes
node_django_routes -->|"includes routes"| node_auth_routes
node_auth_routes -->|"dispatches requests"| node_loan_views
node_loan_views -->|"validates input"| node_loan_forms
node_loan_views -->|"requests predictions"| node_predictor
node_loan_views -->|"saves application"| node_loan_models
node_loan_models -->|"persists records"| node_django_store
node_predictor -->|"loads model"| node_trained_model
node_loan_views -->|"renders results"| node_result
node_user -->|"requests goals"| node_flask_app
node_flask_app -->|"reads goals"| node_goals_store
node_flask_app -->|"returns JSON"| node_goal_results
node_loan_views -.->|"offers tools"| node_financial_tools

click node_django_routes "https://github.com/randomlyclueless/financialriskanalysis/blob/main/bankrisk/urls.py"
click node_auth_routes "https://github.com/randomlyclueless/financialriskanalysis/blob/main/authapp/urls.py"
click node_loan_views "https://github.com/randomlyclueless/financialriskanalysis/blob/main/authapp/views.py"
click node_loan_forms "https://github.com/randomlyclueless/financialriskanalysis/blob/main/authapp/forms.py"
click node_loan_models "https://github.com/randomlyclueless/financialriskanalysis/blob/main/authapp/models.py"
click node_django_store "https://github.com/randomlyclueless/financialriskanalysis/blob/main/bankrisk/settings.py"
click node_predictor "https://github.com/randomlyclueless/financialriskanalysis/blob/main/ml_models/predictor.py"
click node_trained_model "https://github.com/randomlyclueless/financialriskanalysis/blob/main/ml_models/model.py"
click node_result "https://github.com/randomlyclueless/financialriskanalysis/blob/main/authapp/views.py"
click node_flask_app "https://github.com/randomlyclueless/financialriskanalysis/blob/main/app.py"
click node_goals_store "https://github.com/randomlyclueless/financialriskanalysis/blob/main/app.py"
click node_goal_results "https://github.com/randomlyclueless/financialriskanalysis/blob/main/app.py"
click node_financial_tools "https://github.com/randomlyclueless/financialriskanalysis/blob/main/financial_data_matter_with_db.py"
click node_eda "https://github.com/randomlyclueless/financialriskanalysis/blob/main/eda_analysis.py"
click node_advice "https://github.com/randomlyclueless/financialriskanalysis/tree/main/authapp"
click node_visualizations "https://github.com/randomlyclueless/financialriskanalysis/tree/main/authapp"

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_django_routes,node_auth_routes,node_user toneBlue
class node_loan_views,node_loan_forms,node_loan_models,node_django_store,node_result toneAmber
class node_predictor,node_trained_model toneMint
class node_flask_app,node_goals_store,node_goal_results,node_financial_tools,node_eda,node_advice,node_visualizations toneRose
```

## Components

### Web applications

- [Django routes](https://github.com/randomlyclueless/financialriskanalysis/blob/main/bankrisk/urls.py): `bankrisk/urls.py`
- [Auth routes](https://github.com/randomlyclueless/financialriskanalysis/blob/main/authapp/urls.py): `authapp/urls.py`

### Loan workflow

- [Loan views](https://github.com/randomlyclueless/financialriskanalysis/blob/main/authapp/views.py): `authapp/views.py`
- [Loan forms](https://github.com/randomlyclueless/financialriskanalysis/blob/main/authapp/forms.py): `authapp/forms.py`
- [Loan records](https://github.com/randomlyclueless/financialriskanalysis/blob/main/authapp/models.py): `authapp/models.py`
- [Django database](https://github.com/randomlyclueless/financialriskanalysis/blob/main/bankrisk/settings.py): `bankrisk/settings.py`
- [Loan results](https://github.com/randomlyclueless/financialriskanalysis/blob/main/authapp/views.py): `authapp/views.py`

### Prediction

- [Loan predictor](https://github.com/randomlyclueless/financialriskanalysis/blob/main/ml_models/predictor.py): `ml_models/predictor.py`
- [Trained model](https://github.com/randomlyclueless/financialriskanalysis/blob/main/ml_models/model.py): `ml_models/model.py`

### Financial tracking

- [Goals API](https://github.com/randomlyclueless/financialriskanalysis/blob/main/app.py): `app.py`
- [Goals database](https://github.com/randomlyclueless/financialriskanalysis/blob/main/app.py): `app.py`
- [Goal data](https://github.com/randomlyclueless/financialriskanalysis/blob/main/app.py): `app.py`
- [Financial analysis](https://github.com/randomlyclueless/financialriskanalysis/blob/main/financial_data_matter_with_db.py): `financial_data_matter_with_db.py`
- [Data analysis](https://github.com/randomlyclueless/financialriskanalysis/blob/main/eda_analysis.py): `eda_analysis.py`
- [Financial advice](https://github.com/randomlyclueless/financialriskanalysis/tree/main/authapp): `authapp`
- [Financial visualizations](https://github.com/randomlyclueless/financialriskanalysis/tree/main/authapp): `authapp`

### Other components

- **User**

## Connections

- User → Django routes: requests pages
- Django routes → Auth routes: includes routes
- Auth routes → Loan views: dispatches requests
- Loan views → Loan forms: validates input
- Loan views → Loan predictor: requests predictions
- Loan views → Loan records: saves application
- Loan records → Django database: persists records
- Loan predictor → Trained model: loads model
- Loan views → Loan results: renders results
- User → Goals API: requests goals
- Goals API → Goals database: reads goals
- Goals API → Goal data: returns JSON
- Loan views → Financial analysis: offers tools
