The API Digital Library is a Python-based web application that leverages technologies such as Python 3, SQL Alchemy, Flask, and MySQL to provide a platform for users to manage their book collections. This project serves as a practical exercise in developing a robust API, focusing on fundamental principles and best practices.
- User Authentication: Users can create accounts, log in, and manage their bookshelves.
- Book Management: Users can add, view, and remove books from their personal bookshelves.
- Admin Privileges: Only users with admin access have the authority to create, update, and delete authors and books.
- Database Integration: The application utilizes SQL Alchemy to interact with a relational database, enhancing data storage and retrieval capabilities.
- Dockerization: The project is containerized using Docker, facilitating easy deployment and scalability.
The primary objectives of the API Digital Library project are:
- Skill Development: Gain practical experience in developing APIs using Python and related technologies.
- Database Interaction: Learn how to work with a relational database (MySQL) and utilize SQL Alchemy for efficient data management.
- User Authentication: Implement user authentication mechanisms to secure account creation and access to specific features.
- Testing Practices: Achieve comprehensive test coverage using the Coverage library and Pytest, ensuring the reliability of the application.
-
Clone the repository to your local machine:
bashCopy code
git clone https://github.com/your-username/api-digital-library.git
-
Navigate to the project directory:
bashCopy code
cd api-digital-library
-
Install the required dependencies:
bashCopy code
pip install -r requirements.txt
-
Build and run the Docker container:
bashCopy code
docker-compose up -d
-
Access the application at http://localhost:5000.
-
Run the test suite:
bashCopy code
coverage run -m pytest
-
View the test coverage report:
bashCopy code
coverage report
- Ensure that you have Docker and Python 3 installed on your machine before running the application.
- For admin privileges, customize the user roles and access controls in the application code.