# alwannelson/e-tiket-trans-padang architecture

> Architecture diagram of the GitHub repository alwannelson/e-tiket-trans-padang, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alwannelson/e-tiket-trans-padang
- Repository: https://github.com/alwannelson/e-tiket-trans-padang

## Overview

This repository is an Express/MySQL web application branded in its controllers as e-Tiket Trans Padang, despite the README describing a generic REST starter pack. A typical request enters through the Express app and router, then reaches authentication or a user/admin controller; controllers render pages or return JSON and persist data through MySQL. Admin workflows include bus management and shelter management, including Excel import. The graph reflects documented and excerpted wiring; the dashboard implementation and browser-side behavior were not sampled, so their links are omitted where unverified.

Main entry points: [`src/routes/router.js`](https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/routes/router.js) (Route Dispatcher), [`src/controllers/Admin/Shelters/index.js`](https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/controllers/Admin/Shelters/index.js) (Shelter Management), [`src/configs/database.js`](https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/configs/database.js) (Database Connection), [`main.js`](https://github.com/alwannelson/e-tiket-trans-padang/blob/master/main.js) (Express App)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Web Runtime"]
  node_express_app["Express App<br/>[main.js]"]
  node_router["Route Dispatcher<br/>[router.js]"]
  node_database_config["Database Connection<br/>[database.js]"]
  node_bool_check["Boolean Parser<br/>[boolean-check.js]"]
end

subgraph group_identity["Identity and Access"]
  node_auth_controller["Authentication<br/>[authController.js]"]
  node_auth_middleware["Token and Role Checks<br/>[MIDD_auth.js]"]
  node_password_verify["Password Verification<br/>[compare-bcrypt.js]"]
end

subgraph group_transit["Transit Administration"]
  node_dashboard["Admin Dashboard<br/>[index.js]"]
  node_bus_admin["Bus Management<br/>[index.js]"]
  node_shelter_admin["Shelter Management<br/>[index.js]"]
  node_upload_middleware["Excel Upload Filter<br/>[MIDD_multer.js]"]
end

subgraph group_presentation["Presentation"]
  node_user_home["User Home<br/>[index.js]"]
  node_views["EJS Pages"]
  node_static_assets["Static Assets"]
  node_browser_services["Browser Services"]
end

node_visitor(("Visitor"))
node_mysql[("MySQL")]
node_xlsx["Excel Reader"]

node_visitor -->|"sends requests"| node_express_app
node_express_app -->|"mounts routes"| node_router
node_express_app -->|"parses config"| node_bool_check
node_express_app -->|"serves files"| node_static_assets
node_router -->|"dispatches auth"| node_auth_controller
node_router -->|"runs checks"| node_auth_middleware
node_router -->|"dispatches home"| node_user_home
node_router -->|"dispatches dashboard"| node_dashboard
node_router -->|"dispatches bus routes"| node_bus_admin
node_router -->|"dispatches shelter routes"| node_shelter_admin
node_router -->|"filters import"| node_upload_middleware
node_auth_controller -->|"queries users"| node_database_config
node_auth_controller -->|"verifies password"| node_password_verify
node_auth_controller -->|"renders login pages"| node_views
node_auth_middleware -->|"checks token"| node_visitor
node_bus_admin -->|"reads and writes buses"| node_database_config
node_bus_admin -->|"renders bus page"| node_views
node_shelter_admin -->|"reads and writes shelters"| node_database_config
node_shelter_admin -->|"renders shelter page"| node_views
node_shelter_admin -->|"parses workbook"| node_xlsx
node_upload_middleware -->|"provides file buffer"| node_shelter_admin
node_user_home -->|"renders home"| node_views
node_database_config -->|"parses options"| node_bool_check
node_database_config -->|"opens connection"| node_mysql

click node_express_app "https://github.com/alwannelson/e-tiket-trans-padang/blob/master/main.js"
click node_router "https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/routes/router.js"
click node_database_config "https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/configs/database.js"
click node_bool_check "https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/utils/boolean-check.js"
click node_auth_controller "https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/controllers/Auth/authController.js"
click node_auth_middleware "https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/middlewares/MIDD_auth.js"
click node_password_verify "https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/utils/compare-bcrypt.js"
click node_user_home "https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/controllers/User/Home/index.js"
click node_dashboard "https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/controllers/Admin/Dashboard/index.js"
click node_bus_admin "https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/controllers/Admin/Buses/index.js"
click node_shelter_admin "https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/controllers/Admin/Shelters/index.js"
click node_upload_middleware "https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/middlewares/MIDD_multer.js"
click node_views "https://github.com/alwannelson/e-tiket-trans-padang/tree/master/src/views"
click node_static_assets "https://github.com/alwannelson/e-tiket-trans-padang/tree/master/src/public"
click node_browser_services "https://github.com/alwannelson/e-tiket-trans-padang/tree/master/src/public/services"

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_express_app,node_router,node_database_config,node_bool_check toneBlue
class node_auth_controller,node_auth_middleware,node_password_verify,node_mysql toneAmber
class node_dashboard,node_bus_admin,node_shelter_admin,node_upload_middleware toneMint
class node_user_home,node_views,node_static_assets,node_browser_services toneRose
class node_visitor,node_xlsx toneIndigo
```

## Components

### Web Runtime

- [Express App](https://github.com/alwannelson/e-tiket-trans-padang/blob/master/main.js): `main.js`
- [Route Dispatcher](https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/routes/router.js): `src/routes/router.js`
- [Database Connection](https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/configs/database.js): `src/configs/database.js`
- [Boolean Parser](https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/utils/boolean-check.js): `src/utils/boolean-check.js`

### Identity and Access

- [Authentication](https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/controllers/Auth/authController.js): `src/controllers/Auth/authController.js`
- [Token and Role Checks](https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/middlewares/MIDD_auth.js): `src/middlewares/MIDD_auth.js`
- [Password Verification](https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/utils/compare-bcrypt.js): `src/utils/compare-bcrypt.js`

### Transit Administration

- [Admin Dashboard](https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/controllers/Admin/Dashboard/index.js): `src/controllers/Admin/Dashboard/index.js`
- [Bus Management](https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/controllers/Admin/Buses/index.js): `src/controllers/Admin/Buses/index.js`
- [Shelter Management](https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/controllers/Admin/Shelters/index.js): `src/controllers/Admin/Shelters/index.js`
- [Excel Upload Filter](https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/middlewares/MIDD_multer.js): `src/middlewares/MIDD_multer.js`

### Presentation

- [User Home](https://github.com/alwannelson/e-tiket-trans-padang/blob/master/src/controllers/User/Home/index.js): `src/controllers/User/Home/index.js`
- [EJS Pages](https://github.com/alwannelson/e-tiket-trans-padang/tree/master/src/views): `src/views`
- [Static Assets](https://github.com/alwannelson/e-tiket-trans-padang/tree/master/src/public): `src/public`
- [Browser Services](https://github.com/alwannelson/e-tiket-trans-padang/tree/master/src/public/services): `src/public/services`

### Other components

- **Visitor**
- **MySQL**
- **Excel Reader**

## Connections

- Visitor → Express App: sends requests
- Express App → Route Dispatcher: mounts routes (evidence: `main.js`)
- Express App → Boolean Parser: parses config (evidence: `main.js`)
- Express App → Static Assets: serves files (evidence: `main.js`)
- Route Dispatcher → Authentication: dispatches auth (evidence: `src/routes/router.js`)
- Route Dispatcher → Token and Role Checks: runs checks (evidence: `src/routes/router.js`)
- Route Dispatcher → User Home: dispatches home (evidence: `src/routes/router.js`)
- Route Dispatcher → Admin Dashboard: dispatches dashboard (evidence: `src/routes/router.js`)
- Route Dispatcher → Bus Management: dispatches bus routes (evidence: `src/routes/router.js`)
- Route Dispatcher → Shelter Management: dispatches shelter routes (evidence: `src/routes/router.js`)
- Route Dispatcher → Excel Upload Filter: filters import (evidence: `src/routes/router.js`)
- Authentication → Database Connection: queries users (evidence: `src/controllers/Auth/authController.js`)
- Authentication → Password Verification: verifies password (evidence: `src/controllers/Auth/authController.js`)
- Authentication → EJS Pages: renders login pages (evidence: `src/controllers/Auth/authController.js`)
- Token and Role Checks → Visitor: checks token (evidence: `src/middlewares/MIDD_auth.js`)
- Bus Management → Database Connection: reads and writes buses (evidence: `src/controllers/Admin/Buses/index.js`)
- Bus Management → EJS Pages: renders bus page (evidence: `src/controllers/Admin/Buses/index.js`)
- Shelter Management → Database Connection: reads and writes shelters (evidence: `src/controllers/Admin/Shelters/index.js`)
- Shelter Management → EJS Pages: renders shelter page (evidence: `src/controllers/Admin/Shelters/index.js`)
- Shelter Management → Excel Reader: parses workbook (evidence: `src/controllers/Admin/Shelters/index.js`)
- Excel Upload Filter → Shelter Management: provides file buffer (evidence: `src/routes/router.js`)
- User Home → EJS Pages: renders home (evidence: `src/controllers/User/Home/index.js`)
- Database Connection → Boolean Parser: parses options (evidence: `src/configs/database.js`)
- Database Connection → MySQL: opens connection (evidence: `src/configs/database.js`)
