-
Create database credentials (and of course complete the user and password):
echo "MYSQL_HOST=localhost" > credentials.env echo "MYSQL_DATABASE=ece140" >> credentials.env echo "MYSQL_USER=" >> credentials.env echo "MYSQL_PASSWORD=" >> credentials.env
-
Install MySQL Server on your computer
-
Run init-db.sql to create the database (in the database folder)
mysql -u root -p source init-db.sql exit
-
Install the Python dependencies from requirements.txt
pip3 install -r requirements.txt
-
Source the environment variables into your path
source credentials.env
NOTE: Windows users, I'm sorry your life is always harder. Please follow this guide to read environment variables into your path: https://bennett4.medium.com/windows-alternative-to-source-env-for-setting-environment-variables-606be2a6d3e1
-
Run the server
python3 server.py
-
Point your browser to the webserver routes (might be
http://localhost
on some machines):- GET / Route:
http://0.0.0.0
- GET /actors Route:
http://0.0.0.0/actors
- GET /actor/[actor-id] Route:
http://0.0.0.0/actor/[actor-id]
- GET / Route:
-
Create database credentials (and of course complete the user and password):
echo "MYSQL_HOST=mysql-server" > credentials.env echo "MYSQL_DATABASE=ece140" >> credentials.env echo "MYSQL_USER=" >> credentials.env echo "MYSQL_PASSWORD=" >> credentials.env
-
Run the following command to build the containers and start up both web server and database containers:
docker compose up --build
-
In a new terminal window, open an interactive shell into the web server container and start the web server:
docker exec -it 140-web-server bash python server.py
-
Point your browser to the webserver routes (might be
http://localhost
on some machines):- GET / Route:
http://0.0.0.0
- GET /actors Route:
http://0.0.0.0/actors
- GET /actor/[actor-id] Route:
http://0.0.0.0/actor/[actor-id]
- GET / Route: