tous les projets

OAPI

OAPI is a high-performance, asynchronous orchestration API built with Rust. It serves as the backbone logic for the Antre des Loutres community, handling complex image generation, real-time infrastructure monitoring, and external API integration.

Statut
en cours
Contribution
91 commits
Type
Api rest
Stack
Rust
Version
v0.4.1 (pré-release)
Début
mai 2026
Dernière activité
juill. 2026

OAPI is a high-performance, asynchronous orchestration API built with Rust. It serves as the backbone logic for the Antre des Loutres community, handling complex image generation, real-time infrastructure monitoring, and external API integration.


Core Features

Dynamic Image Generation

Generate high-fidelity profile summary cards for Discord and Minecraft.

  • Smart Caching: Uses SHA-256 state hashing to avoid redundant generation.
  • Real-time Stats: Aggregates messaging activity, voice time, and Minecraft gameplay (playtime, distance, blocks).
  • Rich Aesthetics: Custom font rendering, dynamic color pills, and automated avatar retrieval (Discord & Minecraft heads).

Infrastructure Monitoring

Real-time health tracking for the entire community ecosystem.

  • Multi-protocol: Supports HTTP(S) and Minecraft (TCP/SLP) status pings.
  • Concurrent Checks: All services are polled in parallel for sub-second response times.
  • Live Dashboard: A minimalist, modern web interface included.

PocketBase Integration

A robust data layer powered by PocketBase.

  • Admin Auth: Secure and automated administrative access to collections.
  • Exhaustive Fetching: Custom pagination logic to retrieve complete historical data.
  • Automatic Documentation: Fully compliant OpenAPI 3.0 spec generated via utoipa.

Architecture

OAPI follows a strictly decoupled, layered architecture to ensure maintainability and testability:

Layer Responsibility
Handlers HTTP entry points, parameter extraction, and status codes.
Actions Use-case orchestration and external data fetching.
Services Pure business logic and computationally intensive tasks.
Models Strictly typed DTOs and OpenAPI schema definitions.
Utils Generic HTTP fetchers, formatters, and global constants.

Configuration

The system uses a hierarchical YAML configuration management system.

  1. default_config.yaml: The source of truth. Contains all default values and mandatory structure. (Committed to Git).
  2. config.yaml: Local overrides for environment-specific settings (local URLs, secret keys). (Ignored by Git).

On first run, the application automatically generates a config.yaml template if it is missing.


Getting Started

git clone https://github.com/matheo-1712/OAPI.git cd OAPI

cargo run


### Accessing the API
- **Swagger UI**: [http://localhost:3000/swagger-ui](http://localhost:3000/swagger-ui)
- **Monitoring Dashboard**: [http://localhost:3000/monitoring.html](http://localhost:3000/monitoring.html)

---

## Development & Quality

We maintain a **Zero Warnings Policy**. Every contribution must pass strict CI/CD checks.

### Pre-commit Workflow
Before pushing, ensure your code meets the quality standards:
```bash
cargo fmt

cargo clippy --all-targets --all-features -- -D warnings

cargo test --all-features

Documentation

Deep dives into specific modules:


Tech Stack

  • Axum: Asynchronous web framework.
  • Tokio: Multi-threaded runtime.
  • Utoipa: Automatic OpenAPI documentation.
  • Image-rs: Native image processing.
  • Reqwest: Type-safe HTTP client.
  • Tracing: Structured diagnostic logging.

Built by matheo-1712