Skip to main content

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.