
I Rewrote a Hotel Management System from Scratch to Launch a LINE Bot in One Day
The Task "Connect LINE Bot to our existing hotel management system." That was the brief. When I opened the codebase, I found something unexpected. Code Audit: Three Data Layers, Zero Compatibility Here's what was inside: api.py — in-memory dict for data management models.py — SQLite ORM demo.py — another separate in-memory dict Three incompatible data layers in the same project. None of them talking to each other. No frontend either. Not a single screen that hotel staff could actually use. But the backend logic had value. tasks.py (workflow), scheduler.py (shift management), inventory.py (33 types of supplies) — too good to throw away. Decision: Extract the backend logic, redesign everything else with FastAPI + unified SQLite layer. Redesign Principles Unify the Data Layer Eliminated all in-memory implementations. SQLite became the single source of truth. Dev, test, and production all go through the same code path. Flask → FastAPI Migrated the Flask endpoints to FastAPI for async suppo
Continue reading on Dev.to Python
Opens in a new tab



