# pluggnkey/-slackgoogledutynotifications architecture

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

## Overview

Duty Slack Notification Service reads weekday, weekend, vacation, and release schedules from Google Sheets, resolves assignments and substitutions, and returns duty data through a REST API or sends scheduled Slack notifications. The main flow is Django views or the scheduler into DataDutyService, then sheet retrieval, cleanup, holiday-aware assignment mapping, and response or message delivery. The README documents additional monthly/weekend and vacation workflows; sampled code confirms scheduler, API, Google, and Slack ownership, while some internal transformations are only partially excerpted.

Main entry points: [`src/apps/duties/services/service.py`](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/service.py) (Duty service), [`src/apps/duties/services/google_client.py`](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/google_client.py) (Google reader), [`src/apps/duties/views.py`](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/views.py) (REST views), [`src/apps/duties/services/slack_service.py`](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/slack_service.py) (Slack messaging)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_django_urls["Django routes<br/>[urls.py]"]
  node_api_views["REST views<br/>[views.py]"]
  node_scheduler["Duty scheduler<br/>[total_scheduler.py]"]
  node_startup["App startup<br/>[apps.py]"]
end

subgraph group_domain["Duty processing"]
  node_duty_service["Duty service<br/>[service.py]"]
  node_cleanup["Sheet cleanup"]
  node_assignment["Duty substitutions<br/>[data_duty.py]"]
  node_transliteration["Name matching<br/>[transliteration.py]"]
  node_holiday_calendar["Holiday calendar"]
end

subgraph group_integrations["External integrations"]
  node_google_reader["Google reader<br/>[google_client.py]"]
  node_google_writer["Google CRUD<br/>[google_client.py]"]
  node_cache[("Django cache<br/>[settings.py]")]
end

subgraph group_delivery["Notification delivery"]
  node_message_handler["Message formatting<br/>[service.py]"]
  node_slack_sender["Slack messaging<br/>[slack_service.py]"]
end

node_api_user(("API caller"))
node_timer(("Cron timer"))
node_sheets[("Google Sheets")]
node_slack["Slack"]
node_holiday_api["Holiday API"]

node_api_user -->|"requests"| node_django_urls
node_django_urls -->|"dispatches"| node_api_views
node_api_views -->|"requests data"| node_duty_service
node_api_views -->|"CRUD requests"| node_google_writer
node_api_views -->|"refreshes cache"| node_google_reader
node_timer -->|"triggers jobs"| node_scheduler
node_startup -->|"warms cache"| node_google_reader
node_startup -->|"starts"| node_scheduler
node_scheduler -->|"checks vacation"| node_duty_service
node_scheduler -->|"dispatches jobs"| node_slack_sender
node_duty_service -->|"loads schedules"| node_google_reader
node_google_reader -->|"reads sheets"| node_sheets
node_google_reader -->|"reads/writes cache"| node_cache
node_google_writer -->|"updates rows"| node_sheets
node_google_writer -->|"refreshes cache"| node_cache
node_duty_service -->|"cleans data"| node_cleanup
node_duty_service -->|"builds assignments"| node_assignment
node_duty_service -->|"matches names"| node_transliteration
node_duty_service -->|"checks holidays"| node_holiday_calendar
node_holiday_calendar -->|"fetches holidays"| node_holiday_api
node_holiday_calendar -->|"reads/writes cache"| node_cache
node_duty_service -->|"formats notifications"| node_message_handler
node_message_handler -->|"gets duty data"| node_duty_service
node_slack_sender -->|"builds messages"| node_message_handler
node_slack_sender -->|"sends messages"| node_slack
node_slack_sender -->|"reads/writes cache"| node_cache
node_duty_service -->|"fetches member names"| node_slack
node_duty_service -->|"updates assignments"| node_google_writer

click node_django_urls "https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/config/urls.py"
click node_api_views "https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/views.py"
click node_scheduler "https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/scheduler/total_scheduler.py"
click node_startup "https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/apps.py"
click node_duty_service "https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/service.py"
click node_cleanup "https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/clear_data_google.py"
click node_assignment "https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/data_duty.py"
click node_transliteration "https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/transliteration.py"
click node_holiday_calendar "https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/kz_calendar_service.py"
click node_message_handler "https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/service.py"
click node_slack_sender "https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/slack_service.py"
click node_google_reader "https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/google_client.py"
click node_google_writer "https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/google_client.py"
click node_cache "https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/config/settings.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_django_urls,node_api_views,node_scheduler,node_startup toneBlue
class node_duty_service,node_cleanup,node_assignment,node_transliteration,node_holiday_calendar,node_sheets toneAmber
class node_google_reader,node_google_writer,node_cache,node_api_user,node_holiday_api toneMint
class node_message_handler,node_slack_sender toneRose
class node_timer,node_slack toneIndigo
```

## Components

### Entry points

- [Django routes](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/config/urls.py): `src/config/urls.py`
- [REST views](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/views.py): `src/apps/duties/views.py`
- [Duty scheduler](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/scheduler/total_scheduler.py): `src/apps/duties/scheduler/total_scheduler.py`
- [App startup](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/apps.py): `src/apps/duties/apps.py`

### Duty processing

- [Duty service](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/service.py): `src/apps/duties/services/service.py`
- [Sheet cleanup](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/clear_data_google.py): `src/apps/duties/services/clear_data_google.py`
- [Duty substitutions](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/data_duty.py): `src/apps/duties/services/data_duty.py`
- [Name matching](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/transliteration.py): `src/apps/duties/services/transliteration.py`
- [Holiday calendar](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/kz_calendar_service.py): `src/apps/duties/services/kz_calendar_service.py`

### External integrations

- [Google reader](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/google_client.py): `src/apps/duties/services/google_client.py`
- [Google CRUD](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/google_client.py): `src/apps/duties/services/google_client.py`
- [Django cache](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/config/settings.py): `src/config/settings.py`

### Notification delivery

- [Message formatting](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/service.py): `src/apps/duties/services/service.py`
- [Slack messaging](https://github.com/pluggnkey/-slackgoogledutynotifications/blob/main/src/apps/duties/services/slack_service.py): `src/apps/duties/services/slack_service.py`

### Other components

- **API caller**
- **Cron timer**
- **Google Sheets**
- **Slack**
- **Holiday API**

## Connections

- API caller → Django routes: requests
- Django routes → REST views: dispatches
- REST views → Duty service: requests data
- REST views → Google CRUD: CRUD requests
- REST views → Google reader: refreshes cache
- Cron timer → Duty scheduler: triggers jobs
- App startup → Google reader: warms cache
- App startup → Duty scheduler: starts
- Duty scheduler → Duty service: checks vacation
- Duty scheduler → Slack messaging: dispatches jobs
- Duty service → Google reader: loads schedules
- Google reader → Google Sheets: reads sheets
- Google reader → Django cache: reads/writes cache
- Google CRUD → Google Sheets: updates rows
- Google CRUD → Django cache: refreshes cache
- Duty service → Sheet cleanup: cleans data
- Duty service → Duty substitutions: builds assignments
- Duty service → Name matching: matches names
- Duty service → Holiday calendar: checks holidays
- Holiday calendar → Holiday API: fetches holidays
- Holiday calendar → Django cache: reads/writes cache
- Duty service → Message formatting: formats notifications
- Message formatting → Duty service: gets duty data
- Slack messaging → Message formatting: builds messages
- Slack messaging → Slack: sends messages
- Slack messaging → Django cache: reads/writes cache
- Duty service → Slack: fetches member names
- Duty service → Google CRUD: updates assignments
