The following packages are required to run the application:
- Python v3.8
- MySQL v8.0
- MongoDB v4.4.3
- Python: https://www.python.org/downloads/
- MySQL: https://dev.mysql.com/doc/mysql-installation-excerpt/8.0/en/
- MongoDB: https://docs.mongodb.com/manual/administration/install-community/
https://github.com/martinristovski/marc1-client
git clone https://github.com/martinristovski/marc1.git
python3 -m pip install --user virtualenv
python3 -m venv venv
python3 -m pip install flask
python3 -m pip install coverage
python3 -m pip install flake8
source venv/bin/activate
pip install -r requirements.txt
export DBUSER=Username of MySQL (Ex:marc1_dev)
export DBPASSWORD=Password of MySQL user (Ex: marc1)
export DBHOST=Hostname of MySQL DB (fern.c5hb0sp2qrhh.us-east-2.rds.amazonaws.com)
export RDBSCHEMA=Name of the database (marc1_db)
export MONGO_URL= mongodb+srv://<username>:<password>@<hostname>/<dbName>?retryWrites=true&w=majority
(mongodb+srv://admin_marc1:marc1@cluster0.90pjm.mongodb.net/Form?retryWrites=true&w=majority)
mysql -u $DBUSER -p $DBPASSWORD < schema.sql
mysql -u $DBUSER -p $DBPASSWORD
create user ‘marc1_dev’@‘localhost' identified by ‘marc1’;
GRANT ALL PRIVILEGES ON marc1_db.* TO 'marc1_dev'@'%';
FLUSH PRIVILEGES;
python app.py
curl -iv “http://127.0.0.1:5000/health”
The above API call should give a successful response, demonstrating that the application is running.
You can run the System test suite from (https://columbia-university-student-plan-team-187884.postman.co/workspace/MARC-1~82207b09-c523-462c-b17e-3806dbfc9ecc/collection/1089331-e6d03ab1-7795-442f-a84f-5b795b1e3139).
Please select Production as Environment from the list of environments.
Run the collection Form-Hoster-IA-Demo.
The API documentation is available at:
https://documenter.getpostman.com/view/1089331/UVR4PqQU
The openAPI documentation is committed at: https://github.com/martinristovski/marc1/blob/main/api/openapi.yaml
Checkout the code from the main branch:
https://github.com/martinristovski/marc1
Create a mysql server.
You can run all unit tests with the command:
python -m unittest
coverage run -m unittest discover
coverage report
We run our CI pipeline on every commit to the main branch The pipeline does the followings
Runs flake8
Runs Unit Test cases
Generates Code coverage Report
Runs SonarCloud
Runs Postman Test Suite
Generates an HTML for Postman Test Suite
Flake8 and code coverage reports are present at (https://github.com/martinristovski/marc1/tree/main/test-results)
SonarCloud report is present as a badge in the README ABOVE
The postman reports are present at (https://github.com/martinristovski/marc1/tree/main/newman)