System Architecture and Design
The Clover Server is designed to provide a robust and scalable backend for the Clover application. The architecture is based on a client-server model, where the server handles requests from clients, processes data, and communicates with external services as needed.
Componentsβ
Figure 1. Component Diagram of the Clover application.
Legend:
π₯οΈ UIβπ§© Editorβπ Backendβπ€ AIβπ AuthβποΈ Databaseβπ Logs
Backendβ
π Gin (Golang)β
The backend handles all API requests between the VS Code extension, AI model, and database.
πΉ Key Features:β
- Processes Code Requests β Sends user code to the AI model and returns suggestions.
- Tracks User Behavior β Logs whether users accept, modify, or reject suggestions.
AI Modelβ
π€ Gemini (AI Code Generator)β
The AI model generates code suggestions and sometimes introduces small mistakes to test users.
πΉ Key Features:β
- Context-Aware Suggestions β Provides relevant recommendations based on the userβs code.
- Intelligent Mistakes β Occasionally tweaks suggestions with logical errors to test user focus.
- Adaptive Learning β Adjusts suggestions based on user behavior.
note
For more see AI Model.
Database & Authenticationβ
π Supabase (PostgreSQL, Auth)β
Supabase handles user login and stores all interaction data.
πΉ Key Features:β
- User Authentication β Manages logins and keeps track of individual progress.
- Logs User Activity β Records which suggestions were accepted, modified, or rejected.
- Real-Time Sync β Updates and injects user progress instantly to the AI model and on the dashboard.
note
For database schema design see Data Schemas.