DEV Community

Theekshana Sachintha
Theekshana Sachintha

Posted on

Challenges I Faced in the BloodLinePro Project and How I Overcame Them

Challenges I Faced in the BloodLinePro Project and How I Overcame Them - University Project 200 level

Embarking on the development of BloodLinePro, a comprehensive blood bank management system, was an exciting yet challenging experience. From technical obstacles to design decisions, the journey was full of learning opportunities. Here, I’ll share some key challenges I encountered and the solutions I implemented to overcome them.

1. Designing the Database Schema

Challenge:

The complexity of managing donor details, blood inventory, hospitals, and health professionals required a robust and scalable database design. Early on, I struggled to identify the relationships between these entities, especially when implementing foreign key constraints.

Solution:

I started by sketching an Entity-Relationship Diagram (ERD) to visualize the relationships.

With tools like MySQL Workbench, I refined the schema iteratively.

Key decisions included:

Using a donors table linked to a users table through userid as a foreign key.

Adding a hospital_id field in the inventory table to track blood stocks for specific hospitals.

This approach ensured data integrity and minimized redundancy.

2. Implementing Secure User Authentication

Challenge:

Handling user authentication securely was critical to protect sensitive information. Initial attempts led to vulnerabilities, including SQL injection risks.

Solution:

I implemented password hashing using PHP's password_hash() and password_verify() functions.

For database interactions, I used prepared statements with PDO to prevent SQL injection.

Additionally, session handling was secured by setting appropriate session configurations:

ini_set('session.cookie_httponly', true);
ini_set('session.cookie_secure', true);
session_start();

These measures significantly enhanced the security of the system.

3. Dynamic Blood Inventory Management

Challenge:

Ensuring real-time updates to blood inventory when a donation was logged or blood was requested by another hospital was initially complicated. The manual approach led to errors and inefficiencies.

Solution:

I automated inventory updates using backend logic:

Whenever a donor’s blood type was logged, their blood type was automatically used to update the inventory.

Transactions were handled using MySQL’s begin_transaction, commit, and rollback methods to maintain consistency.

This eliminated the need for redundant input and reduced human error.

4. Creating an Intuitive User Interface

Challenge:

Balancing functionality and aesthetics in the user interface was difficult. Early designs felt cluttered and unintuitive.

Solution:

I adopted Bootstrap for a responsive and modern design.

Key improvements included:

Adding a sidebar navigation menu for quick access.

Using modals for tasks like editing profiles to avoid navigating away from the main dashboard.

Integrating dynamic charts (via Chart.js) for visualizing blood inventory trends.

This enhanced the overall user experience and made the interface more engaging.

5. Email Notifications for Users

Challenge:

Setting up email notifications (e.g., for successful registrations or blood requests) was new to me, and initial attempts faced SMTP configuration errors.

Solution:

I used PHPMailer to handle emails:

Configured SMTP settings with Gmail for testing purposes.
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'your-email@gmail.com';
$mail->Password = 'your-password';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;

Conclusion

The BloodLinePro project was a rewarding experience that pushed me to learn and grow as a developer. Each challenge taught me the importance of planning, attention to detail, and persistence. By sharing these solutions, I hope to inspire and assist others facing similar hurdles in their projects.Project(Git-Hub)https://github.com/MktSachi/bloodlinepro.git

Feel free to share your thoughts or questions in the comments—I’d love to hear from you!
Image description

Top comments (0)