-
Install dependencies:
- Docker
- docker-compose
-
Open your terminal and clone this project:
git clone https://github.com/sajimenez/enviame-test.git
-
Go to the project's root folder, build the images and run the containers:
cd enviame-test docker-compose up
-
Open your web browser and try the API: http://localhost:5000/api/companies/
-
To execute the additional exercises:
docker exec [CONTAINER_ID] python scripts/exercise3.py docker exec [CONTAINER_ID] flask create-shipping docker exec [CONTAINER_ID] python scripts/exercise5.py docker exec [CONTAINER_ID] python scripts/exercise6.py
-
Install dependencies:
- Python3.9 (https://www.python.org/downloads/)
- Pipenv (https://pipenv-es.readthedocs.io/es/latest/)
-
Clone this project:
git clone https://github.com/sajimenez/enviame-test.git
-
Go to the project's root folder, create a virtual environment and install python dependencies:
cd enviame-test pipenv install --dev
-
Set the enviromental variables:
- Duplicate the file
example.env
and rename it to.env
- Edit the environment variables inside the
.env
file accordingly - Activate the virtual environment:
pipenv shell
(this automatically loads the.env
file) - Note: If no DATABASE_URL is defined, the app creates an Sqlite file by default.
- Duplicate the file
-
Run migrations, load mock data and start the server:
flask db upgrade flask load-companies [QTY] flask run
-
Open your web browser and try the API: http://localhost:5000/api/companies/
-
To execute the additional exercises:
python scripts/exercise3.py flask create-shipping python scripts/exercise5.py python scripts/exercise6.py
Note: The SQL script corresponding to the Exercise 7 is located in the scripts
folder.