# tahmidulkhan24/batialert architecture

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

- Interactive diagram: https://gitdiagram.com/tahmidulkhan24/batialert
- Repository: https://github.com/tahmidulkhan24/batialert

## Overview

BatiAlert is a Django web app for outage planning in Bangladesh. Users view area-specific schedules and notices, save areas and appliance/battery setups, then use the calculator to assess backup runtime and appliance recommendations. Staff manage schedules, notices, and feedback; a management command sends scheduled email alerts. The graph reflects the documented planner capabilities, but calculator internals and several routes are only partially excerpted, so uncertain implementation links are omitted. The SQLite-backed Django models provide the app’s persistent domain state.

Main entry points: [`core/models.py`](https://github.com/tahmidulkhan24/batialert/blob/main/core/models.py) (Schedule and notice data), [`core/urls.py`](https://github.com/tahmidulkhan24/batialert/blob/main/core/urls.py) (Application routes), [`users/views.py`](https://github.com/tahmidulkhan24/batialert/blob/main/users/views.py) (User dashboard), [`users/models.py`](https://github.com/tahmidulkhan24/batialert/blob/main/users/models.py) (Profiles and saved plans)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Outage planning"]
  node_routes["Application routes<br/>[urls.py]"]
  node_schedule["Area schedules<br/>[views.py]"]
  node_notices["Outage notices<br/>[views.py]"]
  node_calculator["Backup calculator<br/>[views.py]"]
end

subgraph group_accounts["User accounts"]
  node_dashboard["User dashboard<br/>[views.py]"]
  node_accounts_flow["Account access<br/>[views.py]"]
  node_saved_preferences["Saved areas<br/>[views.py]"]
  node_saved_setup["Saved appliance setup<br/>[views.py]"]
end

subgraph group_operations["Operations"]
  node_staff_management["Staff management<br/>[views.py]"]
  node_feedback["Feedback reports<br/>[views.py]"]
  node_alerts["Outage email alerts"]
end

subgraph group_persistence["Domain data"]
  node_core_data[("Schedule and notice data<br/>[models.py]")]
  node_user_data[("Profiles and saved plans<br/>[models.py]")]
end

node_visitor(("Web user"))
node_staff(("Staff user"))
node_email(("Email service"))

node_visitor -->|"requests pages"| node_routes
node_routes -->|"routes schedule"| node_schedule
node_routes -->|"routes notices"| node_notices
node_routes -->|"routes calculator"| node_calculator
node_routes -->|"routes management"| node_staff_management
node_schedule -->|"queries schedules"| node_core_data
node_notices -->|"queries notices"| node_core_data
node_calculator -->|"uses appliance and area data"| node_core_data
node_visitor -->|"signs up or logs in"| node_accounts_flow
node_accounts_flow -->|"redirects after login"| node_dashboard
node_visitor -->|"opens dashboard"| node_dashboard
node_dashboard -->|"queries notices and areas"| node_core_data
node_dashboard -->|"reads saved areas and setup"| node_user_data
node_visitor -->|"manages saved areas"| node_saved_preferences
node_saved_preferences -->|"writes saved areas"| node_user_data
node_visitor -->|"saves appliance setup"| node_saved_setup
node_saved_setup -->|"writes saved setup"| node_user_data
node_staff -->|"manages schedules and notices"| node_staff_management
node_staff_management -->|"updates schedules and notices"| node_core_data
node_visitor -->|"submits feedback"| node_feedback
node_feedback -->|"creates feedback report"| node_core_data
node_alerts -->|"reads alert preferences"| node_user_data
node_alerts -->|"checks schedules and logs sends"| node_core_data
node_alerts -->|"sends outage email"| node_email

click node_routes "https://github.com/tahmidulkhan24/batialert/blob/main/core/urls.py"
click node_schedule "https://github.com/tahmidulkhan24/batialert/blob/main/core/views.py"
click node_notices "https://github.com/tahmidulkhan24/batialert/blob/main/core/views.py"
click node_calculator "https://github.com/tahmidulkhan24/batialert/blob/main/core/views.py"
click node_dashboard "https://github.com/tahmidulkhan24/batialert/blob/main/users/views.py"
click node_accounts_flow "https://github.com/tahmidulkhan24/batialert/blob/main/users/views.py"
click node_saved_preferences "https://github.com/tahmidulkhan24/batialert/blob/main/users/views.py"
click node_saved_setup "https://github.com/tahmidulkhan24/batialert/blob/main/users/views.py"
click node_staff_management "https://github.com/tahmidulkhan24/batialert/blob/main/core/views.py"
click node_feedback "https://github.com/tahmidulkhan24/batialert/blob/main/core/views.py"
click node_alerts "https://github.com/tahmidulkhan24/batialert/blob/main/core/management/commands/send_outage_notifications.py"
click node_core_data "https://github.com/tahmidulkhan24/batialert/blob/main/core/models.py"
click node_user_data "https://github.com/tahmidulkhan24/batialert/blob/main/users/models.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_schedule,node_notices,node_calculator,node_visitor,node_staff toneBlue
class node_dashboard,node_accounts_flow,node_saved_preferences,node_saved_setup toneAmber
class node_staff_management,node_feedback,node_alerts toneMint
class node_core_data,node_user_data toneRose
class node_email toneIndigo
```

## Components

### Outage planning

- [Application routes](https://github.com/tahmidulkhan24/batialert/blob/main/core/urls.py): `core/urls.py`
- [Area schedules](https://github.com/tahmidulkhan24/batialert/blob/main/core/views.py): `core/views.py`
- [Outage notices](https://github.com/tahmidulkhan24/batialert/blob/main/core/views.py): `core/views.py`
- [Backup calculator](https://github.com/tahmidulkhan24/batialert/blob/main/core/views.py): `core/views.py`

### User accounts

- [User dashboard](https://github.com/tahmidulkhan24/batialert/blob/main/users/views.py): `users/views.py`
- [Account access](https://github.com/tahmidulkhan24/batialert/blob/main/users/views.py): `users/views.py`
- [Saved areas](https://github.com/tahmidulkhan24/batialert/blob/main/users/views.py): `users/views.py`
- [Saved appliance setup](https://github.com/tahmidulkhan24/batialert/blob/main/users/views.py): `users/views.py`

### Operations

- [Staff management](https://github.com/tahmidulkhan24/batialert/blob/main/core/views.py): `core/views.py`
- [Feedback reports](https://github.com/tahmidulkhan24/batialert/blob/main/core/views.py): `core/views.py`
- [Outage email alerts](https://github.com/tahmidulkhan24/batialert/blob/main/core/management/commands/send_outage_notifications.py): `core/management/commands/send_outage_notifications.py`

### Domain data

- [Schedule and notice data](https://github.com/tahmidulkhan24/batialert/blob/main/core/models.py): `core/models.py`
- [Profiles and saved plans](https://github.com/tahmidulkhan24/batialert/blob/main/users/models.py): `users/models.py`

### Other components

- **Web user**
- **Staff user**
- **Email service**

## Connections

- Web user → Application routes: requests pages (evidence: `core/urls.py`)
- Application routes → Area schedules: routes schedule (evidence: `core/urls.py`)
- Application routes → Outage notices: routes notices (evidence: `core/urls.py`)
- Application routes → Backup calculator: routes calculator (evidence: `core/urls.py`)
- Application routes → Staff management: routes management (evidence: `core/urls.py`)
- Area schedules → Schedule and notice data: queries schedules (evidence: `core/views.py`)
- Outage notices → Schedule and notice data: queries notices (evidence: `core/views.py`)
- Backup calculator → Schedule and notice data: uses appliance and area data (evidence: `core/views.py`)
- Web user → Account access: signs up or logs in
- Account access → User dashboard: redirects after login (evidence: `users/views.py`)
- Web user → User dashboard: opens dashboard
- User dashboard → Schedule and notice data: queries notices and areas (evidence: `users/views.py`)
- User dashboard → Profiles and saved plans: reads saved areas and setup (evidence: `users/views.py`)
- Web user → Saved areas: manages saved areas
- Saved areas → Profiles and saved plans: writes saved areas (evidence: `users/views.py`)
- Web user → Saved appliance setup: saves appliance setup
- Saved appliance setup → Profiles and saved plans: writes saved setup (evidence: `users/views.py`)
- Staff user → Staff management: manages schedules and notices
- Staff management → Schedule and notice data: updates schedules and notices (evidence: `core/views.py`)
- Web user → Feedback reports: submits feedback
- Feedback reports → Schedule and notice data: creates feedback report (evidence: `core/views.py`)
- Outage email alerts → Profiles and saved plans: reads alert preferences (evidence: `core/management/commands/send_outage_notifications.py`)
- Outage email alerts → Schedule and notice data: checks schedules and logs sends (evidence: `core/management/commands/send_outage_notifications.py`)
- Outage email alerts → Email service: sends outage email (evidence: `core/management/commands/send_outage_notifications.py`)
