How zhashkevych/go-clean-architecture works
Main Components
a) External Layer (Delivery):
• HTTP Handlers (auth & bookmark endpoints)
• Middleware (JWT authentication)
b) Use Case Layer:
• Auth Use Cases
• Bookmark Use Cases
c) Repository Layer:
• MongoDB Implementation
• Local Storage Implementation (for testing)
d) Core Domain Layer:
• User Model
• Bookmark Model
┌─────────────────────────────────────────────┐
• Delivery Layer (HTTP) │
• Auth Handlers │
• Bookmark Handlers │
• Middleware │
• ┤
• Use Case Layer │
• Auth Use Cases │
• Bookmark Use Cases │
• ┤
• Repository Layer │
• MongoDB Repositories │
• Local Storage Repositories │
• ┤
• Domain Models │
• User │
• Bookmark │
• ┘
Key Elements to Highlight
a) Dependencies Flow:
• That inner layers don't depend on outer layers
• Use interfaces at boundaries between layers
b) External Components:
• MongoDB Database
• JWT Authentication System
• HTTP Server/Router
Important Details
a) API Endpoints:
• POST /auth/sign-up
• POST /auth/sign-in
• POST /api/bookmarks
• GET /api/bookmarks
• DELETE /api/bookmarks
b) Repository Implementations:
• Both MongoDB and Local Storage options
• Interface boundaries
c) Authentication Flow:
• JWT token generation and validation
• Middleware integration
Technical Stack Indicators
• Go 1.13
• MongoDB
• Docker/Docker Compose
• JWT Authentication
Database independence through repository interfaces
Remember to maintain a balance between detail and clarity, focusing on the architectural decisions while avoiding implementation-specific details that don't contribute to understanding the system's structure.