Skip to content

A vezeeta website end points, with onion architecture, using ASP.NET core, Web API and EF Core, with database SQL Server constructed using EF Core Code-First Method.

License

Notifications You must be signed in to change notification settings

Salmaishak/algoriza-internship-2023BE112

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algoriza Internship Back-End Developer Track : Vezeeta Website (Endpoints)

Student Information:

Student Code: BE112/ 2023BE112
Student Name: Salma Magdy Ishak

Technologies Used:

SQL SQL Server ASP.NET Core ASP.NET EF Core ASP.NET Core Web API JWT Authentication in ASP.NET Core

Project Overview:

This project aims to provide hands-on practice on ASP.NET Core, SQL Server, ASP.NET Core APIs, Identity Core, JWT Authentication and Authorizations,Entity Framework and Onion Architecture.

Project Logical Entities Consists of:

  • Admin (User Class)
  • Doctors (Doctor Class Extension of User Class)
  • Patient (User Class)

User Authentication:

User authentication and Authorization is done using JWT Token, with roles based on our 3 project entities. Role, for all entities types, is determined with user login with his given creditionals. He is given the access to only his authorized endpoints. Admin Data Has been seeded into the database as the App has one admin.

builder.Services.AddAuthorization(options =>
{
    options.AddPolicy("Admin", policy =>
    {
        policy.RequireAuthenticatedUser(); 
        policy.RequireRole("Admin"); 
    });

    options.AddPolicy("Doctor", policy =>
    {
        policy.RequireAuthenticatedUser();
        policy.RequireRole("Doctor");
    });

    options.AddPolicy("Patient", policy =>
    {
        policy.RequireAuthenticatedUser();
        policy.RequireRole("Patient");
    });
});

Onion Architecture, it consists of four layers:

--> Main Project : VezeetaEndPoints

  • Core Layer (Vezeeta.Core)

    • Models
      • Appointment
      • Booking
      • Doctor
      • User
      • Discount
      • Specalization
      • Timeslot
    • DTOs
      • AddAppointmentDTO
      • AddDoctorDTO
      • DiscountDTO
      • PatientDTO
    • Repositories
      • IAdminRepository
      • IPatientRepository
      • IDoctorRepository
  • Infrastructure Layer (Vezeeta.Infrastructure)

    • Dbcontexts
      • VezeetaContext
    • Repositories Implementations
      • AdminRepository
      • PatientRepository
      • DoctorRepository
    • Migrations
  • Services Layer (Vezeeta.Services)

    • Interfaces
      • IAdminServices
      • IPatientServices
      • IDoctorServices
      • IEmailService
    • Services
      • AdminServices
      • DoctorServices
      • PatientServices
      • EmailServices
  • Presentation Layer (Vezeeta.Presentation.API)

    • API Endpoints Controller
      • AdminController
      • DoctorController
      • PatientController
      • UserController
    • Program.cs

SQL Server Database Diagram:

(created inside SSMS)

(Back up is also in Database BackUp Folder)

algoriza updated DB

Email Service

  • Service Used : SendGrid API
  • Example of Email:
    Image

Inner Code Enums:

  • User Type
    • Admin
    • Doctor
    • Patient
  • Booking Status
    • Pending
    • Completed
    • Canceled
  • Gender
    • Female
    • Male
  • Day Of Week
    • Saturday
    • Sunday
    • Etc...
  • Discount Activity
    • Active
    • Deactive
  • Discount Type
    • Percentage
    • Value

About

A vezeeta website end points, with onion architecture, using ASP.NET core, Web API and EF Core, with database SQL Server constructed using EF Core Code-First Method.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages