Skip to content

JohnDzialo/i-like-that

Repository files navigation

i-like-that

Description

Hey! Do you like reading people's posts? Do you like rating posts in the hopes of emotionally abusing the OP?

Then this is the app for you. Post a message, read other's messages, then Up vote or Down vote the posts as you see fit.

Setup

Build the docker-compose script and bring up the containers.

docker-compose build
docker-compose up

Nginx will be listening on http://localhost:8080 and will route traffic to the flask backend.

Usage

Create a new post

curl --request POST \
  --url http://localhost:8080/posts/ \
  --header 'content-type: application/json' \
  --data '{
   "body": "when the posting begins the roasting begins"
}'

Select all posts as json

curl --request GET \
  --url http://localhost:8080/posts/

Select a post by id, get id by running get all posts

curl --request GET \
  --url http://localhost:8080/posts/<id>

Delete a post by id, get id by running get all posts

curl --request DELETE \
  --url http://localhost:8080/posts/<id>

Increment likes for a post, get id by running get all posts

curl --request PUT \
  --url http://localhost:8080/posts/<id>/likeit/up/

Decrement likes for a post, get id by running get all posts

curl --request PUT \
  --url http://localhost:8080/posts/<id>/likeit/down/

Run Tests

docker-compose run --rm -T tests

DB Migrations

Use the manage.py scripts to handle any db migrations

python manage.py db init
python manage.py db migrate
python manage.py db upgrade

TODO

Better schema validation for incoming requests. 100% test coverage Better docstrings for each function

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published