How trap-jp/trao-judge-backend works
Project type and purpose
• This is the “traO-Judge-backend”, a Rust-based backend service for an online judge system (traP Online Judge). It exposes HTTP endpoints for authentication, user management, problem and submission handling, and integrates with a relational database plus external services (Mail, Object Storage).
File structure
• Top-level:
• Cargo.toml: Rust project manifest
• docker-compose.yaml, .env.dev: local orchestration
• Taskfile.yaml: build/test tasks
• migrations/: SQL scripts for schema
• docs/architecture.md: additional architecture notes
• src/: clearly follows a layered, DDD-inspired design:
• di.rs: Dependency injection / wiring
• domain/: core entities, repository interfaces, external-service interfaces
• infrastructure/: concrete implementations of repository + external interfaces
• usecase/: application/service layer that orchestrates domain logic
• presentation/: HTTP handlers and transport-level models
• bin/main.rs: application entry point
• tests/: integration tests covering HTTP and database interactions
README
• Minimal: project title and Japanese description (“traP Online Judge バックエンド”).
• Refer to docs/architecture.md for more detailed component descriptions.
Elements
– Internal layers (Presentation, Usecase, Domain)
– Adapters (Infrastructure)
– External systems (Database, Mail, Object Storage)
• Annotations for folder or module names (e.g., src/domain, src/infrastructure).