An open API service indexing awesome lists of open source software.

https://github.com/zagrosjawar/flask-book-api

A Dockerized Flask REST API with frontend for managing a book catalog
https://github.com/zagrosjawar/flask-book-api

api crud flask html js python

Last synced: 3 months ago
JSON representation

A Dockerized Flask REST API with frontend for managing a book catalog

Awesome Lists containing this project

README

          

# Flask Book API ๐Ÿ“š

A Dockerized Flask REST API with a simple HTML/JS frontend to manage an online book catalog.

## ๐Ÿ”ง Features

- ๐Ÿงพ View all books
- โž• Add a new book
- โŒ Delete a book by ID
- ๐Ÿง  JSON-based API with full CORS support
- ๐Ÿ’ป Web interface included (HTML/JS)
- ๐Ÿณ Packaged in a Docker container

## ๐Ÿš€ Run with Docker

```bash
docker pull zagjaw/zagros-book-flask-api
docker run -p 5000:5000 zagjaw/zagros-book-flask-api

Visit your app at:
๐Ÿ‘‰ http://localhost:5000

๐Ÿ› ๏ธ Local Development (Without Docker)
Clone the repository:
git clone https://github.com/zagrosjawar/flask-book-api.git
cd flask-book-api

Set up a virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\\Scripts\\activate
pip install -r requirements.txt
Run the Flask server:
python app.py

Visit ๐Ÿ‘‰ http://localhost:5000

๐Ÿ“ Project Structure

flask-book-api/
โ”œโ”€โ”€ app.py # Main Flask API with endpoints
โ”œโ”€โ”€ requirements.txt # Project dependencies
โ”œโ”€โ”€ Dockerfile # Docker image instructions
โ”œโ”€โ”€ .dockerignore # Files to exclude from Docker build
โ”œโ”€โ”€ templates/
โ”‚ โ””โ”€โ”€ index.html # Web frontend (auto-served by Flask)
โ””โ”€โ”€ README.md # Project documentation

๐Ÿณ Docker Support
Build the image manually (if you're working locally):
docker build -t flask-book-api .
docker run -p 5000:5000 flask-book-api

๐Ÿงฐ Built With
Flask

Flask-CORS

Docker

๐Ÿง  Author
Zagros Jawar
๐Ÿ“Ž Docker Hub
๐Ÿ“Ž GitHub