How kaiofelps/samambaia-api works
Project type and purpose
• Project type: A monolithic backend API (Rust) implementing Clean Architecture principles, plus a companion CLI code-generator.
• Purpose: Provide a content-management API (users, roles, articles, comments, tags, badges, reports) for a Habbo fan-site, with a Rust CLI to scaffold new features.
File structure
• Top-level crates:
• root crate (src/) – main API server
• cli/ – the Samambaia CLI tool
• entities/ – ORM-generated domain model
• migration/ – ORM-scripted database migrations
• tests/ – integration tests
• Inside src/: Clean Architecture layers (core, domain, infra, http, util, libs, etc.)
• Config/deployment: Docker Compose (compose.yaml), .env, GitHub Actions workflows.
README for architecture notes
• Confirms use of Clean Architecture:
– /src/core, /src/domain (pure business rules), /src/infra (external implementations), /src/infra/http (API adapters)
– Sea-ORM for persistence, JWT for auth
– CLI for code generation via templates
Elements
• Clear labels on each component and layer
• Blue for Domain (pure business)
• Green for Infrastructure adapters
• Orange for API/HTTP layer
• Gray for Database and migrations
• Yellow for CLI
Detailed callouts
• In Infra-Persistence, show Sea-ORM Connection, Mappers, Repository Impl.
• Link JWT Service in Infra to its usage in HTTP Middlewares and Domain Services
• Docker Compose spinning up Postgres, and Migration crate applying schema