PhirakbotDiff / FARM-Auth

Adding authentication to FARM stack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FARM-Authentication

This code is an example FARM (FastAPI, React, MongoDB) project with Authentication.

It was written to accompany the MongoDB developer article "Adding Authentication to your FARM Stack App". You should probably read that blog post before running the code here, but if you want to get started quickly short instructions are below.

Installation

Install into your currently active Python environment with:

python3 -m pip install -r requirements.txt

Configuration

You'll need to set the following environment variables before running the project:

    # The following will work on Linux & OSX:
    export DEBUG_MODE=True
    export DB_URL="mongodb+srv://<username>:<password>@<url>/farmstack?retryWrites=true&w=majority"
    export JWT_SECRET_KEY="<secret value>"
    export REALM_APP_ID="<realm id>"

Run It

Run the code with the following command:

uvicorn main:app --reload

About

Adding authentication to FARM stack

License:Apache License 2.0


Languages

Language:Python 100.0%