# pedrokawa19/senior_design_7 architecture

> Architecture diagram of the GitHub repository pedrokawa19/senior_design_7, 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/pedrokawa19/senior_design_7
- Repository: https://github.com/pedrokawa19/senior_design_7

## Overview

This repository contains an internal Django dashboard for reporting on Vision Metals data, alongside standalone analysis scripts and SQL. Its principal workflow is an authenticated user configuring a client MySQL connection, then requesting profitability or purchase/sales history reports through JSON endpoints; market-index performance is a separate reporting capability. The graph captures routing, authentication, report services, and external data sources. Several service and page implementations were not sampled, so their internal wiring is not inferred.

Main entry points: [`web-django/dashboard/views/api.py`](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/views/api.py) (JSON endpoints), [`web-django/dashboard/urls.py`](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/urls.py) (Dashboard routes), [`web-django/dashboard/views/pages.py`](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/views/pages.py) (Page views), [`web-django/dashboard/views/auth.py`](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/views/auth.py) (Account views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Dashboard web"]
  node_root_routes["Root routes<br/>[urls.py]"]
  node_app_routes["Dashboard routes<br/>[urls.py]"]
  node_page_views["Page views<br/>[pages.py]"]
  node_api_views["JSON endpoints<br/>[api.py]"]
  node_dashboard_template["Dashboard page<br/>[dashboard.html]"]
  node_history_template["History pages<br/>[history.html]"]
  node_profile_template["Profile page<br/>[profile.html]"]
end

subgraph group_access["Access and settings"]
  node_auth_views["Account views<br/>[auth.py]"]
  node_forms["Input forms<br/>[forms.py]"]
  node_credentials["Credential handling<br/>[credentials.py]"]
  node_connection_service["Connection settings<br/>[connections.py]"]
  node_django_state[("Auth and sessions<br/>[settings.py]")]
end

subgraph group_reporting["Reporting services"]
  node_database_service["Read-only DB access<br/>[database.py]"]
  node_history_service["Order history<br/>[history.py]"]
  node_profit_service["Profitability reports<br/>[profitability.py]"]
  node_market_service["Index performance<br/>[market.py]"]
end

subgraph group_data["Data sources"]
  node_mysql[("Client MySQL")]
  node_market_provider["Market data provider"]
end

node_user(("Dashboard user"))

node_user -->|"opens"| node_root_routes
node_root_routes -->|"includes"| node_app_routes
node_app_routes -->|"routes"| node_auth_views
node_app_routes -->|"routes"| node_page_views
node_app_routes -->|"routes"| node_api_views
node_auth_views -->|"validates signup"| node_forms
node_auth_views -->|"uses auth"| node_django_state
node_api_views -->|"checks auth"| node_django_state
node_api_views -->|"validates settings"| node_forms
node_api_views -->|"manages settings"| node_connection_service
node_api_views -->|"reveals saved password"| node_credentials
node_api_views -->|"verifies connection"| node_database_service
node_api_views -->|"requests history"| node_history_service
node_api_views -->|"requests profitability"| node_profit_service
node_api_views -->|"requests index data"| node_market_service
node_page_views -->|"renders"| node_dashboard_template
node_page_views -->|"renders"| node_history_template
node_page_views -->|"renders"| node_profile_template
node_history_service -->|"opens connection"| node_database_service
node_database_service -->|"queries read-only"| node_mysql
node_market_service -.->|"fetches prices"| node_market_provider

click node_root_routes "https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/config/urls.py"
click node_app_routes "https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/urls.py"
click node_auth_views "https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/views/auth.py"
click node_page_views "https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/views/pages.py"
click node_api_views "https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/views/api.py"
click node_forms "https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/forms.py"
click node_credentials "https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/credentials.py"
click node_connection_service "https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/services/connections.py"
click node_django_state "https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/config/settings.py"
click node_dashboard_template "https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/templates/dashboard.html"
click node_history_template "https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/templates/history.html"
click node_profile_template "https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/templates/profile.html"
click node_database_service "https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/services/database.py"
click node_history_service "https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/services/history.py"
click node_profit_service "https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/services/profitability.py"
click node_market_service "https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/services/market.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_root_routes,node_app_routes,node_page_views,node_api_views,node_dashboard_template,node_history_template,node_profile_template,node_user toneBlue
class node_auth_views,node_forms,node_credentials,node_connection_service,node_django_state toneAmber
class node_database_service,node_history_service,node_profit_service,node_market_service toneMint
class node_mysql,node_market_provider toneRose
```

## Components

### Dashboard web

- [Root routes](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/config/urls.py): `web-django/config/urls.py`
- [Dashboard routes](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/urls.py): `web-django/dashboard/urls.py`
- [Page views](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/views/pages.py): `web-django/dashboard/views/pages.py`
- [JSON endpoints](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/views/api.py): `web-django/dashboard/views/api.py`
- [Dashboard page](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/templates/dashboard.html): `web-django/templates/dashboard.html`
- [History pages](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/templates/history.html): `web-django/templates/history.html`
- [Profile page](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/templates/profile.html): `web-django/templates/profile.html`

### Access and settings

- [Account views](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/views/auth.py): `web-django/dashboard/views/auth.py`
- [Input forms](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/forms.py): `web-django/dashboard/forms.py`
- [Credential handling](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/credentials.py): `web-django/dashboard/credentials.py`
- [Connection settings](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/services/connections.py): `web-django/dashboard/services/connections.py`
- [Auth and sessions](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/config/settings.py): `web-django/config/settings.py`

### Reporting services

- [Read-only DB access](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/services/database.py): `web-django/dashboard/services/database.py`
- [Order history](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/services/history.py): `web-django/dashboard/services/history.py`
- [Profitability reports](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/services/profitability.py): `web-django/dashboard/services/profitability.py`
- [Index performance](https://github.com/pedrokawa19/senior_design_7/blob/main/web-django/dashboard/services/market.py): `web-django/dashboard/services/market.py`

### Data sources

- **Client MySQL**
- **Market data provider**

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Root routes: opens
- Root routes → Dashboard routes: includes
- Dashboard routes → Account views: routes
- Dashboard routes → Page views: routes
- Dashboard routes → JSON endpoints: routes
- Account views → Input forms: validates signup
- Account views → Auth and sessions: uses auth
- JSON endpoints → Auth and sessions: checks auth
- JSON endpoints → Input forms: validates settings
- JSON endpoints → Connection settings: manages settings
- JSON endpoints → Credential handling: reveals saved password
- JSON endpoints → Read-only DB access: verifies connection
- JSON endpoints → Order history: requests history
- JSON endpoints → Profitability reports: requests profitability
- JSON endpoints → Index performance: requests index data
- Page views → Dashboard page: renders
- Page views → History pages: renders
- Page views → Profile page: renders
- Order history → Read-only DB access: opens connection
- Read-only DB access → Client MySQL: queries read-only
- Index performance → Market data provider: fetches prices
