- run
docker-compose up --build --force-recreate -d
- run
docker-compose exec app bin/console doctrine:migrations:migrate -n
- run
docker-compose exec app bin/console doctrine:fixtures:load -n
Use Bearer token authorization with one onf the following predefined values (users)
- user 1:
Random_Token_For_User_01
- user 2:
Random_Token_For_User_02
- user 3:
Random_Token_For_User_03
Go to http://127.0.0.1:8888/
to check if it works (make sure it is http, not https).
Run docker-compose exec app bin/console debug:route
to get the list of endpoints.
- Write new tweets
curl --location -i --request POST 'http://127.0.0.1:8888/api/tweets' \
--header 'Authorization: Bearer Random_Token_For_User_01' \
--header 'Content-Type: application/json' \
--data-raw '{
"message": "message goes here"
}'
- Reply to existing tweets
curl --location -i --request POST 'http://127.0.0.1:8888/api/tweets/1/replies' \
--header 'Authorization: Bearer Random_Token_For_User_02' \
--header 'Content-Type: application/json' \
--data-raw '{
"message": "reply goes here"
}'
- Mark some of their tweets as private, except to their followers
curl --location -i --request PATCH 'http://127.0.0.1:8888/api/tweets/1' \
--header 'Authorization: Bearer Random_Token_For_User_01' \
--header 'Content-Type: application/json' \
--data-raw '{
"isPrivate": true
}'
- Remove followers so that they should not be able to re-follow a publisher once removed
curl --location -i --request DELETE 'http://127.0.0.1:8888/api/self/followers/3' \
--header 'Authorization: Bearer Random_Token_For_User_01' \
--header 'Content-Type: application/json' \
--data-raw '{
"isPrivate": true
}'
- Query all tweets in the system
curl --location -i --request GET 'http://127.0.0.1:8888/api/tweets' \
--header 'Content-Type: application/json'
- Query all tweets by a group of publishers
curl --location -i -g --request GET 'http://127.0.0.1:8888/api/tweets?filter[authors]=1,2,3' \
--header 'Content-Type: application/json'
- Query all tweets in a specific window of time
curl --location -i -g --request GET 'http://127.0.0.1:8888/api/tweets?filter[start]=2021-01-25T14:37:38.669Z&filter[end]=2021-01-26T14:37:38.669Z' \
--header 'Content-Type: application/json'
- Query a tweet and all the responses to this tweet
curl --location -i --request GET 'http://127.0.0.1:8888/api/tweets/1' \
--header 'Content-Type: application/json'
- Follow a publisher
curl --location -i --request POST 'http://127.0.0.1:8888/api/authors/1/followers' \
--header 'Authorization: Bearer Random_Token_For_User_03'