Giter Club home page Giter Club logo

fastapi-auth's Introduction

FastAPI Authentication APIs - Test Driven Development (TDD)

APIs

ALT TEXT

Installation & Configuration

  • Install the Docker Desktop and Start It
  • Clone this repository in your local machine by typing ``.
  • Open the Terminal and navigate to https://github.com/Isaiah-Mwinga/FastAPI-auth the project folder.
  • Run docker volume create describly_mysql_data to create a docker volue in you machine. Required to persist the mysql data.
  • Below will be your mysql connection details
MYSQL_HOST=mysql
MYSQL_USER=root
MYSQL_PASSWORD=Describly&123
MYSQL_DB=fastapi
MYSQL_PORT=3306

You do not need to change anything here, but if you would like to change the username, password or database name, you can modify it at this point in the .env file attached to this project.

Building the Project

  • We can start building our projects by running docker-compose build
  • One build is done, run docker-compose up to start the services. Leave this terminal open to check the logs.
  • To stop the services you can press Ctrl + C - (Control + C)

Accessing the Docker Containers

Commands

  • To Generate the Migration From Model
docker-compose run fastapi-service /bin/sh -c "alembic revision --autogenerate -m "create my table table""
  • To Apply the Migration to Database
docker-compose run fastapi-service /bin/sh -c "alembic upgrade head"
  • To Revert last applied migration
docker-compose run fastapi-service /bin/sh -c "alembic downgrade -1"
  • To Run the Test
docker-compose run fastapi-service /bin/sh -c "pytest"
  • Display the info logs in the test
docker-compose run fastapi-service /bin/sh -c "pytest --log-cli-level=INFO"
  • Running a single test file
docker-compose run fastapi-service /bin/sh -c "pytest tests/test_folder/test_file.py"

fastapi-tdd-user-authentication

fastapi-auth's People

Contributors

isaiah-mwinga avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.