How pavlokordunov/projecto-de-softservo works
Main Components
a. Frontend:
• Represented by the “frontend” directory.
• Built using Next.js (notice the “app” directory with page.tsx files, layout.tsx, providers.tsx, etc.).
• Contains authentication components (e.g., LoginWidget, OktaSignInWidget) and API integration (see “api/omdbApi” suggesting an external movie database integration).
• Manages client-side routing for pages like home, groups, posts, topics, profiles, etc.
b. Backend:
• Represented by the “backend” directory.
• A Java-based server application (Spring Boot–style) using Maven (pom.xml, mvnw) with a clear layered structure:
– Controllers (in the controller package) that expose REST endpoints for forums, chat, posts, notifications, etc.
– Services (and their implementations) for business logic such as PostService, UserService, ChatMessageService, and TMDbService, indicating use of external APIs (like TMDb for movie data).
– Repositories (using Spring Data) for data access.
– Entities (model classes) for domain objects (User, Post, Group, Notification, Tag, etc.).
– Configuration classes (e.g., SecurityConfig, H2DBConfig, PostgreSQLDBConfig) and aspects (LoggingAspect, AuthorizationAspect) that implement cross-cutting concerns like logging and security.
c. Database:
• Use of multiple data sources:
– H2 in-memory database (likely for development/test or lightweight cases as indicated by H2DBConfig and associated package structures).
– PostgreSQL for production scenarios (PostgreSQLDBConfig).
d. External / Supporting Tools:
• Allure Reports are integrated within the backend (check “backend/.allure” directory) to manage test reporting.
• A Docker Compose file in the backend (“docker-compose.yml”) points to containerized services.
• External APIs integration: TMDb (and in the frontend, OMDB API) used for movie data.
• WebSocket configuration for real-time features (evident from WebSocketConfig and frontend services/websocket.ts).
Relationships and Interactions
– Controllers call Services.
– Services interact with Repositories to access data stored in the Databases.
– Cross-cutting concerns like Security (via SecurityConfig) and Logging (via LoggingAspect) should be clearly indicated.
• External flows such as:
– API calls from backend services to the external TMDb service.
– OMDB API integrations from the frontend.
– Authentication flows using Okta (as observed in the frontend auth components).
• Incorporate WebSocket communications for functionalities like real-time chat (represented by both the backend’s WebSocketConfig and the frontend’s websocket service).
Architectural Patterns and Design Principles
• Layered/MVC Architecture in the backend (Controllers, Services, Repositories, Entities).
• Use of Aspects (for authorization and logging) as part of cross-cutting concerns.
• Separation of concerns between the frontend (client presentation, routing, authentication widget) and the backend (business logic, persistence).
• Modular integration of external services (TMDb and OMDB APIs) that enhance domain features.
• Containerization (via Docker Compose) to manage deployment and orchestration.
Detail and Clarity
• Key architectural elements even if some are only represented in part of the file tree.