How escalopa/vego works
• Frontend (fe):
• Next.js Application – Represents the user interface and pages (login, call, OAuth callback, etc.).
• UI Components – Display components and hooks (like use-auth, use-webrtc) that handle state and interactions.
• API Client Layer – A module (in fe/lib) where API calls are made to the backend endpoints.
• Backend (be):
• API Server – The Go application starting from be/cmd/main.go centralizes the API endpoints.
• Authentication Service – Includes files under be/internal/auth; handles JWT, OAuth flows and token handling.
• Room Service – Includes managing room logic, WebSocket connections, and WebRTC signaling (see be/internal/room).
• Database Layer – Encapsulated in be/internal/db for database operations.
• Application/Business Logic – Managed within be/internal/app, be/internal/service, and be/internal/domain.
• External Components:
• OAuth Providers – External identity providers like Google or GitHub.
• Client devices – The end-user’s browser interacting with the system.
• (Optionally) Containerization and Deployment – Represent Docker (Dockerfile, docker-compose.yml) which orchestrates the deployment environment.
Relationships and Data Flows
• The frontend sends HTTP requests (GET/POST) to the backend API endpoints (e.g., OAuth login, user info retrieval, room join, logout).
• Upon joining a room, the frontend initiates a WebSocket connection to the backend for real-time communication.
• During OAuth login, the backend interacts with external OAuth providers, and then sends authentication tokens back to the client.
• Database access flows, with the backend reading from and writing to the database via the db layer.
• Internal communication among backend services (authentication → configuration & logging, room service → WebSocket hub, etc.) should be clearly shown with connecting lines.
Architectural Patterns and Design Principles
• Separation of Concerns: Notice that each major functionality (authentication, room management, business logic, configuration, database) is divided into its own internal package.
• Modularization: Both the frontend and backend are modular (e.g., different directories for API, hooks, components in fe, and different internal modules in be).
• Real-time Communication: Special emphasis on the room module and WebSocket implementation, as detailed in the README for real-time messaging and WebRTC negotiation.
• Container-based Deployment: Indicate that the backend (and possibly the overall application) are containerized using Docker and managed via docker-compose.
Relevant Technologies and Frameworks
• For the frontend: Next.js, TypeScript, TailwindCSS, and various UI libraries/components.
• For the backend: Go (Golang), JWT for authentication, OAuth integration, WebSocket handling, and potential database technology (the actual DB system isn’t specified but is implied by the presence of a db package).
• Deployment: Docker and docker-compose.