How fazlibeqir/e-majstori works
Main Components
• Backend Application (Spring Boot)
– This is the primary focus of the file tree. It includes several layers:
▪ Web Layer (Controllers like AppUserController, AuthController, CategoryController, etc.)
▪ Service Layer (Service interfaces and their implementations, e.g., AuthService and AuthServiceImpl)
▪ Data Access Layer (Repositories for entities such as AppUser, Category, Job, JobProvider, and Location)
▪ Domain Model (Entities, DTOs, and relational mappings defined under model and model/relations)
▪ Configuration and Security (Classes like SecurityConfig, CorsConfig, JWTAuthFilter, and JWTUtils)
• Database (PostgreSQL)
– As noted in the README and supported by migration scripts located under src/main/resources/db/migration, the project relies on PostgreSQL.
• Containerization & DevOps Tools
– Dockerfile and Docker Compose files are provided (inside backend/Dockerfile and backend/local/docker-compose.yml), which indicate containerized deployment.
• Frontend Application (React+Vite)
– Although the file tree doesn’t include frontend files, the README mentions a separate frontend repository hosted on Vercel. This component interacts with the backend via API calls.
Relationships and Interactions
• The Frontend sends HTTP requests (via RESTful API calls) to the Backend.
• The Backend Web Layer (Controllers) receives API calls, handles authentication (using JWT-based security configurations), and delegates requests to respective Service layer implementations.
• The Service layer processes business logic and interacts with the Data Access Layer.
• The Repository layer performs CRUD operations on the Database (PostgreSQL).
• Docker and Docker Compose are used for container orchestration, ensuring that the backend and database run in isolated, reproducible environments.
Architectural Patterns and Design Principles
• Layered Architecture – The project is clearly separated into presentation (controllers), business logic (services), and data access (repositories) layers.
• Security Mechanisms – The use of Spring Security configurations, custom JWT authentication, and CORS configuration are integrated as part of the overall flow.
• Microservice-Style Container Deployment – Although this seems like a monolithic backend, the containerization with Docker suggests an approach that could be scaled or integrated within a microservices environment.
• Use of DTOs – Separating API models (DTOs) from persistence models to ensure loose coupling between external interfaces and underlying data representations.
– Frontend (React+Vite)
– Backend Service (Spring Boot Application)
– Database (PostgreSQL)
– Docker Environment (illustrating containerization for both Backend and Database)
– Controllers (e.g., AuthController, JobController, etc.)
– Services (e.g., AuthServiceImpl, JobServiceImpl, etc.)
– Repositories (e.g., AppUserRepository, JobRepository, etc.)
– Domain/Models (entities and DTOs)
– Configuration & Security (JWTAuthFilter, JWTUtils, SecurityConfig, CorsConfig)
– Consider grouping configuration and security classes together inside the backend component.