This is an appointment booking system for an agency, implemented using .NET 8 C#. The system allows customers to book appointments and get tokens, and the agency can view the appointments for the day. The project includes functionalities for managing off days and limiting the number of appointments per day.
- .NET 8
- Entity Framework Core
- SQL Server
- xUnit (for unit testing)
- Moq (for mocking in unit tests)
- Swagger (for API documentation)
- GitHub (for source control)
- Autofac (for Dependency Injection): because using AddScoped() Dependency Injection from .NET
- Azure (for cloud hosting): because getting stuck when sign up, I didn't know why. So sorry for that.
- Book appointments and issue tokens.
- View the queue of customers with appointments for the day.
- Specify off days (public holidays).
- Limit the maximum number of appointments per day, with overflow handled by the next day.
- .NET 8 SDK
- SQL Server
- Visual Studio 2022 (or any other IDE that supports .NET 8)
-
Clone the Repository:
git clone https://github.com/yourusername/appointment-booking-system.git cd appointment-booking-system -
Project Structure:
AppointmentBookingSystem │ ├── AgencyAPI │ ├── Controllers │ │ ├── AppointmentsController.cs │ │ └── OffDaysController.cs │ ├── Data │ │ ├── ApplicationDbContext.cs │ │ └── Migrations │ ├── Models │ │ ├── Appointment.cs │ │ └── OffDay.cs │ ├── Repositories │ │ ├── AppointmentRepository.cs │ │ ├── IAppointmentRepository.cs │ │ ├── IOffDayRepository.cs │ │ └── OffDayRepository.cs │ ├── Services │ │ ├── AppointmentService.cs │ │ └── IAppointmentService.cs │ ├── Program.cs │ └── appsettings.json │ ├── AgencyAPI.Tests │ ├── AppointmentServiceTests.cs │ └── AppointmentsControllerTests.cs │ └── AgencyAPI.sln -
Setup SQL Server Database:
- Ensure SQL Server is running.
- Update the connection string in
appsettings.json{ "ConnectionStrings": { "DefaultConnection": "Server=your_server_name;Database=AppointmentDb;Trusted_Connection=True;MultipleActiveResultSets=true" } }
-
Apply Migration
- Open a terminal in the project directory and run:
- dotnet ef migrations add InitialMigration
- dotnet ef database update
- Open a terminal in the project directory and run:
-
Running the Application
- Build and Run:
- Open the solution in Visual Studio.
- Set AgencyAPI as the startup project.
- Press F5 to build and run the application.
- Running the Unit Tests:
- Open the Test Explorer in Visual Studio (Test -> Test Explorer).
- Click Run All to run all the unit tests.
- API Documentation:
- Swagger is integrated for API documentation.
- Once the application is running, navigate to https://localhost:5001/swagger to view and interact with the API documentation.
- Build and Run:
This README.md file provides a concise and clear guide for setting up, running, and understanding the project,
as well as information on the tools and frameworks used. Adjust the repository URL and any other specific details to fit your project.