Skip to content

A secure, responsive C# ASP.NET Core MVC application that facilitates scheduling and managing doctor appointments, featuring role-based authorization and Multi-Factor Authentication (MFA)

License

Notifications You must be signed in to change notification settings

Gambit142/DocLink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DocLink

A secure, responsive C# ASP.NET Core MVC application that facilitates scheduling and managing doctor appointments, featuring role-based authorization and Multi-Factor Authentication (MFA).


🏗️ Built With

Core Technologies

  • ASP.NET Core 9.0 (MVC) - Web application framework for building secure and scalable applications.
  • C# - The primary programming language.
  • Entity Framework Core 9.0 - Object-Relational Mapper (ORM) for data access (Database First Approach).
  • SQL Server LocalDB - The lightweight database used for local development.

Backend Technologies

  • ASP.NET Core Identity - User authentication and authorization system.
  • AutoMapper - Convention-based object-to-object mapping.
  • Microsoft.AspNetCore.SignalR - Library for real-time web functionality (notifications).
  • QRCoder - Library for generating QR codes for MFA setup.
  • Microsoft.EntityFrameworkCore.Tools - For managing database migrations.
  • Serilog (or standard logging) - Logging infrastructure.

Frontend Technologies

  • Bootstrap 5.3.x - Responsive and mobile-first CSS framework.
  • Popper.js - Used by Bootstrap for positioning tooltips and popovers.
  • jQuery 3.7.x - JavaScript library for DOM manipulation.
  • jQuery Validation Unobtrusive - Client-side validation for ASP.NET MVC forms.

🚀 Overview

DocLink is a health platform connecting potential patients with registered doctors. It allows patients to view doctor schedules, book appointments (subject to doctor approval), and find doctors grouped by specialty.

Key Features

  • Secure Authentication: Utilizes ASP.NET Core Identity with Multi-Factor Authentication (MFA) via a scanner code for enhanced login security.
  • Role-Based Authorization: Separate experiences for Doctor and Patient roles.
  • Appointment Workflow: Patients request appointments, and doctors can approve or refuse the booking.
  • Real-time Communication: Uses SignalR for potential real-time notifications or updates.
  • Responsive Design: Implemented using Bootstrap for an optimal viewing experience on all screen sizes.
  • Database First Approach: Database structure is managed using Entity Framework Core Migrations.

⚙️ Prerequisites

To run this project locally, you must have the following software installed:

  • Visual Studio 2022 (Recommended): With the ASP.NET and web development workload installed.
  • .NET 9.0 SDK: The target framework of the application.
  • SQL Server Express or LocalDB: For running the database locally (LocalDB is included with Visual Studio).
  • Git: For cloning the repository.

💻 Running the Project Locally (Recommended via Visual Studio)

1. Clone the Repository

Open your terminal or command prompt and clone the repository:

git clone <repository_url>
cd DocLink

2. Open in Visual Studio

Open Visual Studio.
Select File > Open > Project/Solution...
Navigate to the cloned directory and select the DocLink.sln file.


3. Restore Dependencies

Visual Studio should automatically restore the NuGet packages listed in DocLink.csproj and the client-side libraries listed in libman.json upon opening the solution.

If not, ensure all NuGet Packages are restored (Right-click solution → Restore NuGet Packages).

For client-side libraries (Bootstrap, jQuery, etc.), if they are missing from wwwroot/lib, manually trigger LibMan restoration (Right-click libman.json → Restore Client-Side Libraries).


4. Run Entity Framework Core Migrations

The application uses a database-first approach and relies on migrations to create the LocalDB database and its schema.

In Visual Studio, go to Tools > NuGet Package Manager > Package Manager Console.
Ensure DocLink is selected as the Default project.
Run the following commands in order:

# 1. Update the database to the latest migration
Update-Database
# This command creates the database based on the migrations and the
# ApplicationDbContext. The DbInitializer will then seed the initial data.

The ApplicationDbContext is configured to attempt a database backup before applying migrations and the DbInitializer will run on application start to seed the Admin and Doctor roles, and create initial Doctor users from the Data/doctors.json file.

5. Configure and Run the Application

  • Check Connection String: Verify the connection string in appsettings.json points correctly to your local SQL Server instance (by default, (localdb)\mssqllocaldb).
"ConnectionStrings": {
    "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=DocLink;Trusted_Connection=True;MultipleActiveResultSets=true"
}
  • Run: Press F5 or the "IIS Express" button in Visual Studio.

6. Access the App

The application should open in your default browser, typically at a path like https://localhost:<port>/.

🔑 Initial User Credentials

The DbInitializer.cs file attempts to create doctor accounts using a default password.

Role Default Password MFA Status
Doctor Doctor@123 Key Generated (Must set up and change in Authenticator App on first login)

Note: The new password must meet the minimum requirements configured in program.cs (RequiredLength = 10, RequireDigit = true).

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to open a pull request or check the issues page.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details (if a LICENSE file exists in your repository).

About

A secure, responsive C# ASP.NET Core MVC application that facilitates scheduling and managing doctor appointments, featuring role-based authorization and Multi-Factor Authentication (MFA)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published