Skip to content

In this project, I build a complete backend application in Flask, write automatic tests and implement a solution on the AWS cloud.

Notifications You must be signed in to change notification settings

tomaszsmaruj25/Flask-Book-Library-REST-API

Repository files navigation

Book Library REST API

Code was implemented thanks to the Udemy course - REST API development step by step - Python | Flask | MySQL . REST API for online library. It supports authors of books and books resources including authentication (JWT Token).

The documentation can be found in documentation.html or here

Setup

  • Clone repository
  • Create database and user
  • Rename .env.example to .env and set your values
# SQLALCHEMY_DATABASE_URI MySQL template
SQLALCHEMY_DATABASE_URI=mysql+pymysql://<db_user>:<db_password>@<db_host>/<db_name>?charset=utf8mb4
  • Create a virtual environment
python -m venv venv
  • Install packages from requirements.txt
pip install -r requirements.txt
  • Migrate database
flask db upgrade
  • Run command
flask run

NOTE

Import / delete example data from book_library_app/samples:

# import
flask db-manage add-data

# remove
flask db-manage remove-data

Tests

In order to execute tests located in tests/ run the command:

python -m pytest tests/

Technologies / Tools

  • Python 3.8.0
  • Flask 1.1.2
  • Alembic 1.4.2
  • SQLAlchemy 1.3.16
  • Pytest 5.4.3
  • MySQL
  • AWS
  • Postman

About

In this project, I build a complete backend application in Flask, write automatic tests and implement a solution on the AWS cloud.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published