How dicrey/petsheaven works
Main Components
• Front-end Client: Built with React (using Vite), it consists of various components such as navigation bars, forms (login, registration, pet-related forms), error handling (Loader, NotFound), and pages like the Veterinaria page. All UI-related assets (styles, public files) are kept within this directory.
• Back-end Server: A Node.js server (with an index.js entry point) that defines several routes (global.route.js, pets.route.js, user.route.js) and uses service modules (DataBase.js, Global.services.js, Pets.services.js, Users.services.js) to decouple business logic.
• Database: SQL scripts (dataBase.sql) and stored procedures (under the proc folder) that likely define the schema and operations to support the pet management functionalities.
• External Services: Note the front-end’s supabaseClient.js which hints at integration with Supabase (for authentication, storage, or real-time data) or similar services.
Relationships and Interactions
• Client–Server Communication: The front-end sends HTTP requests to the back-end routes; these requests trigger the corresponding services which encapsulate business logic.
• Server–Database Interaction: The back-end (via its dedicated DataBase.js service) connects with the database to execute queries and stored procedures for retrieving or modifying pet, user, and global data.
• Third-party/External Service Interaction: If Supabase or another external service is used, indicate a direct connection from the front-end or back-end to this service.
Crucial Architectural Patterns and Design Principles
• Separation of Concerns: The back-end is divided into routes and services, ensuring that HTTP request handling, business logic, and data handling are separated.
• Modularization: Both the front-end (with multiple well-organized components) and the back-end (with dedicated services for pets, users, and global operations) reflect a modular architecture.
• Layered Architecture: The system can be visualized in layers – presentation layer (front-end interface), application layer (backend routes and services), and data layer (database).
Relevant Technologies and Frameworks
• Front-end: React (JSX components), Vite for development/build tooling, and CSS for styling.
• Back-end: Node.js (with JavaScript), Express-like routing (as inferred from the route files), and service abstractions.
• Database: SQL-based relational database with stored procedures.
• Integration Example: Supabase (as indicated by the presence of supabaseClient.js).