How juliethcp/jan-fit works
A good approach for diagramming the JAN-Fit application is to think of it as a mobile-front end interacting with an external API backed by a PostgreSQL database. Below is a step-by-step explanation tailored to the project’s structure:
Project Type and Purpose
• JAN-Fit is clearly a mobile exercise application built with React Native. Its purpose is to allow users to view and use a variety of pre-defined exercise routines and track their workout sessions (with features like a built-in chronometer).
• The README indicates that while the mobile app handles the user interface and interaction, a separate REST API (in another repository) manages exercise data via a PostgreSQL backend.
Analyzing the File Structure
• Top-level files like App.js and configuration files (app.json, eas.json, metro.config.js, babel.config.js) indicate a React Native project.
• The “src” directory houses all UI elements:
• The assets subdirectory provides fonts and image resources.
• “components” include both common UI elements (e.g., Cronometro, CustomButton, InputField) and more domain-specific components (e.g., DatosUsuario, Ejercicios, Rutinas).
• “screens” comprise distinct views like LoginScreen.js and RegisterScreen.js.
• The SQL files (inserciones.sql, tablas.sql) hint at the structure or seed data for the PostgreSQL database, even though the database management is handled on the backend API side.
Main Components
a. Mobile Application (Frontend):
• React Native app as the primary client.
• Components like App.js (entry point), screens (LoginScreen, RegisterScreen), and the various shared UI components.
• Submodules or grouped areas (for instance, “UI Components” and “Asset Management”) to represent organization within the “src” directory.
b. API REST Server (Backend):
• External API that the mobile app connects to. Even though its code is in a separate repository, it is a central part of the system.
• That this server handles business logic, exercise data processing, and interfacing with the database.
c. PostgreSQL Database:
• Database that stores exercise details (names, descriptions, GIFs, and other metadata).
• This component visually to the REST API server.
Relationships and Interactions
• The mobile app sends requests (e.g., user authentication, exercise data queries) to the REST API.
• The REST API processes requests, performs necessary CRUD operations on the PostgreSQL database, and returns responses.
Architectural Patterns and Design Principles
• The separation of concerns is essential: the mobile app focuses on presentation and user interaction while the external API (and ultimately the PostgreSQL database) handles data management.
• The UI is modularized into reusable components (as seen in the “components” directory), adhering to component-based design principles common in React projects.
• The RESTful design of the backend encourages clear separation between client and server.