This guide assumes you have Docker and Docker Compose installed.
Build the Docker images
docker-compose build
Run the backend
docker-compose up -d
Load food data
This will load example food records.
docker-compose run backend python manage.py loaddata backend/fixtures/foods.json
Create a new user
The following command will prompt you for username and password.
docker-compose run backend python manage.py createuser
Create a new admin user
The following command will prompt you for username, email and password.
docker-compose run backend python manage.py createsuperuser
You will enter the backend container with the following command from which you will have access to the client command line script and will be able to query REST API backend with it.
docker-compose exec backend bash
List foods
./client.py foods list
Food details
./client.py foods detail {food_id}
To access private methods you need to login as a user first with the following command,
where {user}
is a username that you used for registering.
./client.py login {user}
View cart
./client.py cart view
Add item to cart
./client.py cart add {food_id} {quantity}
Add item to cart
./client.py cart remove {item_id}
Submit the order
./client.py cart checkout
List orders
./client.py orders list
View order details
./client.py orders details {order_id}
To access admin methods you need to login as an admin first.
List pending orders
./client.py admin orders list
View order details
./client.py admin orders details {order_id}
Mark order as completed
./client.py admin orders completed {order_id}
The following command will execute tests in container and output the test code coverage information.
docker-compose run backend pytest --cov
Build a command line app for a food delivery service. The customer user interface should present the user with the ability to:
- List foods
- Pick a food and read more about it
- Add one or more food items to a cart
- View cart
- Checkout (assume payment goes through)
- View order details
The food delivery service user will be able to:
- See pending orders
- Mark order as delivered to clear it off the list
When the food delivery service user marks an order as delivered, the customer user should see that reflected on his order details. The command line app should talk to a backend via a REST API. You can use any frameworks of your choice, but please stick to python for language choice.
What would we assess:
- Data model design
- Bug free execution
- Test coverage
- REST API design
- Separation of concerns
- Easy to follow instructions to test and execute
What we don’t expect to see:
- A full fledged Auth framework
- Session Management
- Any other production-grade software concerns like performance, monitoring, security, containerisation etc.