# k1m0ch1/maaingwe architecture

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

- Interactive diagram: https://gitdiagram.com/k1m0ch1/maaingwe
- Repository: https://github.com/k1m0ch1/maaingwe

## Overview

MaAingWe is a command-line Darwinbox attendance tool. Users authenticate with a temporary QR-code string, configure attendance details and times, then check in/out manually or run a daily scheduler. Scheduled actions skip weekends and dates in holidays.json; checkout first retrieves the current check-in ID. The graph reflects the sampled CLI and API implementation. The API contract and example configuration are present in the tree but were not excerpted, so their internals are not expanded.

Main entry points: [`main.go`](https://github.com/k1m0ch1/maaingwe/blob/master/main.go) (Command dispatch), [`utils/main.go`](https://github.com/k1m0ch1/maaingwe/blob/master/utils/main.go) (API client), [`holidays.json`](https://github.com/k1m0ch1/maaingwe/blob/master/holidays.json) (Holiday calendar), [`utils/struct.go`](https://github.com/k1m0ch1/maaingwe/blob/master/utils/struct.go) (Request and response models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflows"]
  node_commands["Command dispatch<br/>[main.go]"]
  node_login["QR login<br/>[main.go]"]
  node_scheduler["Daily scheduler<br/>[main.go]"]
  node_profile["Profile display<br/>[main.go]"]
end

subgraph group_attendance["Attendance rules"]
  node_attendance_gate["Attendance gate<br/>[main.go]"]
  node_holiday_calendar["Holiday calendar<br/>[holidays.json]"]
  node_checkin_action["Check-in action<br/>[main.go]"]
  node_checkout_action["Checkout action<br/>[main.go]"]
end

subgraph group_api["Darwinbox API"]
  node_data_models["Request and response models<br/>[struct.go]"]
  node_api_client["API client<br/>[main.go]"]
end

subgraph group_config["Configuration"]
  node_config_load["Config loading<br/>[main.go]"]
  node_config_file["User configuration"]
  node_config_generate["Config generation<br/>[main.go]"]
end

node_user(("User"))
node_darwinbox{{"Darwinbox service"}}
node_holiday_source{{"Holiday data source"}}

node_user -->|"runs commands"| node_commands
node_commands -->|"loads config"| node_config_load
node_commands -->|"dispatches login"| node_login
node_commands -->|"starts scheduler"| node_scheduler
node_commands -->|"dispatches profile"| node_profile
node_commands -->|"runs directly"| node_checkin_action
node_commands -->|"runs directly"| node_checkout_action
node_login -->|"submits QR"| node_api_client
node_login -->|"generates config"| node_config_generate
node_config_generate -->|"writes config"| node_config_file
node_config_load -->|"reads config"| node_config_file
node_config_generate -->|"downloads holidays"| node_holiday_source
node_config_generate -->|"writes holidays"| node_holiday_calendar
node_scheduler -->|"schedules checks"| node_attendance_gate
node_attendance_gate -->|"reads dates"| node_holiday_calendar
node_attendance_gate -->|"runs check-in"| node_checkin_action
node_attendance_gate -->|"runs checkout"| node_checkout_action
node_checkin_action -->|"requests check-in"| node_api_client
node_checkout_action -->|"requests check-in ID"| node_api_client
node_checkout_action -->|"submits checkout"| node_api_client
node_profile -->|"fetches profile"| node_api_client
node_api_client -->|"sends API requests"| node_darwinbox
node_api_client -->|"uses data types"| node_data_models

click node_commands "https://github.com/k1m0ch1/maaingwe/blob/master/main.go"
click node_login "https://github.com/k1m0ch1/maaingwe/blob/master/main.go"
click node_scheduler "https://github.com/k1m0ch1/maaingwe/blob/master/main.go"
click node_profile "https://github.com/k1m0ch1/maaingwe/blob/master/main.go"
click node_attendance_gate "https://github.com/k1m0ch1/maaingwe/blob/master/main.go"
click node_holiday_calendar "https://github.com/k1m0ch1/maaingwe/blob/master/holidays.json"
click node_checkin_action "https://github.com/k1m0ch1/maaingwe/blob/master/main.go"
click node_checkout_action "https://github.com/k1m0ch1/maaingwe/blob/master/main.go"
click node_config_load "https://github.com/k1m0ch1/maaingwe/blob/master/utils/main.go"
click node_config_generate "https://github.com/k1m0ch1/maaingwe/blob/master/utils/main.go"
click node_data_models "https://github.com/k1m0ch1/maaingwe/blob/master/utils/struct.go"
click node_api_client "https://github.com/k1m0ch1/maaingwe/blob/master/utils/main.go"

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_commands,node_login,node_scheduler,node_profile,node_user toneBlue
class node_attendance_gate,node_holiday_calendar,node_checkin_action,node_checkout_action toneAmber
class node_data_models,node_api_client toneMint
class node_config_load,node_config_file,node_config_generate toneRose
class node_darwinbox,node_holiday_source toneIndigo
```

## Components

### CLI workflows

- [Command dispatch](https://github.com/k1m0ch1/maaingwe/blob/master/main.go): `main.go`
- [QR login](https://github.com/k1m0ch1/maaingwe/blob/master/main.go): `main.go`
- [Daily scheduler](https://github.com/k1m0ch1/maaingwe/blob/master/main.go): `main.go`
- [Profile display](https://github.com/k1m0ch1/maaingwe/blob/master/main.go): `main.go`

### Attendance rules

- [Attendance gate](https://github.com/k1m0ch1/maaingwe/blob/master/main.go): `main.go`
- [Holiday calendar](https://github.com/k1m0ch1/maaingwe/blob/master/holidays.json): `holidays.json`
- [Check-in action](https://github.com/k1m0ch1/maaingwe/blob/master/main.go): `main.go`
- [Checkout action](https://github.com/k1m0ch1/maaingwe/blob/master/main.go): `main.go`

### Darwinbox API

- [Request and response models](https://github.com/k1m0ch1/maaingwe/blob/master/utils/struct.go): `utils/struct.go`
- [API client](https://github.com/k1m0ch1/maaingwe/blob/master/utils/main.go): `utils/main.go`

### Configuration

- [Config loading](https://github.com/k1m0ch1/maaingwe/blob/master/utils/main.go): `utils/main.go`
- **User configuration**
- [Config generation](https://github.com/k1m0ch1/maaingwe/blob/master/utils/main.go): `utils/main.go`

### Other components

- **User**
- **Darwinbox service**
- **Holiday data source**

## Connections

- User → Command dispatch: runs commands (evidence: `README.md`)
- Command dispatch → Config loading: loads config (evidence: `main.go`)
- Command dispatch → QR login: dispatches login (evidence: `main.go`)
- Command dispatch → Daily scheduler: starts scheduler (evidence: `main.go`)
- Command dispatch → Profile display: dispatches profile (evidence: `main.go`)
- Command dispatch → Check-in action: runs directly (evidence: `main.go`)
- Command dispatch → Checkout action: runs directly (evidence: `main.go`)
- QR login → API client: submits QR (evidence: `main.go`)
- QR login → Config generation: generates config (evidence: `main.go`)
- Config generation → User configuration: writes config (evidence: `utils/main.go`)
- Config loading → User configuration: reads config (evidence: `utils/main.go`)
- Config generation → Holiday data source: downloads holidays (evidence: `utils/main.go`)
- Config generation → Holiday calendar: writes holidays (evidence: `utils/main.go`)
- Daily scheduler → Attendance gate: schedules checks (evidence: `main.go`)
- Attendance gate → Holiday calendar: reads dates (evidence: `main.go`)
- Attendance gate → Check-in action: runs check-in (evidence: `main.go`)
- Attendance gate → Checkout action: runs checkout (evidence: `main.go`)
- Check-in action → API client: requests check-in (evidence: `main.go`)
- Checkout action → API client: requests check-in ID (evidence: `main.go`)
- Checkout action → API client: submits checkout (evidence: `utils/main.go`)
- Profile display → API client: fetches profile (evidence: `main.go`)
- API client → Darwinbox service: sends API requests (evidence: `utils/main.go`)
- API client → Request and response models: uses data types (evidence: `utils/main.go`)
