Skip to content

Blood Donation Application using ASP.NET Core and Blazer

Notifications You must be signed in to change notification settings

dilrukshax/BloodDonationApp

Repository files navigation

🩸 Blood Donation App

ASP.NET Core SQL Server JWT MailKit Swagger Blazor

Features

  • User Registration & Authentication: Secure user sign-up and login with role-based access (admin and user).
  • Event Management: Create, update, delete, and view blood donation events.
  • Registration for Events: Users can register for events and manage their registrations.
  • Admin Dashboard: Comprehensive administrative controls to manage users, events, and view reports.
  • Email Notifications: Automated emails for registration, event updates, and profile changes.
  • Profile Management: Users can view and update their profiles securely.
  • Security: Implements JWT for secure API access and role-based authorization.
  • Advanced Admin Functions:
    • User Management: Administrators can view all registered users, update user information, and delete users as necessary.
    • Event Report Management: Create comprehensive reports for each event, including participation numbers and blood variant collections.
    • Aggregated Statistics: Access summaries of blood variants collected across all events and overall participation metrics.
    • Role Management: Assign or change user roles to control access levels within the application.

Technologies Used

Architecture

The Blood Donation App follows a Client-Server Architecture with a clear separation between the frontend and backend. Here's an overview:

Backend (API)

  • Controllers: Handle HTTP requests and define API endpoints.
  • Services: Contain business logic (e.g., EmailService).
  • Repositories: Manage data access using Entity Framework Core.
  • Models: Define data structures and DTOs (Data Transfer Objects).
  • Authentication & Authorization: Secure endpoints using JWT and role-based access.

Frontend (Blazor)

  • Components: Reusable UI elements for different parts of the application.
  • Pages: Represent different views/routes in the application.
  • Services: Handle communication with the backend API.
  • State Management: Manage user state and application data.

Database

  • SQL Server: Stores user data, event details, registrations, and reports.
  • Migrations: Managed via Entity Framework Core to handle database schema changes.

Setup & Installation

Follow these steps to set up the project locally.

Clone the Repository

git clone https://github.com/your-username/blood-donation-app.git
cd blood-donation-app

Backend Setup

  1. Navigate to the Backend Directory

    cd BloodDonationAPI
  2. Configure Environment Variables

    Create a appsettings.json file with the following structure:

    {
      "ConnectionStrings": {
        "DefaultConnection": "Server=YOUR_SERVER;Database=BloodDonationDB;Trusted_Connection=True;"
      },
      "Jwt": {
        "Key": "YourSecureKeyHere",
        "Issuer": "YourApp",
        "Audience": "YourAppUsers",
        "DurationInMinutes": "60"
      },
      "AdminRegistration": {
        "Code": "AdminSecretCode"
      },
      "EmailSettings": {
        "SmtpServer": "smtp.your-email.com",
        "Port": 587,
        "SenderName": "Blood Donation App",
        "SenderEmail": "[email protected]",
        "Username": "your-email-username",
        "Password": "your-email-password"
      }
    }
  3. Apply Migrations and Update Database

    dotnet ef migrations add InitialCreate
    dotnet ef database update
  4. Run the Backend Server

    dotnet run

    The API should now be running at https://localhost:5001 or http://localhost:5000.

Frontend Setup

  1. Navigate to the Frontend Directory

    cd ../BloodDonationClient
  2. Configure Environment Variables

    Update the appsettings.json or relevant configuration files with the backend API URL.

  3. Run the Frontend Application

    dotnet run

    The frontend should now be accessible at https://localhost:5001 or http://localhost:5000.

Screenshots

Home Page

Web capture_27-12-2024_111348_localhost

Event Management

Web capture_27-12-2024_111436_localhost

Event Report Managemen

Web capture_27-12-2024_111450_localhost

Event Registration Managemen

Web capture_30-12-2024_91036_localhost

All Events

Web capture_27-12-2024_111516_localhost

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project

  2. Create your Feature Branch

    git checkout -b feature/AmazingFeature
  3. Commit your Changes

    git commit -m 'Add some AmazingFeature'
  4. Push to the Branch

    git push origin feature/AmazingFeature
  5. Open a Pull Request

Contact

About

Blood Donation Application using ASP.NET Core and Blazer

Resources

Stars

Watchers

Forks