Skip to content

sirayhancse/FastAPI-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic AUTH and CRUD FastAPI App

This application perform basic auth authentication using FastAPI Auth and some crud opertaion using sqlalchamy ORM. Create test cases using pytest and used SQLite as a database.

Build Status

Features

  • A user can registration and login using email and password
  • A user can create country with states and address
  • A user can read countries , states and addresses

Installation

FastAPI Demo requires Python v3+ to run.

pull code repo:

# clone this app using http
$ git clone https://github.com/sirayhancse/FastAPI-Demo.git
# go to project directory folder
$ cd FastAPI-Demo

Create a virtual environment and install the dependencies and devDependencies to start the server.

# install virtual enviornment 
$ pip install virtualenv
# create virtual envrionment
$ virtualenv venv
# active virtual environment
$ source venv/bin/active
# install dependencies from requiremtns.txt
$ pip3 install -r requirements.txt
# copy dev.env as .env
$ cp dev.env .env

Run the development environment server...

# Run uvicorn server
$ uvicorn app.main:app --reload

Verify the deployment by navigating to your server address in your preferred browser.

http://127.0.0.1:8000/docs

If everthing is okay , you can see the project swagger page.

Testing

Want to Test app API's?

FastAPI Demo use pytest for fast testing.

Follow this steps and run command on your terminal:

# run pytest suit
$ pytest

If you want to change dummy users or country data , you need to change respective response data also.

License

MIT

About

This is a FastAPI Demo project for connecting a DB with basic CRUD operation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published