How sergiocp21/yourfitnessjourney works
Main Components
a. Frontend:
• Located in the "Frontend" directory.
• Contains a React-based application (using Vite as suggested by the "vite.config.js" file) with components for login, home view, authentication (e.g., AuthContext, AuthProvider), and general UI elements like headers and footers.
b. Backend:
• Found inside the "Backend/backend" directory.
• A Java Spring Boot application built with Maven (note the "pom.xml" and Maven wrapper files).
• Organized using a layered architecture pattern with clear subdivisions:
i. Controller: REST controllers (e.g., UserController) that handle incoming HTTP requests.
ii. Model: Domain entities (e.g., Exercise, Routine, User, RoutineExercise, UserRoutine).
iii. Repository: Interfaces (e.g., IExerciseRepository, IUserRepository, etc.) to abstract data persistence.
iv. Service: Business logic layer (e.g., UserService).
v. Security: JWT-based authentication components (JwtConfig, JwtUtils, SecurityConfig).
c. Database:
• Represented by the "BaseDatos.sql" file. This likely contains the SQL schema and possible seed data for the relational database supporting the backend.
Relationships and Data Flow
• The Frontend (React application) is the interface for the end-user which communicates with the Backend through RESTful API calls.
• The Backend receives HTTP requests via its controllers, processes business logic in the service layer, persists and retrieves data via repository interfaces, and secures endpoints using JWT-based security.
• The Database acts as the persistent store for all the application's data and is accessed by the backend.
• Security components (JWT utilities and configuration) are used as an intermediary layer ensuring that the data flow between the frontend and backend is properly authenticated and authorized.
Architectural Patterns and Technologies
• Layered (or n-tier) architecture in the backend to separate concerns (presentation, business logic, data access, and security).
• RESTful API design for communication between the frontend and backend.
• JWT-based authentication and authorization to secure endpoints.
• Use of modern Java frameworks (Spring Boot) for the backend and modern JavaScript frameworks (React with Vite) for the frontend.
• Maven as the build and dependency management tool for the Java backend.
• SQL-based database (as indicated by the BaseDatos.sql file).
a. Frontend Block:
b. Backend Block:
• Controller Layer (handling HTTP requests).
• Service Layer (processing business logic).
• Repository Layer (data access).
• Security Module (JWT utilities and configuration).
c. Database Block:
d. Security Component:
• Optionally, highlight the JWT Security module as a separate (or embedded) component in the backend to indicate that every request going to the backend undergoes security checks.
Final Practical Steps
• Decompose the Backend into its major layers (Controller, Service, Repository, Security).
• Clearly denote how the Frontend communicates with the Backend (via API calls) and how the Backend interfaces with the Database.