Basic Server setup

Note: Make sure you're in the python subdirectory while executing these commands.


  1. Create a virtual environment
python -m venv env

and activate using

# for macos

source env/bin/activate


# for windows

.\env\Scripts\activate
  1. Install required packages
pip install -r requirements.txt
  1. Open the terminal and run the sanic server
python src/app.py

You should see the following message in the terminal

Goin' Fast @ http://0.0.0.0:8001
  1. Open your browser and enter http://0.0.0.0:8001/hi in the website section. You should get {"value":"hello"} as the response.

    In case, the response isn't visible, try http://localhost:8001/hi. You should see the above response here.


Now head to sandbox and try the api checkpoints. Happy coding ( •̀ .̫ •́ )✧



Docker File Submission

  1. Download the Docker GUI here.

  2. Open the terminal and run the following command to build a docker image

docker build -t <TAG> .

# for m1 mac
docker build --platform x86_64 -t <TAG> .

once executed, the docker image is visible with

docker images
  1. To export your docker image for submission, run

Note: Make sure gzip is intalled before proceeding.

docker save <TAG> | gzip > <TAG>.tar.gz
  1. To run the built container locally, run
docker run -p 8001:8001 -m=2048m --cpus=1 -it <TAG or IMAGE ID>

To delete your existing docker image, get the IMAGE ID from docker images, and run

docker rmi <IMAGE ID>