Implemented:
-
username:password
authentication and registration. All actions require a JWT token in the request headers -
Readonly viewing posts and users is available without authorization
-
The functionality of a personal account: Ability to change login details and delete account
-
View other people's profiles and their posts. Ability to get a profile by ID
-
As a user, you can write, edit and delete your own posts. You can like and dislike other people's posts.
-
Each endpoint is documented and contributes to the overall open-api scheme
-
The simplest in-memory reaction cache was written so as not to recalculate them every time.
The application has been tested and developed with the SQLite database, but since the sqlalchemy is used, in docker-compose.yml you can specify the url for MYSQL, PostgreSQL and other relational databases.
It is assumed that you already have git and docker installed.
Clone repo
git clone https://github.com/1ort/simplesocial.git
cd simplesocial
...and run
docker compose up
Ready! The application is running on port 8000. Online documentation is available at:
http://0.0.0.0/8000/docs
http://0.0.0.0/8000/redoc
Don't use default settings in production. You need to generate and supply your own private key.
openssl rand -hex 32
And then put it in a docker-compose.yml file
environment:
- SECRET_KEY=09d25e094faa6ca2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7
Alternative ways to transfer the private key to the application are here: https://docs.docker.com/compose/environment-variables/