Debugging
After cloning your codebase from GitHub, now it's time to write/debug code.
Probably you won't yet have every required library installed, but worry not! We use docker container to standardise everything (versions/libraries).
In one word, you'll find it more convenient and elegant to write/debug code in docker container env (instead of on your laptop's local env).
Read the doc below to know how.
By Docker
- Download Docker Desktop
- Clone and go to the file path
- build the image
- docker build -t "image_name:latest" .
- run the image
- docker run -d -p 5000:5000 image_name
By local virtual machine
- start a virtual machine
| Code Block | ||||
|---|---|---|---|---|
| ||||
python3 -m venv venv |
- activate the virtual machine
| Code Block | ||||
|---|---|---|---|---|
| ||||
source venv/bin/activate |
- use pip to install pkgs
| Code Block | ||||
|---|---|---|---|---|
| ||||
pip install -r requirements.txt |
- run the program
Code Block language bash title source venv/bin/activate flask run --debug
By Visual Studio CodeDev/Debug in Container
...
Servers
The test server can be accessed from MongoDB Atlas, please follow the MongoDB Atlas section in this guide.
...