Worked example · Python, Flask and SQLite
Hostel Management System source code
A local hostel allocation and management system for a polytechnic. Students apply for a bed space, hostel officers approve applications and allocate beds, and the administrator manages halls, rooms, accounts and room types. The system enforces one bed per student per session and one student per bed space, keeps an allocation history, prints bed-space slips, and works fully offline.
A real system made by the same builder you would use. Yours is built for your own topic and answers, so its screens and tables will differ. This example is not a source-code download.
The problem it solves
Hostel bed allocation is often done manually with paper forms, leading to errors such as double allocation of a bed, students getting more than one bed space, lost applications and slow processing. There is no reliable way to track vacancies, allocation history or check-in status.
Project topic: Design and Implementation of a Hostel Allocation and Management System
Who uses it
admin
Manages halls, rooms, room types, user accounts and view reports.
- create and manage halls and rooms
- manage user accounts and roles
- view all reports and allocations
officer
Hostel officer who reviews applications, allocates beds and manages check-in.
- approve or reject applications
- allocate and release beds
- move students between free bed spaces
- record check-in and view history
student
Student who applies for a bed and views allocation status.
- apply for a bed space
- view own application status
- view allocated room and print bed-space slip
What it does
Student application workflow
Student submits an application for a session. Officer reviews and approves or rejects it.
Bed allocation and management
Officer allocates an approved student to a free bed space, releases a bed, moves a student to another free bed space and records check-in. History is kept.
Hall and room management
Administrator can add, edit and delete hostel halls, rooms and set room types and bed counts.
Reports and CSV export
View beds total, occupied and free per hall, application and allocation lists, and export allocations to CSV.
User account management
Administrator creates and manages user accounts and assigns roles.
Simulated and labelled as such, not real: simulated fee notice.
Screenshots
Screenshots of the running system, taken by our checks. The records are sample data and are labelled so on each page.





Database tables
- usersLocal sign-in accounts and their roleid, username, password_hash, full_name, role, created_at
- studentsStudent profile linked to one user accountid, user_id, matric_no, first_name, last_name, gender, department, sample
- hallsHostel hallsid, name, hall_type, location, sample
- roomsRooms in a hall, each with a fixed bed countid, hall_id, room_number, bed_count
- applicationsOne application per student per sessionid, student_id, session, hall_id, status, submitted_at, sample
- allocationsAn approved application linked to one bed spaceid, application_id, room_id, bed_number, allocated_at, released_at
- allocation_historyAudit trail of allocate, release, move and check_inid, allocation_id, action, old_room_id, new_room_id, old_bed_number, new_bed_number, performed_by, performed_at
- check_insCheck-in record, one per allocationid, allocation_id, checked_in_at
Technology
- Python. The chosen language for the project
- Flask. Small, so every route can be explained one at a time
- Jinja. One template per page over a shared base layout
- SQLite. No server and no setup, and it works offline
- Bootstrap 5. Responsive and stored locally so no internet is needed
- Chart.js. Stored locally, so the chart works offline
- Werkzeug. Stores a hash, never the plain password
- Flask-WTF. Blocks forged form submissions
How to run it: running a Python project on Windows. Not sure which language to pick? Python or PHP.
How it was tested
26 of 26 tests passed, 17 of them automated. The system was also installed from scratch and every screen was opened as the right kind of user before it was accepted.
What it does not do
- It is a local application for one laptop, not a network service, so it has no multi-user logins from other machines.
- Only the fee step is simulated. No real payment, email or SMS is sent.
- There is no CSV or file upload, so records are entered on the pages.
- A bed is a number in a room, so there is no separate bed inventory or maintenance record.
- Deleting a hall or room is refused when the room has allocation records; history is kept rather than deleted.
- There is no online hosting, no mobile app and no automatic room mate matching.
Chapters 3 and 4 from this system
With the MonoEd FYP Generator, signed in with the same Google account, press “Use my working system” when you write Chapter 3 or 4. Its real users, 8 database tables, screenshots and 26 test results go into the chapters, laid out under your supervisor's headings. Nothing is invented: anything the system cannot show, such as a user test, is left for you to fill in.
Want a hostel management system for your own school or business case?
Get a system built for your topic, with a guide, defence questions and screenshots. Plan it free, then ₦13,500 only if you want it built. View pricing.
Start with this topic