A simple Flask web application to manage a collection of books. This app allows you to add books with their title, author, and rating, which are stored in a SQLite database.
- View a list of all books in the collection on the homepage.
- Add a new book with its title, author, and rating through a form.
- Remove a book from the database
- Change Book's rating by accessing and editing the database
- Data is stored persistently in a SQLite database.
- Python
- Flask
- SQLite
- Flask-WTF (for forms)
- Bootstrap (for styling)
-
Clone the Repository
git clone https://github.com/yourusername/book-collection-app.git cd book-collection-app
-
Create a Virtual Environment
python3 -m venv .venv source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
-
Install Dependencies
pip install -r requirements.txt
-
Run the Application
python main.py
Open http://127.0.0.1:5000 in your browser to view the app.
- Go to the homepage to view the list of books. If there are no books, it will show a message: "Library is empty."
- Click on "Add New Book" to add a new book to the collection.
- Enter the book title, author, and rating, then click "Submit".
- The app will redirect to the homepage, displaying the updated list of books.
- main.py: The main application file with Flask routes and database setup.
- templates/: Folder containing HTML templates for rendering pages.
- static/: Folder for static files like CSS and images.
This project is licensed under the MIT License - see the LICENSE file for details.
This app was developed by Your Name.