This is a simple application exposing a REST API to manage posts made by users which include images and comments. The users can create their own account, create new posts from their account and even add comments on various posts, including their own. Each post consists of a caption and an image and the user can access all the posts in the application via a single endpoint. Finally, to safeguard the user's privacy, they are also given the capability of deactivating their account which also deletes all data (posts and comments) associated with their account.
You must have Docker installed on your computer. You can follow these instructions to have it quickly installed. You must also have a .env created at the root of the repository. You can refer to the .env example file for the variables you need to include.
Once you have Docker setup. Run the following commands on your terminal to spin up the containers that will compose the application.
docker-compose build
docker-compose upTo verify the application is running, you can hit the following endpoint to perform a healtcheck:
curl --location --request GET 'localhost:3001/healthcheck'Thereafter, you can interact with the application on the following endpoints:
- POST
/accountsto create new accounts - DELETE
/accounts/:accountIdto delete an account and all post and comment data associated with it - POST
/poststo create new posts - GET
/poststo fetch all posts in the application - POST
/commentsto add new comments on posts
You can find more information on how to build the respective cURL calls by following the OpenAPI spec found here
To stop the application, run the following command to stop the running containers and remove them.
docker-compose stop