Webservice to search a database of books with implementation organized using a functional structure (organize files of project by what they do)
.
├── app
│ ├── __init__.py
│ ├── main
| | |-- __init__.py
│ │ ├── controller (app endpoints)
│ │ │ └── __init__.py
│ │ ├── __init__.py
│ │ ├── model (database models)
│ │ │ └── __init__.py
│ │ └── service (business logic of app)
│ │ | └── __init__.py
| | |-- config.py (application settings - dev/test/prod configs)
│ └── test
└── requirements.txt
|-- manage.py (application entry point)
To set the environment, use either: dev, test or prod when setting environment variable <APP_ENV>. dev is the default option when running app if no environment variable is set
// linux environment
export APP_ENV=test
database: [email protected]
tools: python3, pip3
// For MacOS Sierra
brew install [email protected]
- Run the following
pip3 install -r requirements.txt
./scripts/configure
python3 manage.py run
- App will be running on localhost:5000
- Books information accessed via http://localhost:5000/books
- Go to http://localhost:5000 to see sample calls via Swagger
Fixing mysql set-up (complete removal and reinstall)
- https://gist.github.com/vitorbritto/0555879fe4414d18569d
- https://stackoverflow.com/questions/50874931/the-post-install-step-did-not-complete-successfully-mysql-mac-os-sierra