Every folder contains its own README for more details.
data/source_data/ contains the CSV data downloaded directly from the official source
data/fixed_source_data/ contains the CSV re-encoded as UTF-8, to support French accents (i.e. 'é')
data/create_database/ contains the normalization of the CSV data, the creation of another CSV to represent a relational table, the creation of the PostgreSQL database and its data population
api/ contains the API app, tests, including the Swagger-UI integration
Get packages:
pip install -r requirements.txtGo in the
data/create_database/folder and follow the README'sHow Toat the bottom of the pageGo in the
api/folder and follow the README'sHow Toinstructions at the bottom of the page
website/website_api contains the API app, tests, including the Swagger-UI integration
Get packages:
pip install -r requirements.txtGo in the
website/website_api/create_database/folder and follow the README'sHow Toat the bottom of the pageGo in the
website/website_api/folder and follow the README'sHow Toinstructions at the bottom of the page
Variables to set:
$env:SOURCE --> database source $env:USERNAME --> database username $env:PASSWORD --> database password $env:HOST --> database host $env:PORT --> database port $env:DB_NAME --> database name
Ex to set environment variable: $env:SOURCE='postgresql'
Ex to see environment variable: echo $env:SOURCE
This will be a copy of the bash scripts; this will not be exactly replicated in production, as it's going to be running on a different OS, however it gaves a baseline for understanding what needs to be set in order to have the microservices running.
#Navigate to directorycd'XXXXX\website\simdut-search-website'#Activate the virtual environment$venvScript = 'XXXXX\venv\Scripts\Activate.ps1'.$venvScript#Start the website
npm start#Setting environment variables$env:SOURCE='XXXXX'$env:USERNAME='XXXXX'$env:PASSWORD='XXXXX'$env:PORT='XXXXX'$env:DB_NAME='XXXXX'#Navigate to the API directorycd'XXXXX\api'#Activate the virtual environment$venvScript = 'XXXXX\venv\Scripts\Activate.ps1'.$venvScript#Run the SIMDUT API
python .\app.py#Set environment variables $env:SOURCE = 'XXXXX'$env:USERNAME = 'XXXXX'$env:PASSWORD = 'XXXXX'$env:PORT = 'XXXXX'$env:DB_NAME = 'XXXXX'#Secret key for authentifications$env:SECRET_KEY = 'XXXXX'#Navigate to the website API directorycd'XXXXX\website\website_api'#Activate the virtual environment$venvScript = 'XXXXX\venv\Scripts\Activate.ps1'.$venvScript#Run the Website API
python .\app.pyStart-Process PowerShell -ArgumentList "-NoExit", "-Command", "& 'XXXXX\RunSimdutAPI'"
Start-Process PowerShell -ArgumentList "-NoExit", "-Command", "& 'XXXXX\RunWebsiteAPI'"
Start-Process PowerShell -ArgumentList "-NoExit", "-Command", "& 'XXXXX\RunWebsite'"