How randysmc/sistema-citas works
Main Components
• Frontend – Angular Application:
• The “Frontend” directory shows a complete Angular project. It includes an app module, routing, multiple pages (admin, cliente, user, home, login, signup, etc.), and services (authentication, calendar, citas, etc.).
• Grouping related pages or modules (e.g., Admin module, Client module) and list key components like navigation bars, dashboards, and various forms.
• Services such as Authentication, HTTP interceptors for JWT, and guards for route protection.
• Backend – Spring Boot REST API:
• The “Backend” directory contains a Spring Boot application with the typical structure: controllers, services, repositories, entities, DTOs, and configuration files.
• Presentation layer (controllers), the business logic layer (services and their implementations), and the data access layer (repositories).
• That several controllers are present handling authentication, citas (appointments), comprobantes (receipts), and more. Also, there is extensive use of DTOs, exception handling (GlobalExceptionHandler), and security configurations (JWTAuthentication, Spring Security, Swagger for API documentation).
• Although a database is not explicitly represented by a separate “db” directory, it is implied by the use of repositories and entity classes, and configuration files like application.properties suggest connection details.
• External Services and Tools:
• JWT-based authentication and potential external API integrations (if any) are managed on the backend.
• Swagger is configured for API documentation.
• Use of Tailwind CSS on the frontend indicates styling technology.
Relationships and Interactions
• Controllers (API endpoints) at the top receive requests from the frontend.
• Services (business logic) are called by controllers.
• Repositories (data access) work underneath services to interact with the database.
• DTOs facilitate data transfer between layers.
• Security component (JWT Authentication Filter, Security Config) intercepting requests to protected endpoints.
• For the frontend, illustrate communication flow:
• Angular services use HTTP clients to access backend APIs.
• Authentication processes (login, two-factor) include interceptors (auth.interceptors.ts) and guard services (admin.guard.ts, normal.guard.ts).
Architectural Patterns and Design Principles
• The backend follows an MVC (or layered) architecture pattern where controllers, services, and repositories are clearly separated.
• The use of DTOs ensures a decoupled data transfer mechanism.
• Exception handling is centralized in the GlobalExceptionHandler.
• JWT authentication and Spring Security illustrate secure access control.
• The frontend leverages Angular’s component-based architecture and uses routing guards to protect routes.