Skip to content

SlineroDC/VeterinaryManagementConsole

Repository files navigation

Veterinary Management Console

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.

Features

  • 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...catch blocks in the service layer to handle invalid user input and repository exceptions gracefully.

Architecture & Design

This project is built using a 3-layer architecture to ensure Separation of Concerns and maintainability.

  1. UI (Console Menus - Utils folder): The "dumb" menu classes. Their only job is to get input from the user and call the appropriate service.
  2. Service Layer (Services folder): The "brain" of the application. This layer contains all business logic, data validation, and orchestration. It coordinates the repositories to perform complex tasks.
  3. Data Layer (Repositories folder): The "hands" of the application. This layer is responsible for data access. It currently uses an in-memory static database (Data folder) but is built with Interfaces (Interfaces folder) 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.

Tech Stack

  • C# / .NET 8
  • FluentValidation: For robust and declarative model validation. Custom validators (Validators folder) ensure data integrity for Client, Employee, and Pet models.

Repository Structure

  • 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.cs
    • IClientServices.cs
    • (...etc.)
  • Models/: Contains the core business entities (classes that define the data).
    • Person.cs
    • Client.cs
    • Pet.cs
    • Employee.cs
    • (...etc.)
  • Repositories/: Implementations of the repository interfaces. Contains the data access logic (currently, in-memory lists).
    • ClientRepository.cs
    • EmployeeRepository.cs
    • (...etc.)
  • Services/: The "brain" of the application. Contains business logic and calls repositories.
    • ServicesClient.cs
    • EmployeeService.cs
    • ServiceAppointment.cs
    • (...etc.)
  • Utils/: User Interface (UI) classes. Handles the console menus and user interaction.
    • MainAdmin.cs
    • MenuReceptionist.cs
    • MenuVeterinarian.cs
  • Validators/: Contains the FluentValidation rule sets for the models.
    • ClientValidator.cs
    • EmployeeValidator.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.

How to Run

  1. Clone the repository.
  2. Navigate to the project's root folder in your terminal.
  3. Restore NuGet packages:
    dotnet restore
  4. Run the application:
    dotnet run

Default Logins

The in-memory database is pre-seeded with three default users:

Role Username Password
Admin admin admin123
Receptionist lfernandez Password456
Veterinarian cperez Password123

Documentation (Docs folder)

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.

About the Coder

About

Console-based veterinary clinic management system in C# .NET 8 with role-based access and in-memory data.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages