Skip to content

KubaWoj666/FastApi-book-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Book Library REST API

REST API for online library. It supports authors of books and books resources including Oauth2 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_URL MySQL template

SQLALCHEMY_DATABASE_URL=f"mysql+mysqlconnector://{settings.database_username}:{settings.database_password}@{settings.database_hostname}:{settings.database_port}/{settings.database_name}"

  • Create a virtual environment
    python -m venv venv
  • Activate virtual environment (in VsCode)
    source venv/bin/activate
  • Install packages from requirements.txt
    pip install -r requirements.txt
  • Migrate database
    alembic upgrade head
  • Run server by command
    uvicorn app.main:app --reload
  • Load sample data

Tests (in future)

In order to execute tests located in tests
run the command:
python -m pytest tests/

Technologies / Tools

  • Python 3.10
  • FastApi
  • alembic 1.9.2
  • SQLAlchemy 1.4.46
  • pytest==7.2.1
  • MySQL
  • Heroku
  • Postman

About

Rest Api create in Python and FastApi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published