This is a simple user management API that allows you to create, read, update and delete users as well as their friends list and blocked list.
- Go to the root directory of the backend services
cd backend
- Run docker-compose to start the services
docker-compose -f docker-compose-user-management.yml up
- The API will be available at http://localhost:8080
- The PostgreSQL database will be available at http://localhost:5432
The API has the following endpoints:
http://localhost:8006/user/
with POST request and the following JSON body:
{
"name": "John Doe",
"nickname": "johndoe",
"email": "[email protected]",
"avatar": "https://www.example.com/avatar.jpg"
}
http://localhost:8006/user/{id}
with GET request
http://localhost:8006/user/
with GET request
http://localhost:8006/user/{id}
with PATCH request and the following JSON body:
{
"[field]": "[value]"
}
http://localhost:8006/user/{id}
with DELETE request
http://localhost:8006/user/{id}/friends/{friendId}
with POST request
http://localhost:8006/user/{id}/friends/{friendId}
with DELETE request
http://localhost:8006/user/{id}/friends
with GET request
http://localhost:8006/user/{id}/block/{blockId}
with POST request
http://localhost:8006/user/{id}/block/{blockId}
with DELETE request
http://localhost:8006/user/{id}/block
To run the tests, go to the root directory of the backend services and run the following command:
docker-compose -f docker-compose-user-management.yml run user_management_api python3 manage.py test user_management_api
The frontend for this API can be started by goiung to the root directory of the frontend services and running the following command:
npm install -g http-server
http-server
The frontend will be available at http://localhost:8080 and will allow you to interact with the API.