# arik-0/utell architecture

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

- Interactive diagram: https://gitdiagram.com/arik-0/utell
- Repository: https://github.com/arik-0/utell

## Overview

#### Purpose and deployment shape
U-Tell is a university social platform: students publish experiences, ask career/campus questions, and interact with other users. It is a separate Vue single-page client and PHP Slim API backed by MySQL/MariaDB. The database schema and optional seed data are `u-tell.sql` and `mock_data.sql`.

#### Client application
The Vue 3/Vite client boots from `app/src/main.js`, renders the application root in `app/src/App.vue`, and maps browser navigation through `app/src/router.js`. Its primary user journeys are authentication, feed consumption, post detail, profile, registration, and creating consultas/experiencias, represented in `app/src/views/Login.vue`, `app/src/views/Feed.vue`, and `app/src/views/CreateExperiencia.vue`.

#### Client state and API boundary
Authentication state is centralized at `app/src/store/auth.js`; this is the main client-side boundary for session/identity-dependent navigation and API calls. Views submit and retrieve platform content through the backend rather than directly accessing the database. The client is packaged as a web SPA and includes Capacitor configuration in `app/capacitor.config.json`, indicating potential native mobile wrapping.

#### API entry and HTTP routing
Apache serves the API public root; rewrite behavior is defined in `api/public/.htaccess` and Slim is initialized by `api/public/index.php`. Endpoint groups are separated by domain: authentication in `api/src/rutas/auth.php`, users in `api/src/rutas/usuarios.php`, publications in `api/src/rutas/publicaciones.php`, plus institution and response routes.

#### Service and persistence layers
Route handlers delegate business behavior to services, notably `api/src/Services/AuthService.php`, `api/src/Services/PublicacionService.php`, and `api/src/Services/UsuarioService.php`. Services use repositories as the data-access boundary, including `api/src/Repositories/UsuarioRepository.php`, `api/src/Repositories/PublicacionRepository.php`, and `api/src/Repositories/ConsultaRepository.php`. Database connection/configuration is isolated in `api/src/config/db.php` (with a localhost alternative at `api/src/config/db-localhost.php`).

#### Domain model
The relational model covers identity and authorization (`api/src/Models/Usuario.php`, `api/src/Models/Credencial.php`, `api/src/Models/GrupoPermiso.php`); university structure (`api/src/Models/Universidad.php`, `api/src/Models/Carrera.php`, `api/src/Models/Sede.php`); and social content (`api/src/Models/Publicacion.php`, `api/src/Models/Experiencia.php`, `api/src/Models/Consulta.php`). Interaction and traceability include comments, friendships, and auditing through `api/src/Models/Comentario.php`, `api/src/Models/Amistad.php`, and `api/src/Models/Auditoria.php`.

#### End-to-end flow
A browser or Capacitor-hosted client navigates to a Vue view, reads auth state, and calls a Slim route. The route invokes its service, which applies domain logic and queries/updates MySQL through repositories/models; the API returns data to update view state. Authentication is the primary cross-cutting gate, while publication, consultation/response, user, and institution domains remain separated at route/service/repository boundaries.

