How bob13th-queue/ctf works
Main Components
a) API Layer (FastAPI Application)
• This as the top-level component
• Three main service modules: Auth, User, and Note
b) Service Layer
• Create three main service blocks:
• Authentication Service (from service/auth)
• User Service (from service/user)
• Service (from service/note)
• Each service should show its three components:
• Routes (API endpoints)
• CRUD operations
• Schema definitions
c) Database Layer
• SQLite database (ctf.db)
• Connection to database models
d) Utility Services
• OAuth implementation
• Password hashing service
• As supporting components
Component Relationships
┌─────────────────────────────────────────────┐
• FastAPI App │
• (Main Application Entry Point) │
• ┬───────────────────────────┘
• ↓
┌─────────────────────────────────────────────┐
• Service Layer │
• ┬───────────────┬─────────────┤
• Auth Service │ User Service │ Note Service │
• Routes │ - Routes │ - Routes │
• CRUD │ - CRUD │ - CRUD │
• Schema │ - Schema │ - Schema │
• ┬───────┴───────┬───────┴──────┬──────┘
• ↓ ↓ ↓
┌─────────────────────────────────────────────┐
• Database Layer │
• (SQLite - ctf.db) │
• Database Models │
• ┘
• ↑ ↑
┌───────┴───────┬───────┴───────┐
• OAuth Utils │ Password Hash │
• ┴───────────────┘
Additional Elements
a) Configuration:
• Core/config.py as a configuration component
• It to all relevant services
b) Docker Container:
• Exposed port (8000)
Important Notes
• Version information for key components
• FastAPI swagger documentation endpoint
• Database connection pool
• Authentication flow paths
• Error handling paths