Overview

ENGINEERINGSMART HOSTEL

Table of Contents

Stepping Out of the Comfort Zone
The 1,500₹ Flex Tier ArchitectureHigh-Read Caching: Redis for Menus & NoticesDesigning for Juniors: Why MongoDB & React Native?Scope Discipline & Edge-Case Debugging

Stepping Out of the Comfort Zone

The idea for Smart Hostel began during a regular lecture at IIIT Sonepat. A senior professor entered the classroom asking if anyone was interested in building an official mobile application to digitize the college's hostel operations.

I was naturally introverted and rarely ventured outside my comfort zone. But I recognized this was a rare opportunity to build real institutional software. I stepped forward, approached the professor, and took on the project. I led the entire system design, database schemas, and codebase, bringing a few friends on board primarily for API testing and QA verification.

The 1,500₹ Flex Tier Architecture

When presenting the system to the college, the infrastructure costing came under debate. A teammate proposed a rigid fixed-tier cloud plan costing $25 + $7 every month. I analyzed our actual usage patterns and argued that paying heavy fixed fees was a waste of college budget.

Hostel traffic is not uniform - server calls and database queries happen in intense, concentrated bursts: evening GPS attendance (7 PM - 10 PM IST) and meal rating hours. During class hours and late nights, the app sits idle. I architected a dynamic Flex scaling plan using MongoDB Atlas Flex ($8/mo) and scalable compute ($5/mo). The system scales up vertically and horizontally only during attendance and meal spikes, keeping monthly operating costs locked at just ~₹1,500 INR/month.

High-Read Caching: Redis for Menus & Notices

Institutional notices from wardens and the weekly mess menu are largely static: they are updated once a day or once a week, yet hundreds of students check them at the exact same minute before lunch or evening roll call.

Hitting MongoDB for every student lookup would create unnecessary database contention. I implemented an in-memory Redis caching layer via ioredis. Static notices and mess menus resolve from RAM in single-digit milliseconds, shielding the primary database completely and preventing spike-driven compute charges.

Designing for Juniors: Why MongoDB & React Native?

People often ask why I chose MongoDB over PostgreSQL when institutional data has relational aspects, or React Native over Flutter. The answer comes down to long-term open maintenance.

As the founding developer, I knew I would eventually graduate. MongoDB and JavaScript/React are the first technologies almost every college junior learns when starting web development. Choosing React Native and MongoDB ensured that incoming junior engineers could easily understand, maintain, and extend the codebase without facing steep framework learning curves.

Scope Discipline & Edge-Case Debugging

The biggest challenge on this project wasn't just technical; it was controlling scope. Institutional applications easily spiral out of control with endless feature requests (laundry tracking, room allocation, visitor parking). I enforced strict scope discipline to focus entirely on four high-impact pillars: Digital Gate Passes, GPS Attendance, Mess Feedback, and Emergency SOS.

During testing, we caught an edge-case bug where parent approval notification requests failed to trigger under specific multi-child links. Tracing the controller logic revealed missing parent push token handshakes during batch onboarding. Hardening the linking schemas and writing automated integration tests resolved the issue permanently.