The Full-Flask-RESTful-API-Project is a comprehensive Flask-based web application that serves as a RESTful API for managing a collection of books. It features API routes for creating, retrieving, updating, and deleting books, along with a web interface that uses HTML templates for displaying book data. The application also includes custom error handling, static files for styling and interactivity, and iconography for enhanced user experience.
- RESTful API: Full CRUD (Create, Read, Update, Delete) operations on books via API endpoints.
- Homepage: Displays a list of books with options to add, edit, or delete entries.
- Book Management: Web interface for managing books in the collection.
- Error Handling: Custom error pages for various HTTP status codes.
- Static Files: Includes custom CSS, JavaScript, icons, and images for a polished front-end experience.
- Icons and Images: Pre-designed icons for edit and delete actions, plus sample images.
- Python 3.x
- Flask
- Clone the repository:
git clone https://github.com/Vrana710/Full-Flask-RESTful-API-Project.git
- Navigate into the project directory:
cd Full-Flask-RESTful-API-Project
- Create a virtual environment:
python3 -m venv venv
- Activate the virtual environment:
- On macOS/Linux:
source venv/bin/activate
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
- Install the required dependencies:
pip3 install -r requirements.txt
- Ensure the virtual environment is activated.
- Run the Flask application:
python3 run.py
- Open your web browser and navigate to
http://127.0.0.1:5000/
orhttp://localhost:5000/
to view the application.
app/__init__.py
: Sets up the Flask application, including blueprint registration and configurations.app/main.py
: Contains the main API routes and view functions for book management.app/models.py
: Defines the database schema and models, such as the Book model.app/config.py
: Configuration settings for the application, including database URLs and environment variables.app/utils.py
: Utility functions and helpers that support various functionalities in the application.app/templates/
: Directory containing Jinja2 HTML templates for rendering the web pages.app/static/
: Directory for static assets like CSS, JavaScript, icons, and images.requirements.txt
: Lists all Python packages and dependencies required to run the application.run.py
: The entry point script for running the Flask development server.
Here are some key API endpoints available in this project:
- GET /api/books: Retrieve a list of all books.
- GET /api/books/: Retrieve details of a specific book by its ID.
- POST /api/books: Add a new book to the collection.
- PUT /api/books/: Update the details of an existing book by its ID.
- DELETE /api/books/: Delete a book from the collection by its ID.
If you'd like to contribute to this project, feel free to fork the repository, make changes, and submit a pull request. Issues and feature requests are also welcome!
This project is licensed under the MIT License.
If you have any questions or suggestions, feel free to contact me at [email protected].