Skip to content

I am learning FastAPI. This Repository contains a basic project which deals with some simple data and interact with MongoDB for accessing/updating it

License

Notifications You must be signed in to change notification settings

thesparkvision/FastAPI-Basic-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI

Intro

This repository is to practice FastAPI code while learning it

Live App Link

https://fastapi-learning.onrender.com/

Setup

Python Version: 3.11.1

  • Create Virtual env

    python3 -m venv venv
  • Install Packages

    pip install -r requirements.txt
  • Add these environment variables in .env file or in shell

    export MONGO_URI=mongodb://172.17.0.2:27017
    export PYTHONPATH=$PYTHONPATH:$PWD
    export APP_HOST=0.0.0.0
    export APP_PORT=8000
    
  • Install MongoDB or use MongoDB Docker Image (https://hub.docker.com/_/mongo)

Run the app directly in local environment inside src folder

python3 main.py

Local Docker Container Setup

If you prefer to use docker container, or need to debug the build for some reason, you can follow these chain of commands:

  • Build the Docker Image

    docker build . -t fastapi-learning:v1 -f deploy/Dockerfile
  • Create and Run Docker container

    docker run -d --net=host fastapi-learning:v1

Run Lint

bash scripts/lint.sh

About

I am learning FastAPI. This Repository contains a basic project which deals with some simple data and interact with MongoDB for accessing/updating it

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published