How thepokenik/clover works
Overall project components
• Frontend: A React-based application (using Vite for building and Tailwind CSS for styling) housed in the “frontend” directory. It contains pages, components, utilities, and assets.
• Backend: A Spring Boot API (Java, managed via Maven) in the “backend/API” directory. This layer follows a common layered architecture with controllers, services, repositories, and entity definitions.
• Database: Although not explicitly shown in the file tree (e.g., no “mongo” directory files), the README notes the usage of MongoDB.
• Containerization & Deployment: Notice Dockerfiles for both the backend and frontend, along with a docker-compose.yml at the project root which suggests container orchestration.
Main components and sub-components
a. Frontend Container:
• UI Layer: Pages (e.g., auth, annotation, issues, projects, roadmap, settings, welcome) and a rich set of reusable UI components.
• Infrastructure: Routing, context providers, and integration utilities (for example, the “infra/url.jsx” and “lib” directories).
• Tooling: Vite, ESLint, Tailwind, and Docker deployment configuration.
b. Backend Container:
• API Controllers: Organized under “src/main/java/com/goncalves/API/controller”, these modules (e.g., AuthenticationController, FilesController, IssueController, etc.) expose RESTful endpoints.
• Business Services: In “src/main/java/com/goncalves/API/service”, encapsulating business logic such as authentication, email notifications, token handling, and project management.
• Data Access Layer: Repositories under “entities” folders for annotations, commits, files, issues, notifications, users, etc.
• Infrastructure & Configuration: Security, exception handling, seeds for initial data, and configuration files under “src/main/java/com/goncalves/API/infra”.
• Build & Containerization: Maven build scripts, Dockerfile for containerizing the API, and related configuration.
c. Database:
• MongoDB: As per the README, use MongoDB to store project data such as versioned files, annotations, commit histories, user data, and notifications.
d. DevOps/Deployment:
• Orchestration: The docker-compose.yml likely defines how the frontend, backend, and database containers interact.
• Docker: Individual Dockerfiles in both frontend and backend allow isolated environment setup.
• Requests from the Frontend to the Backend (HTTP/HTTPS REST API calls).
• CRUD operations from the Backend to the MongoDB database.
• Containerization orchestration (via docker-compose) as an outer boundary that encapsulates the containers.
Architectural Patterns and Design Principles
• Separation of concerns:
• Frontend: Presentation layer with components, pages, and routing.
• Backend: Follows an MVC-like or layered architecture separating controllers (handling HTTP requests), services (business logic), and repositories (persistence).
• Use of RESTful API design.
• Exception handling, security filters, and middleware components in the backend (e.g., SecurityConfiguration, SecurityFilter, and various exception handlers).
Relevant Technologies
• Frontend technologies: React, Vite, Tailwind CSS.
• Backend technologies: Java, Spring Boot, Maven.
• Database: MongoDB.
• Containerization: Docker and docker-compose.