# ciwga/atilimu architecture

> Architecture diagram of the GitHub repository ciwga/atilimu, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ciwga/atilimu
- Repository: https://github.com/ciwga/atilimu

## Overview

##### Project type and purpose
- This is a Python-based CLI tool (“ATILIM UNIVERSITY STUDENT SYSTEM”) that aggregates and downloads data from multiple university web services (ATACS, Moodle, UNACS, curriculum, profile, KVKK forms) and persists it on the local filesystem. It is not a full-stack web app but a modular command-line client.

##### File structure
- Top-level:
- main.py: the CLI entry point and orchestrator
- requirements.txt & LICENSE
- tools/ package (modular service clients and support code):
- atacs.py, moodle.py, unacs.py, curriculum.py, profile.py, kiyos_auth.py
- config.py: app configuration (API endpoints, credentials, storage paths)
- helpers.py & exceptions.py: shared routines (HTTP session management, error classes)

##### README for additional insights
- Describes eight “features” (personal info, ATACS messages, Moodle announcements & docs, electives, pay table, KVKK, graduation photos)
- Persists data under atilim_data/<service> directories
- Uses HTTP sessions, cookie management, and supports many file types

##### Main components
a. CLI Layer:
- main.py
- User Input / Menu System
b. Core Modules:
- tools/config.py
- tools/helpers.py & tools/exceptions.py
c. Service Connectors:
- tools/kiyos_auth.py (shared authentication)
- tools/atacs.py
- tools/moodle.py
- tools/unacs.py
- tools/curriculum.py
- tools/profile.py
d. External Systems:
- ATACS Web Service
- Moodle LMS
- UNACS Course Catalog
- KVKK Form Service
e. Local Data Store:
- atilim_data/ (with subfolders: university_profile, atacs, moodle, unacs, …)

##### Relationships and interactions
- User → CLI (main.py)
- main.py reads config → initializes HTTP session via helpers & kiyos_auth
- service modules call external APIs (ATACS, Moodle, UNACS, etc.)
- responses are parsed, exceptions handled, then saved into atilim_data/
- helpers handle file I/O and request retries, exceptions manage error flows

##### Architectural patterns and design principles
- Modular service-connector pattern: each “tools/*.py” handles one API
- Single responsibility: config, auth, HTTP helpers separated
- File-system persistence layer: all outputs normalized under atilim_data
- CLI application pattern: menu → command → service call → save

##### Relevant technologies
- Python 3.x
- requests (HTTP client, cookie management)
- argparse or simple input() loops in main.py
- Local filesystem I/O (os, pathlib)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User and CLI
    User(("User")):::external
    CLI["CLI (main.py)"]:::internal
    User -->|"selects option"| CLI
    click CLI "https://github.com/ciwga/atilimu/blob/master/main.py"

    %% Core Modules
    subgraph "Core Modules"
        Config["Config (tools/config.py)"]:::internal
        Helpers["HTTP Helpers (tools/helpers.py)"]:::utility
        Exceptions["Exceptions (tools/exceptions.py)"]:::utility
    end
    CLI -->|"load config"| Config
    CLI -->|"init HTTP session"| Helpers
    CLI -->|"error handling"| Exceptions
    click Config "https://github.com/ciwga/atilimu/blob/master/tools/config.py"
    click Helpers "https://github.com/ciwga/atilimu/blob/master/tools/helpers.py"
    click Exceptions "https://github.com/ciwga/atilimu/blob/master/tools/exceptions.py"

    %% Authentication
    Auth["Auth Service (tools/kiyos_auth.py)"]:::internal
    CLI -->|"authenticate"| Auth
    Auth -->|"use helpers"| Helpers
    click Auth "https://github.com/ciwga/atilimu/blob/master/tools/kiyos_auth.py"

    %% Service Connectors
    subgraph "Service Connectors"
        Atacs["ATACS Connector"]:::internal
        Moodle["Moodle Connector"]:::internal
        UNACS["UNACS Connector"]:::internal
        Curriculum["Curriculum Connector"]:::internal
        Profile["Profile Connector"]:::internal
    end
    CLI -->|"invoke ATACS"| Atacs
    CLI -->|"invoke Moodle"| Moodle
    CLI -->|"invoke UNACS"| UNACS
    CLI -->|"invoke Curriculum"| Curriculum
    CLI -->|"invoke Profile"| Profile
    Atacs -->|"use helpers"| Helpers
    Moodle -->|"use helpers"| Helpers
    UNACS -->|"use helpers"| Helpers
    Curriculum -->|"use helpers"| Helpers
    Profile -->|"use helpers"| Helpers
    Atacs -->|"error"| Exceptions
    Moodle -->|"error"| Exceptions
    UNACS -->|"error"| Exceptions
    Curriculum -->|"error"| Exceptions
    Profile -->|"error"| Exceptions
    click Atacs "https://github.com/ciwga/atilimu/blob/master/tools/atacs.py"
    click Moodle "https://github.com/ciwga/atilimu/blob/master/tools/moodle.py"
    click UNACS "https://github.com/ciwga/atilimu/blob/master/tools/unacs.py"
    click Curriculum "https://github.com/ciwga/atilimu/blob/master/tools/curriculum.py"
    click Profile "https://github.com/ciwga/atilimu/blob/master/tools/profile.py"

    %% External Systems
    subgraph "External Systems"
        ATACSWS["ATACS Web Service"]:::external
        MoodleLMS["Moodle LMS"]:::external
        UNACSWS["UNACS Course Catalog"]:::external
        KVKKWS["KVKK Form Service"]:::external
    end
    Atacs -->|"HTTP GET/POST"| ATACSWS
    Moodle -->|"HTTP GET/POST"| MoodleLMS
    UNACS -->|"HTTP GET/POST"| UNACSWS
    Profile -->|"HTTP GET/POST"| KVKKWS

    %% Local Data Store
    Storage["Local Data Store\natilim_data/"]:::storage
    Atacs -->|"save to atilim_data/atacs"| Storage
    Moodle -->|"save to atilim_data/moodle"| Storage
    UNACS -->|"save to atilim_data/unacs"| Storage
    Curriculum -->|"save to atilim_data/curriculum"| Storage
    Profile -->|"save to atilim_data/university_profile"| Storage

    %% Project Metadata
    subgraph "Project Files"
        Req["requirements.txt"]:::internal
        Lic["LICENSE"]:::internal
        Readme["README.md"]:::internal
    end
    click Req "https://github.com/ciwga/atilimu/blob/master/requirements.txt"
    click Lic "https://github.com/ciwga/atilimu/tree/master/LICENSE"
    click Readme "https://github.com/ciwga/atilimu/blob/master/README.md"

    %% Styles
    classDef internal fill:#D0E8FF,stroke:#0366d6,stroke-width:1px;
    classDef utility fill:#FFFFFF,stroke:#FFA500,stroke-dasharray: 5 5;
    classDef external fill:#E6FFED,stroke:#1A7F37,stroke-width:1px;
    classDef storage fill:#FFF5B1,stroke:#D69E2E,stroke-width:1px;
```
