Blood Donation Application is a web application designed to facilitate blood donation by connecting blood donors with individuals in need of blood. The platform offers a user-friendly interface for both donors and recipients, ensuring efficient communication and coordination for blood donation requests.
Visit Blood Donation Application
- provides detailed documentation of the Blood Donation Application API endpoints and their usage.
- User Registration: Users can register on the platform providing necessary details including name, email, password, blood type, location, age, and last donation date.
- User Login: Registered users can securely log in using their email and password.
- Find Donors: Users can search for blood donors based on various criteria such as blood type, location, name, email, age, and last donation date. The results are paginated and sortable.
- Request Blood: Users can request blood donation from registered donors by providing relevant details including donor's ID, phone number, date of donation, hospital name, hospital address, and reason.
- View Donation Requests: Donors can view incoming donation requests with details such as requester ID, phone number, date of donation, hospital name, hospital address, and reason.
- Update Donation Status: Donors can update the status of received donation requests, marking them as approved or rejected.
- View and Update Profile: Users can view and update their profile information including bio, age, and last donation date.
- Error Handling: Comprehensive error handling mechanisms are in place, providing detailed responses for validation errors, general errors, and unauthorized access attempts.
- Programming Language: TypeScript
- Web Framework: Express.js
- Object Relational Mapping (ORM): Prisma for PostgreSQL
- Authentication: JWT (JSON Web Tokens)
To run Blood Donation Application locally, follow these steps:
-
Clone the Repository: Clone the Blood Donation Application repository to your local machine using Git:
git clone https://github.com/Porgramming-Hero-web-course/l2-b2-fullstack-track-assignment-8-developerMasum
-
Install Dependencies: Navigate to the project directory and install dependencies using npm or yarn:
cd l2-b2-fullstack-track-assignment-8-developerMasum npm install
or
cd l2-b2-fullstack-track-assignment-8-developerMasum yarn install
-
Set Up Environment Variables: Create a
.env
file in the root directory of the project and add the following environment variables:DATABASE_URL=your_postgres_database_url JWT_SECRET=your_jwt_secret_key
Replace
your_postgres_database_url
with the URL of your PostgreSQL database andyour_jwt_secret_key
with a secret key for JWT token encryption. -
Database Migration: Run Prisma migration to apply database schema changes:
npx prisma migrate dev
-
Start the Server: Start the development server:
npm run dev
or
yarn dev
-
Access the Application: Once the server is running, you can access the Blood Donation Application application locally at http://localhost:3000.
-
Explore the API: Use API endpoints to interact with the application. Refer to the API documentation for available endpoints and request/response formats.
- The application follows RESTful API design principles for its endpoints.
- Global error handling middleware ensures consistent error responses throughout the application.
- User authentication is secured using JWT tokens, ensuring a scalable and secure authentication mechanism.
- PostgreSQL is used as the database for storing user and donation request data.
- Detailed API documentation is provided for easy integration with the platform.
- Blood Donation Application aims to promote blood donation and contribute to community well-being by facilitating blood donation processes.