A simple web app back-end and front-end for a Blood Bank System.
In its default configuration, this project uses an data-file database (H2) which gets populated at startup with data. The h2 console is exposed at localhost:8080/h2-console. There are 9 model classes (entities) in total, which most of them have some sort of controller.
- address: fetching all and deletion by id [additional, for viewing; in real only would be available for admin to see]
- bloodbank: fetching all, getting one by id, creating, deleting, updating
- donation: fetching all, getting one by id, getting all donations of a donor id, registering donation (with date of now), registering donation with a given date, updating a donation
- donor: fetching all, getting one by id, getting donor by a specifed param f.e [api/donors/search?city=LONDON], sorting by given value [name, lastname etc.], creating donor, updating and deletion
- hospital: fetching all, getting one by id, creating a hospital, updating and deletion
- patient: fetching all, getting one by id, getting patient by a specifed param f.e [api/patients/search?name=JANE], sorting by given value, creation a patient, updating and deletion
- requests: fetching all, getting one by id, creating, updating and deletion
- bloodinventories: fetching all, getting blood stock for a specified blood bank and blood id: [api/bloodinventory/bloodbank/52/bloodtype/7]
- statistics which include how much of blood quantity there is total in all of blood banks and how many requests have been assigned a specified status and grouped by it :]
- implementation of frontend using html, css and javasript
done first on this project and it is more as a visualization than implementation
created on https://dbdiagram.io

Table Address {
id integer [primary key]
city string
country string
street string
zipcode string
}
Table Blood_Bank {
address_id integer
id integer [primary key]
name string
}
Table Blood_Inventory {
quantity_in_liters double
bloodbank_id integer
bloodtype_id integer
id integer [primary key]
}
Table Blood_Type {
id integer [primary key]
blood_group string
protein string
}
Table Donation {
date date
bloodbank_id integer
bloodtype_id integer
donor_id integer
id integer [primary key]
}
Table Donor {
dateofbirth date
gender integer
address_id integer
bloodtype_id integer
id integer [primary key]
name string
surname string
phonenumber string
}
Table Hospital {
address_id integer
id integer [primary key]
contact_email string
name string
phonenumber string
}
Table Patient {
dateofbirth date
gender integer
address_id integer
bloodtype_id integer
id integer [primary key]
name string
surname string
phonenumber string
}
Table Request {
quantity_in_liters double
requestdate date
bloodbank_id integer
bloodtype_id integer
hospital_id integer
id integer [primary key]
status string
}
Ref address_bloodbank: Address.id > Blood_Bank.address_id
Ref bloodinventory_bloodbank: Blood_Bank.id > Blood_Inventory.bloodbank_id
Ref bloodinventory_bloodtype: Blood_Type.id > Blood_Inventory.bloodtype_id
Ref bloodbank_donation: Blood_Bank.id > Donation.bloodbank_id
Ref bloodtype_donation: Blood_Type.id > Donation.bloodtype_id
Ref donor_donation: Donor.id > Donation.donor_id
Ref address_donor: Address.id > Donor.address_id
Ref bloodtype_donor: Blood_Type.id > Donor.bloodtype_id
Ref address_hospital: Address.id > Hospital.address_id
Ref address_patient: Address.id > Patient.address_id
Ref bloodtype_patient: Blood_Type.id > Patient.bloodtype_id
Ref bloodbank_request: Blood_Bank.id > Request.bloodbank_id
Ref bloodtype_request: Blood_Type.id > Request.bloodtype_id
Ref hospital_request: Hospital.id > Request.hospital_id



