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

https://github.com/drtey/socialapi

Trying to emulate a basic social network´s API with python
https://github.com/drtey/socialapi

bcrypt fastapi jwt oauth2 postgres postgresql psycopg2 pydantic pytest python python3 sqlalchemy

Last synced: about 2 months ago
JSON representation

Trying to emulate a basic social network´s API with python

Awesome Lists containing this project

README

          

# socialAPI

REST API developed with [Python](https://www.python.org/), [FastAPI](https://fastapi.tiangolo.com) & [PostgreSQL](https://www.postgresql.org/)
where you can register users, create and vote posts

Model Validation, JWT Authentication, ORM, Unit testing, password hashing, etc

Stack: SQLAlchemy, psycopg2, OAuth2, bcrypt, pydantic, JWT, FastAPI...

### Run project
```
$ uvicorn app.main:app --reload
```

## Build

### Install dependencies
```
$ pip install -r requirements.txt
```

### Create virtual environment
```
$ python3 -m venv
$ source /bin/activate
```

### PostgreSQL
```
$ sudo apt install postgresql postgresql-contrib
$ sudo service postgresql start
$ sudo -u postgres psql
postgres=# CREATE DATABASE ;
```
To change default pass for "postgres" DB user (NOT UNIX User):
```
postgres=# \password postgres
```

### Documentation
http://127.0.0.1:8000//docs & http://127.0.0.1:8000//redoc