How danielchc/eride-server works
Main Components
• gRPC Client – Representing external clients which use client certificates (as generated in the README) to initiate secure communication.
• gRPC Server – The entry point is “cmd/main.go” that starts the server and loads the various application modules.
• Authentication Service – Defined in “service/auth_service.go” and its associated proto file (“proto/auth_service.proto”). This is the core business logic handling authentication requests.
• Application Modules:
○ Authentication Module (app/auth) – Contains “auth_store.go”, “jwt.go”, and “user.go”. This module handles user data, token generation, and auth logic.
○ Configuration Module (app/config) – Reads and manages configuration settings from “config.yaml.example”.
○ Database Module (app/db) – Provides the database connection and interaction logic via “db_provider.go”.
○ Constants Module (app/consts) – Defines application-wide constants in “consts.go”.
○ Security Module (app/security) – Manages TLS settings and certificate handling (especially important for gRPC security) using “tls.go”.
Relationships and Interactions
• The gRPC Server (initiated via “cmd/main.go”) acts as the central hub. It receives client requests and routes them to the Authentication Service.
• The Authentication Service interfaces with the Authentication module for user and JWT handling.
• Read configuration settings via the Configuration module.
• Call the Database module for any data persistence or retrieval.
• Use the Constants and Security modules in supporting roles.
Architectural Patterns / Design Principles
• Modularity and Separation of Concerns: Each domain (auth, config, db, security, constants) is separated into its own package.
• gRPC-based Microservice Style: The service exposes its functionalities via a gRPC interface (with explicit use of protocol buffers).
• Secure Communication: The design emphasizes TLS with mutual certificate authentication, with steps outlined in the README.
Final Recommendations
• Clear labels on all components.
• As much detail as possible, breaking down the service into subcomponents; do not hesitate to include extra nodes if they represent significant parts of the system.