Skip to content

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.

License

andrewwgordon/ddd-northwind-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Domain-Driven Design CQRS Microservice OpenAPI Demo

Overview

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.

Quick Start

Prequisites

Python >= 3.7

Install

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

Deploy the Northwind SQLite Database

Download the SQLite3 Northwind database, unpack the archive and deploy to ./northwind/resources/database/Northwind.sqlite.

Configure Logging

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.

Run the Test Suite

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

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.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published