An open API service indexing awesome lists of open source software.

https://github.com/mmncit/fast-posts

Backend for Post Management System (Minimal using FastAPI, SQLAlchemy, PostgresDB, Alembic)
https://github.com/mmncit/fast-posts

alembic backend-api fastapi postgres python sqlalchemy-orm

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# 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
```

2. Install python packages

```
make install
```

3. Create .env file containing credentials:

```
# for database connection
export DATABASE=
export DB_USER=
export DB_HOST=
export DB_PASSWORD=
export DB_URL=

# for jwt
export SECRET_KEY=
export ALGORITHM=
export ACCESS_TOKEN_EXPIRE_MINUTES=

```

Apply environment variables

```

source .env

```

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

```