The Blood Donation System is a Node.js application that utilizes MySQL to manage donor and patient information. It provides a simple interface to add donors and patients, check blood availability, generate bills, and maintain a database of blood donors.
Before running the application, ensure that you have Node.js and MySQL installed on your machine. Follow the steps below to set up the project:
-
Node.js: If you don't have Node.js installed, download and install it from https://nodejs.org/.
-
MySQL: Install MySQL on your machine. You can download it from https://www.mysql.com/.
-
Clone the repository:
git clone https://github.com/your-username/blood-donation-system.git cd blood-donation-system
-
Install dependencies:
npm install
-
Start MySQL Server:
-
For Windows:
# Start MySQL server net start mysql
-
For Linux:
# Start MySQL server sudo service mysql start
-
-
Configure the database:
-
Create a MySQL database named
mysql
(you can choose a different name if you prefer).CREATE DATABASE IF NOT EXISTS mysql; USE mysql;
-
Update the configuration in
config.js
with your database details.
-
-
Run the application:
node app.js
To use the Blood Donation System:
-
Open your web browser and go to http://localhost:3000/ to access the homepage.
-
To navigate to the admin route, visit http://localhost:3000/admin.
-
Add donors and patients as follows:
-
Add donor: Click on the "Add Donor" button on the homepage, enter the donor details, and submit the form.
-
Add patient: Navigate to http://localhost:3000/, click on the "Add Patient" button, enter patient details, and submit the form.
-
-
Check blood availability:
- Navigate to http://localhost:3000/, enter patient details, and the system will display a donor list if the patient is present in the database.
-
Generate bills:
- After selecting a donor, a bill will be generated, and the donor and blood details will be removed from the database.
- Add Donor: Ability to add information about blood donors.
- Add Patient: Ability to add information about patients.
- Check Blood Availability: Check if a particular blood type is available for a given patient.
- Generate Bills: Generate bills for blood donations and remove donor and blood details from the database.
If you'd like to contribute to this project, please follow the guidelines outlined in the CONTRIBUTING.md file.
This project is licensed under the MIT License.