# rafaelsisoares/o_assist architecture

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

- Interactive diagram: https://gitdiagram.com/rafaelsisoares/o_assist
- Repository: https://github.com/rafaelsisoares/o_assist

## Overview

O-Assist is a Portuguese personal-assistant web app: users register or log in, then send chat messages and receive time, weather, or AI-generated replies. The Django front end stores chat messages and retrieves them through an authenticated REST API; the API also exposes people and tasks. Internal layers include forms, API serializers, and persistent models. The README is empty, so capabilities are based on the sampled source and indexed modules; task-helper behavior is not fully shown.

Main entry points: [`front/views.py`](https://github.com/rafaelsisoares/o_assist/blob/master/front/views.py) (Web views), [`api/views.py`](https://github.com/rafaelsisoares/o_assist/blob/master/api/views.py) (API viewsets), [`api/models.py`](https://github.com/rafaelsisoares/o_assist/blob/master/api/models.py) (People and messages), [`api/serializers.py`](https://github.com/rafaelsisoares/o_assist/blob/master/api/serializers.py) (API serializers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_web_views["Web views<br/>[views.py]"]
  node_web_routes["Web routes<br/>[urls.py]"]
  node_web_templates["Chat and account pages"]
  node_forms["User and message forms<br/>[forms.py]"]
  node_auth_tokens["JWT token endpoints<br/>[urls.py]"]
  node_web_settings["Django configuration<br/>[settings.py]"]
end

subgraph group_assistant["Assistant responses"]
  node_assistant_rules["Reply selection<br/>[views.py]"]
  node_time_reply["Current time<br/>[current_time.py]"]
  node_weather_reply["Weather lookup<br/>[weather.py]"]
  node_ai_reply["AI text generation<br/>[views.py]"]
  node_format_reply["Markdown formatting<br/>[messages.py]"]
end

subgraph group_api["REST API"]
  node_api_routes["API routes<br/>[urls.py]"]
  node_api_views["API viewsets<br/>[views.py]"]
  node_serializers["API serializers<br/>[serializers.py]"]
end

subgraph group_data["Domain data"]
  node_domain_models[("People and messages<br/>[models.py]")]
  node_task_models[("Task records<br/>[models.py]")]
  node_task_helper["Task helper<br/>[tasks.py]"]
end

node_visitor(("User"))
node_weather_service{{"OpenWeatherMap"}}
node_genai_service{{"Google Gemini"}}

node_visitor -->|"uses"| node_web_views
node_web_routes -->|"routes to"| node_web_views
node_web_views -->|"renders"| node_web_templates
node_web_views -->|"validates with"| node_forms
node_web_views -->|"requests tokens"| node_auth_tokens
node_web_views -->|"requests messages"| node_api_routes
node_api_routes -->|"routes to"| node_api_views
node_api_views -->|"serializes with"| node_serializers
node_api_views -->|"queries"| node_domain_models
node_api_views -->|"queries"| node_task_models
node_serializers -->|"serializes"| node_domain_models
node_serializers -->|"serializes"| node_task_models
node_web_views -->|"creates records"| node_domain_models
node_web_views -->|"selects reply"| node_assistant_rules
node_assistant_rules -->|"calls"| node_time_reply
node_assistant_rules -->|"calls"| node_weather_reply
node_assistant_rules -->|"calls"| node_ai_reply
node_web_views -->|"formats reply"| node_format_reply
node_weather_reply -->|"queries forecast"| node_weather_service
node_ai_reply -->|"generates text"| node_genai_service
node_task_helper -.->|"imports model"| node_task_models
node_web_settings -->|"configures database"| node_domain_models

click node_web_views "https://github.com/rafaelsisoares/o_assist/blob/master/front/views.py"
click node_web_routes "https://github.com/rafaelsisoares/o_assist/blob/master/front/urls.py"
click node_web_templates "https://github.com/rafaelsisoares/o_assist/tree/master/front/templates"
click node_forms "https://github.com/rafaelsisoares/o_assist/blob/master/front/forms.py"
click node_auth_tokens "https://github.com/rafaelsisoares/o_assist/blob/master/o_assist/urls.py"
click node_api_routes "https://github.com/rafaelsisoares/o_assist/blob/master/api/urls.py"
click node_api_views "https://github.com/rafaelsisoares/o_assist/blob/master/api/views.py"
click node_serializers "https://github.com/rafaelsisoares/o_assist/blob/master/api/serializers.py"
click node_assistant_rules "https://github.com/rafaelsisoares/o_assist/blob/master/front/views.py"
click node_time_reply "https://github.com/rafaelsisoares/o_assist/blob/master/front/utils/current_time.py"
click node_weather_reply "https://github.com/rafaelsisoares/o_assist/blob/master/front/utils/weather.py"
click node_ai_reply "https://github.com/rafaelsisoares/o_assist/blob/master/AI/views.py"
click node_format_reply "https://github.com/rafaelsisoares/o_assist/blob/master/front/utils/messages.py"
click node_domain_models "https://github.com/rafaelsisoares/o_assist/blob/master/api/models.py"
click node_task_models "https://github.com/rafaelsisoares/o_assist/blob/master/api/models.py"
click node_task_helper "https://github.com/rafaelsisoares/o_assist/blob/master/front/utils/tasks.py"
click node_web_settings "https://github.com/rafaelsisoares/o_assist/blob/master/o_assist/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_web_views,node_web_routes,node_web_templates,node_forms,node_auth_tokens,node_web_settings,node_visitor toneBlue
class node_assistant_rules,node_time_reply,node_weather_reply,node_ai_reply,node_format_reply toneAmber
class node_api_routes,node_api_views,node_serializers toneMint
class node_domain_models,node_task_models,node_task_helper toneRose
class node_weather_service,node_genai_service toneIndigo
```

## Components

### Web experience

- [Web views](https://github.com/rafaelsisoares/o_assist/blob/master/front/views.py): `front/views.py`
- [Web routes](https://github.com/rafaelsisoares/o_assist/blob/master/front/urls.py): `front/urls.py`
- [Chat and account pages](https://github.com/rafaelsisoares/o_assist/tree/master/front/templates): `front/templates`
- [User and message forms](https://github.com/rafaelsisoares/o_assist/blob/master/front/forms.py): `front/forms.py`
- [JWT token endpoints](https://github.com/rafaelsisoares/o_assist/blob/master/o_assist/urls.py): `o_assist/urls.py`
- [Django configuration](https://github.com/rafaelsisoares/o_assist/blob/master/o_assist/settings.py): `o_assist/settings.py`

### Assistant responses

- [Reply selection](https://github.com/rafaelsisoares/o_assist/blob/master/front/views.py): `front/views.py`
- [Current time](https://github.com/rafaelsisoares/o_assist/blob/master/front/utils/current_time.py): `front/utils/current_time.py`
- [Weather lookup](https://github.com/rafaelsisoares/o_assist/blob/master/front/utils/weather.py): `front/utils/weather.py`
- [AI text generation](https://github.com/rafaelsisoares/o_assist/blob/master/AI/views.py): `AI/views.py`
- [Markdown formatting](https://github.com/rafaelsisoares/o_assist/blob/master/front/utils/messages.py): `front/utils/messages.py`

### REST API

- [API routes](https://github.com/rafaelsisoares/o_assist/blob/master/api/urls.py): `api/urls.py`
- [API viewsets](https://github.com/rafaelsisoares/o_assist/blob/master/api/views.py): `api/views.py`
- [API serializers](https://github.com/rafaelsisoares/o_assist/blob/master/api/serializers.py): `api/serializers.py`

### Domain data

- [People and messages](https://github.com/rafaelsisoares/o_assist/blob/master/api/models.py): `api/models.py`
- [Task records](https://github.com/rafaelsisoares/o_assist/blob/master/api/models.py): `api/models.py`
- [Task helper](https://github.com/rafaelsisoares/o_assist/blob/master/front/utils/tasks.py): `front/utils/tasks.py`

### Other components

- **User**
- **OpenWeatherMap**
- **Google Gemini**

## Connections

- User → Web views: uses (evidence: `front/views.py`)
- Web routes → Web views: routes to (evidence: `front/urls.py`)
- Web views → Chat and account pages: renders (evidence: `front/views.py`)
- Web views → User and message forms: validates with (evidence: `front/views.py`)
- Web views → JWT token endpoints: requests tokens (evidence: `front/views.py`)
- Web views → API routes: requests messages (evidence: `front/views.py`)
- API routes → API viewsets: routes to (evidence: `api/urls.py`)
- API viewsets → API serializers: serializes with (evidence: `api/views.py`)
- API viewsets → People and messages: queries (evidence: `api/views.py`)
- API viewsets → Task records: queries (evidence: `api/views.py`)
- API serializers → People and messages: serializes (evidence: `api/serializers.py`)
- API serializers → Task records: serializes (evidence: `api/serializers.py`)
- Web views → People and messages: creates records (evidence: `front/views.py`)
- Web views → Reply selection: selects reply (evidence: `front/views.py`)
- Reply selection → Current time: calls (evidence: `front/views.py`)
- Reply selection → Weather lookup: calls (evidence: `front/views.py`)
- Reply selection → AI text generation: calls (evidence: `front/views.py`)
- Web views → Markdown formatting: formats reply (evidence: `front/views.py`)
- Weather lookup → OpenWeatherMap: queries forecast (evidence: `front/utils/weather.py`)
- AI text generation → Google Gemini: generates text (evidence: `AI/views.py`)
- Task helper → Task records: imports model (evidence: `front/utils/tasks.py`)
- Django configuration → People and messages: configures database (evidence: `o_assist/settings.py`)
