# lllnightlll/altu-server architecture

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

- Interactive diagram: https://gitdiagram.com/lllnightlll/altu-server
- Repository: https://github.com/lllnightlll/altu-server

## Overview

altu-server appears to be a Kotlin server for user registration and queued-message exchange, with Ed25519 authentication and database-backed persistence. The likely workflow is a client request entering the application, passing authentication, then using repositories to store or retrieve users and messages; a cleanup job handles delivered messages. The README only names the project, and no runtime source was excerpted, so these connections are tentative and shown as unverified rather than asserted calls.

Main entry points: [`src/main/kotlin/com/example/Application.kt`](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/Application.kt) (Application), [`src/main/kotlin/com/example/database/repository/MessageQueueRepository.kt`](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/repository/MessageQueueRepository.kt) (Message Repository), [`src/main/kotlin/com/example/database/DatabaseManager.kt`](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/DatabaseManager.kt) (Database Manager), [`src/main/kotlin/com/example/database/repository/UserRepository.kt`](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/repository/UserRepository.kt) (User Repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Server API"]
  node_application["Application<br/>[Application.kt]"]
  node_request_models["Request Models"]
end

subgraph group_identity["Identity"]
  node_ed25519["Ed25519 Auth<br/>[Ed25519.kt]"]
  node_user_model["User Model<br/>[User.kt]"]
  node_user_repository["User Repository<br/>[UserRepository.kt]"]
  node_users_table[("Users Table<br/>[UsersTable.kt]")]
end

subgraph group_storage["Persistence"]
  node_db_settings["Database Settings"]
  node_env_loader["Environment Loader<br/>[EnvLoader.kt]"]
  node_db_manager["Database Manager<br/>[DatabaseManager.kt]"]
end

subgraph group_lifecycle["Queue Lifecycle"]
  node_message_repository["Message Repository"]
  node_messages_table[("Queue Table")]
  node_queued_message["Queued Message<br/>[QueuedMessage.kt]"]
  node_message_dto["Message DTO"]
  node_cleanup_job["Cleanup Job"]
end

node_client(("Client"))
node_postgres[("PostgreSQL")]

node_client -.->|"sends requests"| node_application
node_application -.->|"accepts payloads"| node_request_models
node_application -.->|"authenticates"| node_ed25519
node_application -.->|"registers users"| node_user_repository
node_application -.->|"handles messages"| node_message_repository
node_user_repository -.->|"persists users"| node_users_table
node_message_repository -.->|"persists messages"| node_messages_table
node_message_repository -.->|"uses records"| node_queued_message
node_message_repository -.->|"returns messages"| node_message_dto
node_cleanup_job -.->|"cleans deliveries"| node_message_repository
node_db_manager -.->|"connects to"| node_postgres
node_db_manager -.->|"uses settings"| node_db_settings
node_env_loader -.->|"loads configuration"| node_db_settings
node_db_manager -.->|"initializes schema"| node_users_table
node_db_manager -.->|"initializes schema"| node_messages_table

click node_application "https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/Application.kt"
click node_request_models "https://github.com/lllnightlll/altu-server/tree/main/src/main/kotlin/com/example/database/model"
click node_ed25519 "https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/auth/Ed25519.kt"
click node_user_model "https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/model/User.kt"
click node_db_settings "https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/config/DatabaseSettings.kt"
click node_env_loader "https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/config/EnvLoader.kt"
click node_db_manager "https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/DatabaseManager.kt"
click node_user_repository "https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/repository/UserRepository.kt"
click node_users_table "https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/table/UsersTable.kt"
click node_message_repository "https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/repository/MessageQueueRepository.kt"
click node_messages_table "https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/table/MessagesQueueTable.kt"
click node_queued_message "https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/model/QueuedMessage.kt"
click node_message_dto "https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/model/QueuedMessageDto.kt"
click node_cleanup_job "https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/jobs/DeliveredMessagesCleanupJob.kt"

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_application,node_request_models,node_client toneBlue
class node_ed25519,node_user_model,node_user_repository,node_users_table,node_postgres toneAmber
class node_db_settings,node_env_loader,node_db_manager toneMint
class node_message_repository,node_messages_table,node_queued_message,node_message_dto,node_cleanup_job toneRose
```

## Components

### Server API

- [Application](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/Application.kt): `src/main/kotlin/com/example/Application.kt`
- [Request Models](https://github.com/lllnightlll/altu-server/tree/main/src/main/kotlin/com/example/database/model): `src/main/kotlin/com/example/database/model`

### Identity

- [Ed25519 Auth](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/auth/Ed25519.kt): `src/main/kotlin/com/example/auth/Ed25519.kt`
- [User Model](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/model/User.kt): `src/main/kotlin/com/example/database/model/User.kt`
- [User Repository](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/repository/UserRepository.kt): `src/main/kotlin/com/example/database/repository/UserRepository.kt`
- [Users Table](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/table/UsersTable.kt): `src/main/kotlin/com/example/database/table/UsersTable.kt`

### Persistence

- [Database Settings](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/config/DatabaseSettings.kt): `src/main/kotlin/com/example/config/DatabaseSettings.kt`
- [Environment Loader](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/config/EnvLoader.kt): `src/main/kotlin/com/example/config/EnvLoader.kt`
- [Database Manager](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/DatabaseManager.kt): `src/main/kotlin/com/example/database/DatabaseManager.kt`

### Queue Lifecycle

- [Message Repository](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/repository/MessageQueueRepository.kt): `src/main/kotlin/com/example/database/repository/MessageQueueRepository.kt`
- [Queue Table](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/table/MessagesQueueTable.kt): `src/main/kotlin/com/example/database/table/MessagesQueueTable.kt`
- [Queued Message](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/model/QueuedMessage.kt): `src/main/kotlin/com/example/database/model/QueuedMessage.kt`
- [Message DTO](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/database/model/QueuedMessageDto.kt): `src/main/kotlin/com/example/database/model/QueuedMessageDto.kt`
- [Cleanup Job](https://github.com/lllnightlll/altu-server/blob/main/src/main/kotlin/com/example/jobs/DeliveredMessagesCleanupJob.kt): `src/main/kotlin/com/example/jobs/DeliveredMessagesCleanupJob.kt`

### Other components

- **Client**
- **PostgreSQL**

## Connections

- Client → Application: sends requests
- Application → Request Models: accepts payloads
- Application → Ed25519 Auth: authenticates
- Application → User Repository: registers users
- Application → Message Repository: handles messages
- User Repository → Users Table: persists users
- Message Repository → Queue Table: persists messages
- Message Repository → Queued Message: uses records
- Message Repository → Message DTO: returns messages
- Cleanup Job → Message Repository: cleans deliveries
- Database Manager → PostgreSQL: connects to
- Database Manager → Database Settings: uses settings
- Environment Loader → Database Settings: loads configuration
- Database Manager → Users Table: initializes schema
- Database Manager → Queue Table: initializes schema
