How v06012005/unify works
Main Components
• Frontend Web Application: Represent the client-facing UI built with Next.js. This includes areas for authentication (login, register), profile management, posts pages, messaging, reels, video-calls, and other UI components (admin panels, global components, etc.). Indicate the API routes present in the “frontend/app/api” and “frontend/pages/api” directories.
• Backend Application: Represented by the Spring Boot project. This includes REST controllers (for authentication, posts, notifications, chats, etc.), service layers (business logic for managing posts, media, notifications, chat, etc.), repositories (data access layers for entities such as User, Post, Comment, etc.), and security configurations.
• Database / Data Sources: While there is no explicit SQL configuration file, the Spring Boot project includes a MongoConfig (under springboot/UNIFY/src/main/java/com/app/unify/config/MongoConfig.java) which indicates the use of a NoSQL database. Therefore, include a MongoDB (or similar) component that interacts with the Spring Boot repositories.
• External Services & Integrations: Identify services like Cloudinary integration (noted in “frontend/lib/cloudinary.js”) for media uploads and any Supabase integration (in “frontend/supbaseConfig.js” as well as service implementations in the backend like SupabaseServiceImpl). Other integrations such as external authentication or WebSocket for real-time functionalities (see “WebSocketConfig.java” and “WebSocketEventListener.java”) must also be captured.
Out the Relationships and Interactions
• UI Client → Frontend: The client (using a browser or mobile device) loads the Next.js frontend, which is responsible for the presentation layer.
• Backend → External Services: Show REST calls or SDK interactions with external services like Cloudinary (for media storage), email services (for OTP or password reset), and Supabase if applicable.
Important Architectural Patterns & Design Principles
• API Gateway / Router: Although not a dedicated microservices gateway, the Next.js frontend’s API routing structure (seen under “frontend/app/api” and "pages/api") demonstrates logical separation of API endpoints.
• WebSocket Integration: Acknowledge real-time communication handling using WebSocket configurations in the backend.
• Security: Include details for authentication and authorization – JWT filters, CustomUserDetailsService, and endpoint security defined in SecurityConfig.java.
Relevant Technologies, Frameworks, or Libraries
• Frontend: Next.js, React (as seen in the component structure and pages), Tailwind CSS (tailwind.config.mjs), and client-side libraries like cloudinary, fontawesome.
• Backend: Spring Boot, Spring Security, MongoDB (as configured by MongoConfig.java), and various utility libraries for email (ApacheMailService), JWT (JwtUtil), and Otp management.
• Real-Time & Messaging: WebSocket configuration and controllers for managing chat and call functionalities.