# whoiskhairul/dbw architecture

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

- Interactive diagram: https://gitdiagram.com/whoiskhairul/dbw
- Repository: https://github.com/whoiskhairul/dbw

## Overview

DWT is a Django/DRF service for discovering geospatial records about schools, childcare centers, school social work, and youth employment support. Its main flow routes API or testing requests to facility views, which query stored records and serialize GeoJSON or facility data. A separate workflow imports facility records from ArcGIS; authenticated endpoints support user profiles, favourites, and directions. The source excerpts establish these calls, but do not show the full settings or all endpoint behavior, so uncertain wiring is omitted.

Main entry points: [`testapp/views.py`](https://github.com/whoiskhairul/dbw/blob/main/testapp/views.py) (Facility views), [`DWT/urls.py`](https://github.com/whoiskhairul/dbw/blob/main/DWT/urls.py) (Project routes), [`authapp/views.py`](https://github.com/whoiskhairul/dbw/blob/main/authapp/views.py) (User views), [`testapp/models.py`](https://github.com/whoiskhairul/dbw/blob/main/testapp/models.py) (Facility records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["Request routing"]
  node_routes["Project routes<br/>[urls.py]"]
  node_testing_routes["Testing routes<br/>[urls.py]"]
  node_auth_routes["Auth routes<br/>[urls.py]"]
end

subgraph group_facilities["Facility discovery"]
  node_facility_views["Facility views<br/>[views.py]"]
  node_facility_models[("Facility records<br/>[models.py]")]
  node_facility_serializers["Facility serializers<br/>[serializers.py]"]
end

subgraph group_accounts["Accounts"]
  node_user_views["User views<br/>[views.py]"]
  node_user_models[("User records<br/>[models.py]")]
  node_user_serializers["User serializers<br/>[serializers.py]"]
  node_registration["Registration serializer<br/>[serializers.py]"]
end

subgraph group_ingestion["Data ingestion"]
  node_arcgis{{"ArcGIS services"}}
  node_data_import["Facility importer<br/>[views.py]"]
end

node_client(("HTTP client"))

node_client -->|"sends request"| node_routes
node_routes -->|"routes API"| node_facility_views
node_routes -->|"includes routes"| node_testing_routes
node_routes -->|"includes routes"| node_auth_routes
node_testing_routes -->|"routes requests"| node_facility_views
node_auth_routes -->|"routes requests"| node_user_views
node_facility_views -->|"queries records"| node_facility_models
node_facility_views -->|"serializes records"| node_facility_serializers
node_facility_views -->|"requests GeoJSON"| node_arcgis
node_facility_views -->|"creates records"| node_facility_models
node_user_views -->|"loads user"| node_user_models
node_user_views -->|"serializes user"| node_user_serializers
node_registration -->|"saves user"| node_user_models
node_facility_views -->|"updates favourite"| node_user_models
node_facility_views -->|"looks up destination"| node_facility_models

click node_routes "https://github.com/whoiskhairul/dbw/blob/main/DWT/urls.py"
click node_testing_routes "https://github.com/whoiskhairul/dbw/blob/main/testapp/urls.py"
click node_auth_routes "https://github.com/whoiskhairul/dbw/blob/main/authapp/urls.py"
click node_facility_views "https://github.com/whoiskhairul/dbw/blob/main/testapp/views.py"
click node_facility_models "https://github.com/whoiskhairul/dbw/blob/main/testapp/models.py"
click node_facility_serializers "https://github.com/whoiskhairul/dbw/blob/main/testapp/serializers.py"
click node_data_import "https://github.com/whoiskhairul/dbw/blob/main/testapp/views.py"
click node_user_views "https://github.com/whoiskhairul/dbw/blob/main/authapp/views.py"
click node_user_models "https://github.com/whoiskhairul/dbw/blob/main/authapp/models.py"
click node_user_serializers "https://github.com/whoiskhairul/dbw/blob/main/authapp/serializers.py"
click node_registration "https://github.com/whoiskhairul/dbw/blob/main/authapp/serializers.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_testing_routes,node_auth_routes,node_client toneBlue
class node_facility_views,node_facility_models,node_facility_serializers toneAmber
class node_user_views,node_user_models,node_user_serializers,node_registration toneMint
class node_arcgis,node_data_import toneRose
```

## Components

### Request routing

- [Project routes](https://github.com/whoiskhairul/dbw/blob/main/DWT/urls.py): `DWT/urls.py`
- [Testing routes](https://github.com/whoiskhairul/dbw/blob/main/testapp/urls.py): `testapp/urls.py`
- [Auth routes](https://github.com/whoiskhairul/dbw/blob/main/authapp/urls.py): `authapp/urls.py`

### Facility discovery

- [Facility views](https://github.com/whoiskhairul/dbw/blob/main/testapp/views.py): `testapp/views.py`
- [Facility records](https://github.com/whoiskhairul/dbw/blob/main/testapp/models.py): `testapp/models.py`
- [Facility serializers](https://github.com/whoiskhairul/dbw/blob/main/testapp/serializers.py): `testapp/serializers.py`

### Accounts

- [User views](https://github.com/whoiskhairul/dbw/blob/main/authapp/views.py): `authapp/views.py`
- [User records](https://github.com/whoiskhairul/dbw/blob/main/authapp/models.py): `authapp/models.py`
- [User serializers](https://github.com/whoiskhairul/dbw/blob/main/authapp/serializers.py): `authapp/serializers.py`
- [Registration serializer](https://github.com/whoiskhairul/dbw/blob/main/authapp/serializers.py): `authapp/serializers.py`

### Data ingestion

- **ArcGIS services**
- [Facility importer](https://github.com/whoiskhairul/dbw/blob/main/testapp/views.py): `testapp/views.py`

### Other components

- **HTTP client**

## Connections

- HTTP client → Project routes: sends request (evidence: `DWT/urls.py`)
- Project routes → Facility views: routes API (evidence: `DWT/urls.py`)
- Project routes → Testing routes: includes routes (evidence: `DWT/urls.py`)
- Project routes → Auth routes: includes routes (evidence: `DWT/urls.py`)
- Testing routes → Facility views: routes requests (evidence: `testapp/urls.py`)
- Auth routes → User views: routes requests (evidence: `authapp/urls.py`)
- Facility views → Facility records: queries records (evidence: `testapp/views.py`)
- Facility views → Facility serializers: serializes records (evidence: `testapp/views.py`)
- Facility views → ArcGIS services: requests GeoJSON (evidence: `testapp/views.py`)
- Facility views → Facility records: creates records (evidence: `testapp/views.py`)
- User views → User records: loads user (evidence: `authapp/views.py`)
- User views → User serializers: serializes user (evidence: `authapp/views.py`)
- Registration serializer → User records: saves user (evidence: `authapp/serializers.py`)
- Facility views → User records: updates favourite (evidence: `testapp/views.py`)
- Facility views → Facility records: looks up destination (evidence: `testapp/views.py`)
