Giter Site home page Giter Site logo

mmncit / fast-posts Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 20 KB

Backend for Post Management System (Minimal using FastAPI, SQLAlchemy, PostgresDB, Alembic)

Python 95.99% Makefile 1.19% Mako 2.82%
backend-api fastapi postgres python sqlalchemy-orm alembic

fast-posts's Introduction

fast-posts

Minimal Post Management System using FastAPI, SQLAlchemy, PostgresDB

Local Setup:

1.0. Create a virtual environment (optional)

python3 -m venv venv
  • Update python interpreter to venv

  • Activate venv for command line

source venv/bin/activate

1.1. Go inside api directory

cd api
  1. Install python packages
make install
  1. Create .env file containing credentials:
# for database connection
export DATABASE=<database name>
export DB_USER=<database username>
export DB_HOST=<hostname, e.g. localhost>
export DB_PASSWORD=<database password>
export DB_URL=<database url>

# for jwt
export SECRET_KEY=<secret pass>
export ALGORITHM=<hashing algorithm>
export ACCESS_TOKEN_EXPIRE_MINUTES=<time to expire access token>

Apply environment variables


source .env

  1. Finally, run command using make

If make is not installed. Then

brew install make

Run the server implemented with raw SQL with:

make run-sql

Run the server implemented with Object Relational Mapper (ORM) SQLAlchemy with:


make run-orm

fast-posts's People

Contributors

mmncit 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.