This project is an example Domain-Driven Design Microservice supporting OpenAPI. The purpose of the project is an education "toy" application to articulate DDD and Microservice best practices.
The project is built upon the Connexion OpenAPI framework, itself leveraging Flask. Waitress is configured as the default WSGI HTTP Server and is suitable for production deployment.
Python >= 3.7
Clone this repo.
git clone https://github.com/andrewwgordon/ddd-northwind-api.git
Create a Python virtual environment and activate it.
python -m venv venv
.\venv\Scripts\activate (Windows)
./venv/bin/activate (Linux)
Install dependencies
python -m pip install -r requirements.txt
Download the SQLite3 Northwind database, unpack the archive and deploy to ./northwind/resources/database/Northwind.sqlite.
Note: You also may need to create a ./log/ directory in the root of the application directory. Logging path can be configured in ./northwind/resources/logging.conf.
python -m pytest -s -v
Note: The current e2e REST API test spins up a Flask App instance as a OS sub process. It attempts to terminate it on test completion, but you may need to kill the process.
Start the service
python app.py
Navigate to the Swagger UI via your browser
http://localhost:8098/v1/ui
Note: The default port for the HTTP Server is 8098. You can change this setting in the northwind.properties file in ./northwind/resources/.
Basic authentication is enabled and a username / password has to be supplied for any REST API service to respond. Current implementation does not verify credentials and can accept any username and password.