Skip to content

Misrilal-Sah/MediFlow

Repository files navigation

MediFlow Logo

MediFlow

Hospital Management System

Python Flask MySQL License


MediFlow is a full-stack web application for managing hospital operations — doctors, patients, and appointments — built with Flask and MySQL. It features a modern dark/light-mode UI, email-verified authentication, and a responsive collapsible sidebar.

Features

  • Authentication — Signup with email verification, login, forgot/reset password via secure tokenized email links
  • Doctors — Add, edit, delete doctors with specialization, availability days, and fee
  • Patients — Full patient records with contact details and history
  • Appointments — Book, manage, and track appointments with status (Scheduled / Completed / Cancelled)
  • Dashboard — Stats overview with charts, recent appointments timeline, and quick-access cards
  • Settings — Update profile, change password, email change with confirmation link
  • Theme — Dark / Light mode toggle, persisted per browser
  • Responsive UI — Collapsible sidebar with SVG icons, glass morphism design
  • Email notifications — Welcome email on signup, email verification, password reset, email change confirmation

Tech Stack

Layer Technology
Backend Python 3.10+, Flask 3.0
Database MySQL 8.0+
ORM/Driver Flask-MySQLdb
Auth bcrypt (password hashing), itsdangerous (signed tokens)
Email smtplib + MIME (SMTP via Gmail)
Frontend Vanilla JS, CSS3 (custom design system, no framework)
Templating Jinja2

Project Structure

mediflow/
├── app.py              # Main Flask application & all routes
├── config.py           # Config loaded from .env
├── requirements.txt    # Python dependencies
├── schema.sql          # Database schema (CREATE TABLE statements)
├── seed.sql            # Optional seed data
├── .env.example        # Environment variable template
├── static/
│   ├── css/style.css   # Full custom design system
│   └── js/script.js    # Theme toggle, sidebar, modals, toasts
└── templates/
    ├── base.html               # Base layout (sidebar, topbar, loader)
    ├── dashboard.html
    ├── doctors.html / add_doctor.html / edit_doctor.html
    ├── patients.html / add_patient.html / edit_patient.html
    ├── appointments.html / book_appointment.html
    ├── settings.html
    ├── login.html / signup.html
    ├── forgot_password.html / reset_password.html
    └── verify_email_pending.html

Getting Started

Prerequisites

  • Python 3.10+
  • MySQL 8.0+

1. Clone the repository

git clone https://github.com/Misrilal-Sah/MediFlow.git
cd MediFlow

2. Create a virtual environment

python -m venv venv
# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Set up environment variables

cp .env.example .env

Edit .env with your actual values:

SECRET_KEY=your_random_secret_key

MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_PASSWORD=your_mysql_password
MYSQL_DB=hospital_management

SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_EMAIL=your_email@gmail.com
SMTP_PASSWORD=your_app_password
SMTP_DISPLAY_NAME=MediFlow

5. Set up the database

mysql -u root -p
CREATE DATABASE hospital_management;
USE hospital_management;
SOURCE schema.sql;
-- Optional: SOURCE seed.sql;

6. Run the application

python app.py

Visit http://127.0.0.1:5000 in your browser.

Environment Variables Reference

Variable Description Default
SECRET_KEY Flask session secret (required)
MYSQL_HOST MySQL host 127.0.0.1
MYSQL_PORT MySQL port 3306
MYSQL_USER MySQL username root
MYSQL_PASSWORD MySQL password (required)
MYSQL_DB Database name hospital_management
SMTP_HOST SMTP server host smtp.gmail.com
SMTP_PORT SMTP port 587
SMTP_EMAIL Sender email address (required for email features)
SMTP_PASSWORD SMTP App Password (required for email features)
SMTP_DISPLAY_NAME Display name in emails MediFlow

Screenshots

The dashboard features live stats, a doughnut chart for appointment status distribution, and a timeline of upcoming appointments.

UI screenshots coming soon. Run the app locally to preview.

Roadmap

  • Role-based access control (Admin / Doctor / Receptionist)
  • Patient medical history & prescription records
  • Appointment reminders via email
  • Invoice & billing module
  • REST API for mobile integration
  • Docker support for easy deployment

Changelog

v1.1.0

  • Added mobile responsive layout with off-canvas sidebar
  • Tablet (768–1024px): icon-only collapsed sidebar
  • Mobile (≤767px): hamburger header, full-width content
  • Fixed iOS input auto-zoom on all form pages

v1.0.0

  • Initial release: doctors, patients, appointments, dashboard
  • Email verification flow with tokenized links
  • Dark / Light mode toggle

Contributing

Contributions are welcome! Please open an issue first to discuss the change you'd like to make, then submit a pull request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -m 'feat: add your feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Open a Pull Request

License

MIT © Misrilal Sah

About

MediFlow is a Python Flask–based hospital management system designed to streamline patient records, appointments, billing, and clinical workflows in a unified platform.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors