# darkarmor616/studyplan architecture

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

- Interactive diagram: https://gitdiagram.com/darkarmor616/studyplan
- Repository: https://github.com/darkarmor616/studyplan

## Overview

1. **Overall shape**
   - This is a single Django monolith called **StudyPlan**.
   - The repository has one Django project package (`studyplan/`) and one main app (`core/`), so the architecture is centralized rather than split into microservices or multiple apps.

2. **Core runtime and framework**
   - The application runs on **Python 3.10+ / Django 4.2**.
   - `manage.py`, `studyplan/settings.py`, `studyplan/urls.py`, and `studyplan/wsgi.py` form the standard Django project boundary.
   - Persistence is handled with **SQLite** in development, with migrations tracked under `core/migrations/`.

3. **Primary domain boundary: `core` app**
   - The `core` app contains the domain logic for the whole product: study planning, disciplines, activities/exams, schedules, study logs, dashboards, and reports.
   - This app is the main architectural unit; there are no separate bounded-context apps in the repository.

4. **User-facing features mapped to subsystems**
   - **Authentication and user onboarding**: registration and login pages (`cadastro.html`, `registro_form.html`, `login.html`).
   - **Discipline management**: discipline CRUD pages (`disciplina_form.html`, `disciplina_lista.html`).
   - **Activities/exams management**: activity/task CRUD pages (`atividade_form.html`, `atividade_lista.html`) with completion and priority support.
   - **Study schedule management**: planning sessions through `cronograma_form.html` and `cronograma_lista.html`.
   - **Study time tracking**: logs and totals via `registro_form.html` and `registro_lista.html`.
   - **Calendar and reporting**: monthly/weekly calendars plus a reports page (`calendario_mensal.html`, `calendario_semanal.html`, `relatorios.html`).

5. **Request flow through the app**
   - Django routes requests from `studyplan/urls.py` into `core/urls.py`.
   - View functions in `core/views.py` coordinate each page: they read/update models, validate input through forms, and choose the template to render.
   - The flow is the classic Django server-side rendering path: browser request → URL dispatcher → view → model/form logic → template response.

6. **Data model and business rules**
   - `core/models.py` is the persistence and domain-rule layer.
   - Based on the README requirements, the models likely represent users, disciplines, activities/provas, study schedules, and time records.
   - Business rules exposed by the app include activity priority, overdue/upcoming reminders, completion state, and total hours studied per discipline.

7. **Forms as the input boundary**
   - `core/forms.py` isolates validation and form structure from the views.
   - This keeps create/edit actions consistent across disciplines, activities, cronogram entries, and time registrations.
   - The architecture suggests a standard Django “model + form + view” pattern rather than custom API endpoints.

8. **Template layer and UI composition**
   - All UI is server-rendered with Django templates under `core/templates/core/`.
   - `base.html` provides the shared layout, while the other templates are feature-specific screens.
   - Bootstrap 5.3 and Bootstrap Icons provide the visual system, so the front end is mostly presentation-focused rather than a separate SPA.

9. **Dashboard, reminders, and calendar as aggregation views**
   - `dashboard.html`, the calendar pages, and `relatorios.html` are aggregation screens rather than simple CRUD forms.
   - These pages likely combine multiple model queries into summarized views: upcoming/late activities, study progress, scheduled sessions, and historical totals.
   - This is the main “analytics” boundary in the app, but it remains inside the monolith.

10. **Operational and deployment boundary**
   - `Procfile`, `railway.json`, `nixpacks.toml`, `runtime.txt`, and `build.sh` show the app is designed for deployment on a platform like **Railway**.
   - The project is built to run as a WSGI web app, not as a background worker system.
   - There is no evidence of external services or message queues; reminders and reports appear to be computed inside Django request handling.

11. **Architectural summary for diagramming**
   - Draw one main web application box containing the Django project and the `core` app.
   - Inside `core`, separate the user interface/templates, request handlers/views, validation/forms, and persistence/models.
   - Show the database as a single SQLite-backed store behind Django ORM.
   - The key business flows are: authentication, discipline CRUD, activity CRUD with reminders and priority, schedule planning, study-hour logging, calendar views, and report aggregation.

