How raid-training-initiative/rti-api works
Main Components
a) Client Layer:
• External Clients (Web Interfaces, Third-party Applications)
• Discord Authentication Integration
• Postman Testing Environment
b) API Layer:
• Authentication Middleware
• Request Handlers (organized by domain)
• Error Handling Middleware
c) Data Layer:
• MongoDB Database
• Database Schemas
• Data Transfer Objects (DTOs)
External Interfaces
• HTTP endpoints grouped by domain (Categories, Comps, Members, Raids, etc.)
• Discord OAuth2 authentication flow
• Bearer token authentication path
Core API Components (from src/)
• Request Handlers
• Categories
• Comps
• Members
• Raids
• TrainingRequests
• GuildOptions
Authentication System
• Service Client Authentication
• Discord User Authentication
• Token Validation
Error Handling System
• Custom Exception Types
• Error Middleware
• HTTP Status Codes
Database Layer
• MongoDB Connection
• Schema Validation
• Data Models
Relationships and Data Flow
• Client requests flowing through authentication
• Request processing through middleware
• Database interactions
• Error handling paths
• Discord OAuth2 flow
Implementation Notes
Specific architectural patterns:
• RESTful endpoint structure
• Middleware pipeline
• DTO pattern for data transformation
• Repository pattern for database access
• Authentication strategy pattern
Technical Stack Highlights
Clear indicators for:
• Node.js runtime
• TypeScript implementation
• MongoDB database
• Express.js (implied by structure)
• Discord OAuth2 integration