Skip to content

LXwaru/blog-project

Repository files navigation

This is a backend boiler plate using FastAPI and PostgreSQL

  • create users
  • secure login using JWT token exchange
  • create/read items specific for each user
  • To use this boilerplate, follow these directions:

    TC = terminal command


    create a virtual environment:

    TC: python -m venv .venv
    TC: source .venv/bin/activate


    download dependencies

    TC: pip install fastapi
    TC: pip install sqlalchemy
    TC: pip install alembic
    TC: pip install pyjwt
    TC: pip install "passlib[bcrypt]"
    TC: pip install psycopg2


    download/setup postgreSQL

    There are a few ways to do this. Click here for the PostgreSQL documentation


    migrations

    migrate down:
    TC: alembic downgrade base
    migrate up:
    TC: alembic revision


    setup an .env file

    create a secret key for the security protocol TC: openssl rand -hex 32
    copy the string and paste it in the .env as:
    SECRET_KEY={your secret key}

    after you've created a postgreSQL database, put the following code into the .env file: DATABASE_URL=postgresql://{username}:{password}@localhost/{dbname}


    open DEV environment on localhost:8000/docs

    TC: fastapi dev app/api/main.py

    About

    JavaScript - Vue.js | Python - FastAPI | PostgreSQL | JWT/OAuth2. This project is a standalone blogging application, with secure user login/authentication functionality.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

     
     
     

    Contributors