Main entry points: [`core/views.py`](https://github.com/darkarmor616/studyplan/blob/main/core/views.py) (views), [`manage.py`](https://github.com/darkarmor616/studyplan/blob/main/manage.py) (manage.py), [`studyplan/settings.py`](https://github.com/darkarmor616/studyplan/blob/main/studyplan/settings.py) (settings), [`Procfile`](https://github.com/darkarmor616/studyplan/tree/main/Procfile) (deploy config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_project["Django project"]
  node_manage["manage.py<br/>entrypoint<br/>[manage.py]"]
  node_settings["settings<br/>config<br/>[settings.py]"]
  node_root_urls["project urls<br/>router<br/>[urls.py]"]
  node_wsgi["wsgi<br/>server<br/>[wsgi.py]"]
end

subgraph group_core["Core app"]
  node_core_urls["core urls<br/>router<br/>[urls.py]"]
  node_views["views<br/>request handlers<br/>[views.py]"]
  node_forms["forms<br/>validation<br/>[forms.py]"]
  node_models[("models<br/>domain model<br/>[models.py]")]
  node_migrations["migrations<br/>schema history<br/>[0001_initial.py]"]
  node_base_tpl["base layout<br/>template shell<br/>[base.html]"]
  node_auth_ui["auth screens<br/>template screens<br/>[login.html]"]
  node_discipline_ui["disciplines<br/>template screens"]
  node_activity_ui["activities<br/>template screens"]
  node_schedule_ui["schedule<br/>template screens"]
  node_logs_ui["study logs<br/>template screens"]
  node_calendar_ui["calendar<br/>template screens"]
  node_reports_ui["reports<br/>template screens<br/>[relatorios.html]"]
end

subgraph group_deploy["Deployment"]
  node_deploy_cfg["deploy config<br/>build/runtime"]
end

node_db[("SQLite DB<br/>database")]

node_manage -->|"loads"| node_settings
node_manage -->|"runs"| node_root_urls
node_wsgi -->|"configures"| node_settings
node_root_urls -->|"routes"| node_core_urls
node_core_urls -->|"dispatches"| node_views
node_views -->|"validates"| node_forms
node_views -->|"reads/writes"| node_models
node_views -->|"renders"| node_base_tpl
node_views -->|"renders"| node_auth_ui
node_views -->|"renders"| node_discipline_ui
node_views -->|"renders"| node_activity_ui
node_views -->|"renders"| node_schedule_ui
node_views -->|"renders"| node_logs_ui
node_views -->|"renders"| node_calendar_ui
node_views -->|"renders"| node_reports_ui
node_models -->|"persists"| node_db
node_migrations -->|"evolves"| node_db
node_settings -->|"configures"| node_db
node_deploy_cfg -->|"starts"| node_wsgi
node_deploy_cfg -.->|"builds"| node_manage

click node_manage "https://github.com/darkarmor616/studyplan/blob/main/manage.py"
click node_settings "https://github.com/darkarmor616/studyplan/blob/main/studyplan/settings.py"
click node_root_urls "https://github.com/darkarmor616/studyplan/blob/main/studyplan/urls.py"
click node_wsgi "https://github.com/darkarmor616/studyplan/blob/main/studyplan/wsgi.py"
click node_core_urls "https://github.com/darkarmor616/studyplan/blob/main/core/urls.py"
click node_views "https://github.com/darkarmor616/studyplan/blob/main/core/views.py"
click node_forms "https://github.com/darkarmor616/studyplan/blob/main/core/forms.py"
click node_models "https://github.com/darkarmor616/studyplan/blob/main/core/models.py"
click node_migrations "https://github.com/darkarmor616/studyplan/blob/main/core/migrations/0001_initial.py"
click node_base_tpl "https://github.com/darkarmor616/studyplan/blob/main/core/templates/core/base.html"
click node_auth_ui "https://github.com/darkarmor616/studyplan/blob/main/core/templates/core/login.html"
click node_discipline_ui "https://github.com/darkarmor616/studyplan/blob/main/core/templates/core/disciplina_lista.html"
click node_activity_ui "https://github.com/darkarmor616/studyplan/blob/main/core/templates/core/atividade_lista.html"
click node_schedule_ui "https://github.com/darkarmor616/studyplan/blob/main/core/templates/core/cronograma_lista.html"
click node_logs_ui "https://github.com/darkarmor616/studyplan/blob/main/core/templates/core/registro_lista.html"
click node_calendar_ui "https://github.com/darkarmor616/studyplan/blob/main/core/templates/core/calendario_mensal.html"
click node_reports_ui "https://github.com/darkarmor616/studyplan/blob/main/core/templates/core/relatorios.html"
click node_deploy_cfg "https://github.com/darkarmor616/studyplan/tree/main/Procfile"

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_manage,node_settings,node_root_urls,node_wsgi toneBlue
class node_core_urls,node_views,node_forms,node_models,node_migrations,node_base_tpl,node_auth_ui,node_discipline_ui,node_activity_ui,node_schedule_ui,node_logs_ui,node_calendar_ui,node_reports_ui toneAmber
class node_deploy_cfg toneMint
class node_db toneNeutral
```

## Components

### Django project

Framework boundary and app wiring

- [manage.py](https://github.com/darkarmor616/studyplan/blob/main/manage.py): entrypoint · Django command entry point · `manage.py`
- [settings](https://github.com/darkarmor616/studyplan/blob/main/studyplan/settings.py): config · Project configuration and installed app wiring · `studyplan/settings.py`
- [project urls](https://github.com/darkarmor616/studyplan/blob/main/studyplan/urls.py): router · Top-level URL dispatcher · `studyplan/urls.py`
- [wsgi](https://github.com/darkarmor616/studyplan/blob/main/studyplan/wsgi.py): server · WSGI application entry · `studyplan/wsgi.py`

### Core app

Domain logic, views, forms, models, and templates

- [core urls](https://github.com/darkarmor616/studyplan/blob/main/core/urls.py): router · App routes for study planning features · `core/urls.py`
- [views](https://github.com/darkarmor616/studyplan/blob/main/core/views.py): request handlers · Page controllers coordinating models, forms, and templates · `core/views.py`
- [forms](https://github.com/darkarmor616/studyplan/blob/main/core/forms.py): validation · Input validation and form definitions · `core/forms.py`
- [models](https://github.com/darkarmor616/studyplan/blob/main/core/models.py): domain model · Persistence and business rules · `core/models.py`
- [migrations](https://github.com/darkarmor616/studyplan/blob/main/core/migrations/0001_initial.py): schema history · Database schema evolution for the core app · `core/migrations/0001_initial.py`
- [base layout](https://github.com/darkarmor616/studyplan/blob/main/core/templates/core/base.html): template shell · Shared page chrome and styling · `core/templates/core/base.html`
- [auth screens](https://github.com/darkarmor616/studyplan/blob/main/core/templates/core/login.html): template screens · Registration and login pages · `core/templates/core/login.html`
- [disciplines](https://github.com/darkarmor616/studyplan/blob/main/core/templates/core/disciplina_lista.html): template screens · Discipline CRUD pages · `core/templates/core/disciplina_lista.html`
- [activities](https://github.com/darkarmor616/studyplan/blob/main/core/templates/core/atividade_lista.html): template screens · Activity and exam management pages · `core/templates/core/atividade_lista.html`
- [schedule](https://github.com/darkarmor616/studyplan/blob/main/core/templates/core/cronograma_lista.html): template screens · Cronograma planning pages · `core/templates/core/cronograma_lista.html`
- [study logs](https://github.com/darkarmor616/studyplan/blob/main/core/templates/core/registro_lista.html): template screens · Study time entry and history pages · `core/templates/core/registro_lista.html`
- [calendar](https://github.com/darkarmor616/studyplan/blob/main/core/templates/core/calendario_mensal.html): template screens · Monthly and weekly calendar views · `core/templates/core/calendario_mensal.html`
- [reports](https://github.com/darkarmor616/studyplan/blob/main/core/templates/core/relatorios.html): template screens · Aggregated progress and summary pages · `core/templates/core/relatorios.html`

### Deployment

Runtime and build configuration

- [deploy config](https://github.com/darkarmor616/studyplan/tree/main/Procfile): build/runtime · Railway and Nixpacks deployment settings · `Procfile`

### Other components

- **SQLite DB**: database · Primary development datastore behind the ORM

## Connections

- manage.py → settings: loads · Management commands use project settings
- manage.py → project urls: runs · Command entry starts the Django app
- wsgi → settings: configures · WSGI app uses project settings
- project urls → core urls: routes · Top-level routes hand off to the core app
- core urls → views: dispatches · URL patterns resolve to page handlers
- views → forms: validates · Create and edit flows use forms
- views → models: reads/writes · Views coordinate persistence and business rules
- views → base layout: renders · All screens share the base layout
- views → auth screens: renders · Authentication and onboarding pages
- views → disciplines: renders · Discipline management pages
- views → activities: renders · Activity and exam management pages
- views → schedule: renders · Cronograma planning pages
- views → study logs: renders · Study log pages
- views → calendar: renders · Calendar aggregation views
- views → reports: renders · Summary and reporting views
- models → SQLite DB: persists · Django ORM stores domain data in SQLite
- migrations → SQLite DB: evolves · Schema changes are applied to the database
- settings → SQLite DB: configures · Database backend is defined in settings
- deploy config → wsgi: starts · Deployment runs the WSGI web process
- deploy config → manage.py: builds · Deployment scripts support Django management and startup