Main entry points: [`api/src/Services/PublicacionService.php`](https://github.com/arik-0/utell/blob/main/api/src/Services/PublicacionService.php) (Domain services), [`app/src/views/Feed.vue`](https://github.com/arik-0/utell/blob/main/app/src/views/Feed.vue) (User journeys), [`api/public/index.php`](https://github.com/arik-0/utell/blob/main/api/public/index.php) (Slim entry point), [`api/src/Repositories/PublicacionRepository.php`](https://github.com/arik-0/utell/blob/main/api/src/Repositories/PublicacionRepository.php) (Repositories)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Vue client"]
  node_spa["Vue SPA<br/>client application<br/>[main.js]"]
  node_app_root["Application root<br/>Vue root<br/>[App.vue]"]
  node_router["Browser routes<br/>Vue router<br/>[router.js]"]
  node_views["User journeys<br/>Vue views<br/>[Feed.vue]"]
  node_auth_store["Auth state<br/>client store<br/>[auth.js]"]
  node_capacitor["Native wrapper config<br/>Capacitor config"]
end

subgraph group_api["Slim API"]
  node_apache["Apache rewrite<br/>web server config<br/>[.htaccess]"]
  node_slim["Slim entry point<br/>HTTP application<br/>[index.php]"]
  node_auth_routes["Authentication routes<br/>Slim routes<br/>[auth.php]"]
  node_domain_routes["Platform routes<br/>Slim routes<br/>[publicaciones.php]"]
  node_services["Domain services<br/>service layer"]
end

subgraph group_data["Persistence"]
  node_repositories["Repositories<br/>data-access layer"]
  node_db_config["Database connection<br/>database config<br/>[db.php]"]
  node_domain_models["Domain model<br/>PHP models<br/>[Usuario.php]"]
  node_database[("MySQL / MariaDB<br/>relational database<br/>[u-tell.sql]")]
  node_seed_data["Optional mock data<br/>database seed<br/>[mock_data.sql]"]
end

node_spa -->|"boots"| node_app_root
node_app_root -->|"renders navigation"| node_router
node_router -->|"selects view"| node_views
node_views -->|"reads session"| node_auth_store
node_spa -.->|"can be wrapped by"| node_capacitor
node_views -->|"API requests"| node_apache
node_auth_store -->|"authenticated calls"| node_apache
node_apache -->|"rewrites to"| node_slim
node_slim -->|"registers"| node_auth_routes
node_slim -->|"registers"| node_domain_routes
node_auth_routes -->|"delegates"| node_services
node_domain_routes -->|"delegates"| node_services
node_services -->|"queries and updates"| node_repositories
node_services -->|"applies domain logic"| node_domain_models
node_repositories -->|"uses connection"| node_db_config
node_repositories -->|"maps entities"| node_domain_models
node_db_config -->|"connects to"| node_database
node_seed_data -.->|"optionally populates"| node_database

click node_spa "https://github.com/arik-0/utell/blob/main/app/src/main.js"
click node_app_root "https://github.com/arik-0/utell/blob/main/app/src/App.vue"
click node_router "https://github.com/arik-0/utell/blob/main/app/src/router.js"
click node_views "https://github.com/arik-0/utell/blob/main/app/src/views/Feed.vue"
click node_auth_store "https://github.com/arik-0/utell/blob/main/app/src/store/auth.js"
click node_capacitor "https://github.com/arik-0/utell/blob/main/app/capacitor.config.json"
click node_apache "https://github.com/arik-0/utell/blob/main/api/public/.htaccess"
click node_slim "https://github.com/arik-0/utell/blob/main/api/public/index.php"
click node_auth_routes "https://github.com/arik-0/utell/blob/main/api/src/rutas/auth.php"
click node_domain_routes "https://github.com/arik-0/utell/blob/main/api/src/rutas/publicaciones.php"
click node_services "https://github.com/arik-0/utell/blob/main/api/src/Services/PublicacionService.php"
click node_repositories "https://github.com/arik-0/utell/blob/main/api/src/Repositories/PublicacionRepository.php"
click node_db_config "https://github.com/arik-0/utell/blob/main/api/src/config/db.php"
click node_domain_models "https://github.com/arik-0/utell/blob/main/api/src/Models/Usuario.php"
click node_database "https://github.com/arik-0/utell/blob/main/u-tell.sql"
click node_seed_data "https://github.com/arik-0/utell/blob/main/mock_data.sql"

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_spa,node_app_root,node_router,node_views,node_auth_store,node_capacitor toneBlue
class node_apache,node_slim,node_auth_routes,node_domain_routes,node_services toneAmber
class node_repositories,node_db_config,node_domain_models,node_database,node_seed_data toneMint
```

## Components

### Vue client

- [Vue SPA](https://github.com/arik-0/utell/blob/main/app/src/main.js): client application · Browser and Capacitor-hosted social platform client. · `app/src/main.js`
- [Application root](https://github.com/arik-0/utell/blob/main/app/src/App.vue): Vue root · `app/src/App.vue`
- [Browser routes](https://github.com/arik-0/utell/blob/main/app/src/router.js): Vue router · `app/src/router.js`
- [User journeys](https://github.com/arik-0/utell/blob/main/app/src/views/Feed.vue): Vue views · Login, feed, post creation, profile, and registration flows. · `app/src/views/Feed.vue`
- [Auth state](https://github.com/arik-0/utell/blob/main/app/src/store/auth.js): client store · Session and identity boundary for navigation and API calls. · `app/src/store/auth.js`
- [Native wrapper config](https://github.com/arik-0/utell/blob/main/app/capacitor.config.json): Capacitor config · `app/capacitor.config.json`

### Slim API

- [Apache rewrite](https://github.com/arik-0/utell/blob/main/api/public/.htaccess): web server config · Routes API requests to Slim's public entry point. · `api/public/.htaccess`
- [Slim entry point](https://github.com/arik-0/utell/blob/main/api/public/index.php): HTTP application · `api/public/index.php`
- [Authentication routes](https://github.com/arik-0/utell/blob/main/api/src/rutas/auth.php): Slim routes · `api/src/rutas/auth.php`
- [Platform routes](https://github.com/arik-0/utell/blob/main/api/src/rutas/publicaciones.php): Slim routes · User, publication, institution, consultation, and response endpoints. · `api/src/rutas/publicaciones.php`
- [Domain services](https://github.com/arik-0/utell/blob/main/api/src/Services/PublicacionService.php): service layer · Authentication, publication, and user business behavior. · `api/src/Services/PublicacionService.php`

### Persistence

- [Repositories](https://github.com/arik-0/utell/blob/main/api/src/Repositories/PublicacionRepository.php): data-access layer · User, publication, and consultation persistence boundary. · `api/src/Repositories/PublicacionRepository.php`
- [Database connection](https://github.com/arik-0/utell/blob/main/api/src/config/db.php): database config · `api/src/config/db.php`
- [Domain model](https://github.com/arik-0/utell/blob/main/api/src/Models/Usuario.php): PHP models · Identity, university structure, social content, interactions, and auditing. · `api/src/Models/Usuario.php`
- [MySQL / MariaDB](https://github.com/arik-0/utell/blob/main/u-tell.sql): relational database · Platform data and authorization state. · `u-tell.sql`
- [Optional mock data](https://github.com/arik-0/utell/blob/main/mock_data.sql): database seed · `mock_data.sql`

## Connections

- Vue SPA → Application root: boots
- Application root → Browser routes: renders navigation
- Browser routes → User journeys: selects view
- User journeys → Auth state: reads session
- Vue SPA → Native wrapper config: can be wrapped by
- User journeys → Apache rewrite: API requests
- Auth state → Apache rewrite: authenticated calls
- Apache rewrite → Slim entry point: rewrites to
- Slim entry point → Authentication routes: registers
- Slim entry point → Platform routes: registers
- Authentication routes → Domain services: delegates
- Platform routes → Domain services: delegates
- Domain services → Repositories: queries and updates
- Domain services → Domain model: applies domain logic
- Repositories → Database connection: uses connection
- Repositories → Domain model: maps entities
- Database connection → MySQL / MariaDB: connects to
- Optional mock data → MySQL / MariaDB: optionally populates
