A C# .NET 8 console application for managing a veterinary clinic. This project is built using a clean, layered architecture to simulate a real-world management system.
- Role-Based Access Control: Secure login system with three distinct roles:
- Receptionist: Manages clients, pets, and appointments.
- Veterinarian: Views schedules and (in the future) patient history.
- Admin: Manages employee accounts (CRUD operations).
- Client Management: Register new clients with robust validation (e.g., no duplicate emails).
- Pet Management: Register pets and associate them with existing clients.
- Appointment Scheduling: Schedule, cancel, and update appointments with advanced conflict checking for veterinarians.
- Employee Management: Admin can create, list, update, and delete employee accounts.
- Robust Error Handling: The application is "crash-proof" using
try...catchblocks in the service layer to handle invalid user input and repository exceptions gracefully.
This project is built using a 3-layer architecture to ensure Separation of Concerns and maintainability.
- UI (Console Menus -
Utilsfolder): The "dumb" menu classes. Their only job is to get input from the user and call the appropriate service. - Service Layer (
Servicesfolder): The "brain" of the application. This layer contains all business logic, data validation, and orchestration. It coordinates the repositories to perform complex tasks. - Data Layer (
Repositoriesfolder): The "hands" of the application. This layer is responsible for data access. It currently uses an in-memorystaticdatabase (Datafolder) but is built with Interfaces (Interfacesfolder) so it can be easily swapped with a real MySQL or SQL Server database.
This project heavily uses Dependency Injection by passing services and repositories into the constructors of the classes that need them, starting from Program.cs.
- C# / .NET 8
- FluentValidation: For robust and declarative model validation. Custom validators (
Validatorsfolder) ensure data integrity forClient,Employee, andPetmodels.
Data/: Contains the in-memory database and seed data.Database.cs
Docs/: Stores design documents and diagrams.Interfaces/: Defines the "contracts" (interfaces) for services and repositories, allowing for Dependency Injection.IClientRepository.csIClientServices.cs- (...etc.)
Models/: Contains the core business entities (classes that define the data).Person.csClient.csPet.csEmployee.cs- (...etc.)
Repositories/: Implementations of the repository interfaces. Contains the data access logic (currently, in-memory lists).ClientRepository.csEmployeeRepository.cs- (...etc.)
Services/: The "brain" of the application. Contains business logic and calls repositories.ServicesClient.csEmployeeService.csServiceAppointment.cs- (...etc.)
Utils/: User Interface (UI) classes. Handles the console menus and user interaction.MainAdmin.csMenuReceptionist.csMenuVeterinarian.cs
Validators/: Contains the FluentValidation rule sets for the models.ClientValidator.csEmployeeValidator.cs- (...etc.)
Program.cs: The application's entry point. This is where all dependencies are configured and "wired up" (Composition Root).README.md: This file.VeterinaryManagementConsole.csproj: The C# project file.
- Clone the repository.
- Navigate to the project's root folder in your terminal.
- Restore NuGet packages:
dotnet restore
- Run the application:
dotnet run
The in-memory database is pre-seeded with three default users:
| Role | Username | Password |
|---|---|---|
| Admin | admin |
admin123 |
| Receptionist | lfernandez |
Password456 |
| Veterinarian | cperez |
Password123 |
The Docs folder contains important design documents for this project:
DiagramClassFinal.png: A comprehensive UML Class Diagram illustrating the relationships between the different models and classes in the system.UsesCasesVeterinary.png: A Use Case Diagram outlining the main functionalities of the system and how different user roles interact with them.DiagramClassHigLevel.png: complete high-level diagram of the class diagram and their behaviors with each other.
- Name: Sebastian Linero
- Clan/Team: Caiman
- Contact: [https://github.com/SlineroDC]
- Project Repository: [https://github.com/SlineroDC/VeterinaryManagementConsole]