Day 63 - ๐ Flask Book Library
A simple Flask + SQLAlchemy web app that lets users create and view a personal book library. This project demonstrates core backend concepts including routing, forms, database persistence, and template rendering.
README GENERATED BY AI
โจ Features
- ๐ View a list of books
- โ Add new books using a form
- ๐พ Persistent storage with SQLite
- ๐ง ORM-based database modeling (SQLAlchemy)
- ๐งพ Form handling & validation with Flask-WTF
๐ ๏ธ Tech Stack
- Python 3
- Flask
- Flask-SQLAlchemy
- Flask-WTF
- SQLite
- Jinja2
๐ Project Structure
.
โโโ main.py
โโโ books.db
โโโ templates/
โ โโโ index.html
โ โโโ add.html
โโโ static/
โ โโโ (optional CSS)
โโโ README.md
๐ Getting Started
1๏ธโฃ Clone the repository
bash
git clone https://github.com/your-username/your-repo-name.git
cd your-repo-name
2๏ธโฃ Install dependencies
bash
pip install flask flask-sqlalchemy flask-wtf
3๏ธโฃ Run the app
bash
python main.py
You should see:
โ
Tables created
Then open:
http://127.0.0.1:5000/
๐งช Example Output
Dune - Frank Herbert - 9.5/10
The Midnight Library - Matt Haig - 8.7/10
๐ Notes
- The database is automatically created on startup
- SQLite is stored locally as
books.db - This project focuses on backend fundamentals, not styling
๐ฑ Future Improvements
- โ๏ธ Edit existing books
- ๐๏ธ Delete books
- โญ Sort by rating
- ๐จ Add CSS styling
- ๐ User authentication
๐ Final Thoughts
This project marks the first published project built on a MacBook and serves as a solid foundation for future Flask applications.
Built with curiosity, debugging pain, and a lot of learning ๐ช