Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tusharpamnani/dbms-lab-project

A mini project made for DBMS Lab. This implements the learnings of SQL
https://github.com/tusharpamnani/dbms-lab-project

flask project sql

Last synced: about 1 month ago
JSON representation

A mini project made for DBMS Lab. This implements the learnings of SQL

Awesome Lists containing this project

README

        

# COVID Care Center Management Application

This Flask application facilitates the management of a COVID care center, enabling seamless registration, login, and bed booking functionalities for both patients and hospital staff.

## Features:

- **User Management:**
- Patients can register by providing their SRFID, email address, and date of birth.
- Hospital staff can register using their hospital code, email address, and password (hashed for security).
- Secure login mechanism for both patients and staff.
- **Hospital Data Management:**
- Hospital staff can add, edit, and delete hospital information, including name and bed capacity (normal, HICU, ICU, ventilator).
- **Patient Slot Booking:**
- Patients can search for available beds (normal, HICU, ICU, ventilator) across different hospitals.
- Patients can book a slot by specifying their SRFID, bed type, desired hospital (using the hospital code), and additional details (SPO2 level, name, phone number, address).
- The application updates hospital bed availability in real-time upon successful booking.

## Dependencies:

- Flask: A lightweight web framework for building Python web applications. ([https://flask.palletsprojects.com/](https://flask.palletsprojects.com/))
- Flask-SQLAlchemy: Enables interaction with a relational database using SQLAlchemy. ([https://flask-sqlalchemy.palletsprojects.com/](https://flask-sqlalchemy.palletsprojects.com/))
- Flask-Login: Implements user authentication functionalities for Flask applications. ([https://flask.palletsprojects.com/en/2.3.x/](https://flask.palletsprojects.com/en/2.3.x/))

## Optional Dependencies:

- Flask-Mail (for sending email notifications - not currently implemented)

## Database:

The application leverages a MySQL database to store user information, hospital details, and patient bookings.

## Getting Started:

1. **Prerequisites:** Ensure you have Python and the required dependencies (Flask, Flask-SQLAlchemy, Flask-Login) installed.
- You can install them using `pip install Flask Flask-SQLAlchemy Flask-Login`.
2. **Database Configuration:**
- Replace the placeholder connection details in the `app.config` section of `main.py` with your actual MySQL credentials (host, username, password, database name).
3. **Run the Application:**
- Navigate to the application directory in your terminal and execute `flask run`. This will start the development server, and you can typically access the application at `http://127.0.0.1:5000/` (or the port specified in your configuration).

## Additional Notes:

- The provided code (`main.py`) includes comments to enhance readability and understanding.
- Certain functionalities, such as email notifications, are commented out and require further configuration for activation.
- Error handling and security measures can be further strengthened to ensure a robust application.

## Database Schema (`covid.sql`):

The `covid.sql` script establishes the database structure for the application. Here's a breakdown of the tables:

1. **user:** Stores patient data (SRFID, email, date of birth).
2. **hospitaluser:** Manages hospital staff information (hospital code, email, hashed password).
3. **hospitaldata:** Contains hospital details (code, name, bed capacity for normal, HICU, ICU, ventilator beds).
4. **bookingpatient:** Tracks patient bed bookings (SRFID, bed type, hospital code, SPO2 level, patient name, phone number, address).
5. **test:** Likely a temporary table used for testing purposes (contains names).
6. **trig:** Stores triggers fired on insert, update, and delete operations on the `hospitaldata` table. It includes hospital code, bed capacity details, query type (INSERTED, UPDATED, DELETED), and timestamp.

These triggers maintain a log of hospital data modifications for auditing purposes.