What it shows
Small clinics and government dispensaries have long queues and paper registers. A web application that books slots, assigns token numbers and shows the doctor the day’s queue reduces waiting and lost files. The project designs the database, roles, screens and tests of such a system using sample data only.
The science
A normalised database has doctors, patients, slots and appointments, with foreign keys between them. Each slot has a capacity and a doctor, and a booking transaction must check capacity and insert the appointment together so that two people do not get the same token. Roles (receptionist, doctor, admin) decide which pages are available. Queue views use SQL queries ordered by token.
Materials
Cost: free. Many items come from home or from waste; spare parts such as LEDs, motors and wire are in the store.
- A laptop with Python 3, Flask, Flask-Login and SQLite
- A text editor and DB Browser for SQLite
- A browser and a phone for testing
- Sample data of 5 doctors and 100 invented patients
- Draw.io or paper for diagrams
Safety
For this project: Use invented patient data only. Real medical data is private and must not be used for a student project. Hash all passwords and do not expose the server to the internet.
Never use mains electricity: power models with cells, batteries or a low-voltage adapter. Sharp and hot tools, flames and lab chemicals need an adult or your teacher beside you. Keep magnets, button cells and small parts away from young children, and wash your hands after making.
All the safety rulesStep by step
12 steps. Do them in order, and test each part before you go on to the next. Write what you notice in a notebook as you go.
Interview a clinic staff member if possible, and write the problem statement, users and ten functional requirements.
Draw a use case diagram and an entity relationship diagram with at least six tables.
Create the database with constraints, unique keys on doctor and slot, and sample data.
Build login with hashed passwords and three roles with Flask-Login.
Write the booking page that shows free slots for a chosen doctor and date and books one in a database transaction.
Generate a token number per doctor per day and print a slip as a simple page that can be printed.
Build the doctor view that lists today’s appointments in order and allows marking a patient as seen with notes.
Add a receptionist page to reschedule or cancel and to register walk-in patients.
Build an admin report of daily patients, average waiting and cancellations with a chart using Chart.js.
Test concurrency by opening the booking page in two browsers and trying to book the last slot together.
Run 30 test cases and record expected and actual results.
Write the report with the diagrams, screens, tests, security and a section on privacy of health data.
What you should see
Receptionists book and cancel appointments, tokens never repeat, the doctor sees an ordered queue, and the admin report shows daily load. The concurrency test shows only one of two people gets the last slot.
Viva questions
A teacher or a judge will ask how it works. Try to answer each question before you open it, then compare.
1What is a database transaction?
A group of operations that either all succeed or all fail, so data stays consistent.
2How do you avoid double booking?
Check and insert inside one transaction with a unique constraint on slot and token.
3Why role-based access?
Each user should see only the pages and data needed for their work.
4Why not use real patient records for testing?
Health data is sensitive and private, so sample data must be used.
Take it further
Send an SMS or WhatsApp reminder through a free test API the evening before the appointment.
Change one thing, measure what happens, and add a table or chart of your readings: that is what turns a model into your own investigation.
Free ebooks for this project
Programming
Databases and SQL Study Book
The complete study notes, practice questions and glossary for Databases and SQL
Science projects
Writing a Science Project File
How to write the report, from the cover page to the bibliography
