!!Attention: This project was developed solo by Ing. Yeison Gregori Rojas Henriquez
INTRODUCTION
The Appointment Booking System is an application developed in C# and ASP.NET Core using the Onion Architecture approach. Its main purpose is to provide users with a modern, secure, and efficient platform for managing appointments online.
This project was created in response to the need of many institutions and companies for a digital system that allows agile and reliable appointment scheduling, avoiding common issues such as information loss, duplicate bookings, or inefficient manual management.
The application implements key features such as user registration, secure authentication, and full appointment management (creation, consultation, modification, and cancellation). Its design is based on Clean Architecture principles, ensuring a clear separation of responsibilities between layers, making it easily scalable and maintainable in the long term.
For data persistence, the system uses SQL Server as the database manager, along with Entity Framework Core as an ORM, ensuring robust, optimized, and secure data access. Additionally, the modular architecture of the project allows for future functionality expansion, such as automatic notifications, integration with external calendars, or an advanced administration panel.
In summary, this project not only provides an efficient technological solution for appointment management but also serves as a practical example of how to apply Onion Architecture in a real-world enterprise software development scenario using .NET and SQL Server.
GENERAL OBJECTIVE
To develop an online appointment management system using C# with ASP.NET Core and SQL Server, based on Onion Architecture, allowing users to register, log in, and manage their appointments in a simple, secure, and efficient way.
Specific Objectives
- Implement a user module enabling registration, authentication, and credential validation with secure password storage.
- Develop an appointment management module allowing users to create, view, modify, and cancel appointments.
- Apply Onion Architecture, ensuring a clear separation of responsibilities among layers: Domain, Application, Infrastructure, and Presentation.
- Design the database in SQL Server, guaranteeing integrity, consistency, and security of information storage.
- Integrate Entity Framework Core as an ORM to facilitate communication between the application and the database.
- Ensure maintainability and scalability, preparing the system for future enhancements such as notifications, reports, and admin panel features.
- Provide a RESTful API to allow interaction with external clients or a more advanced future web interface.
GENERAL PROJECT DESCRIPTION
This project implements an appointment booking system using C# with an Onion Architecture, which organizes the code in concentric layers with dependencies pointing toward the center (domain).
Architecture Layers
- Domain Layer (Core)
• Responsibility: Contains fundamental business entities and interfaces.
• Components:
o Entities:
Appointment.cs: Represents an appointment/reservation.
Configuration.cs: Stores system configurations.
LogEntry.cs: Records log entries for auditing.
Slot.cs: Defines available appointment times.
User.cs: Manages system user information.
o Interfaces (Domain Contracts):
IAppointmentRepository.cs: Defines operations for appointment management.
IConfigurationRepository.cs: Defines operations for configuration access.
IGenericRepository.cs: Base interface for generic CRUD operations.
ISlotRepository.cs: Defines operations for slot management.
IUserRepository.cs: Defines operations for user management.
- Application Layer
• Responsibility: Orchestrates workflow between user interface and domain.
• Components:
o DTOs (Data Transfer Objects):
ConfigDto.cs, LoginDto.cs, RegistroDto.cs, ReservationRequestDto.cs, SlotDto.cs
o Service Interfaces:
IAppLogger.cs, IAuthService.cs, IConfigurationService.cs, IEmailService.cs, IReservationService.cs
o Application Services:
AuthService.cs, ConfigurationService.cs, ReservationService.cs
- Infrastructure Layer
• Responsibility: Implements technical concerns and access to external resources.
• Components:
o Persistence: Database access
o Infrastructure Services:
AppLogger.cs: Logging implementation
TokenService.cs: JWT token handling
- Presentation Layer (Web API)
• Responsibility: Exposes HTTP endpoints and handles requests/responses.
• Components:
o Controllers:
AuthController.cs, ConfigController.cs, ReservationsController.cs, SlotsController.cs
o Configuration:
appsettings.json, Program.cs, FinalProject.http
DEPENDENCY FLOW
• Domain layer does not depend on any other layer.
• Application layer depends only on Domain.
• Infrastructure depends on Domain and Application.
• Presentation depends on Application and Infrastructure.
Advantages:
• Maintainability: Changes in one layer do not necessarily affect others.
• Testability: Facilitates unit and integration testing.
• Scalability: Well-defined components allow organized growth.
• Separation of concerns: Each layer has specific responsibilities.
This architecture ensures the business core (domain) remains stable and isolated from framework or technology changes.
DESIGN PATTERNS USED
Singleton Pattern Implemented in Logging
Justification for Using Singleton in Logging
- Single Point of Writing
o The log records error messages, warnings, or system information.
o Without Singleton, multiple instances would create multiple files or outputs, making it difficult to track events.
- Consistency in Logging
o Ensures all messages are stored with the same format (date, time, error type).
o Facilitates reading logs and debugging.
- Efficient Resource Usage
o Logging can be resource-intensive (file or console writes).
o Singleton avoids creating unnecessary instances and centralizes access.
- Global and Controlled Access
o Any part of the program can use the log without passing object references.
o Simply call Logger.Instance to write a message.