DDD Module: Covid19 (Core Subdomain)
As a part of Simple Implementation of Modular DDD Technical Architecture Patterns in Go
.
A. Interface Layer (None)
B. DDD Modules:
- Covid19 - using DDD Layered Architecture (Contract, Adapters) [ d3ta-go/ddd-mod-covid19 ]
C. Common System Libraries [ d3ta-go/system ]:
- Configuration - using yaml
- Identity & Securities - using JWT, Casbin (RBAC)
- Initializer
- Email Sender - using SMTP
- Handler
- Migrations
- Utils
D. Databases
- MySQL (tested)
- PostgreSQL (untested)
- SQLServer (untested)
- SQLite3 (untested)
E. Providers (Connectors) [ d3ta-go/connector-* ]:
- data.covid19.go.id (Official Covid19 Website - Indonesia)
- covid19.who.it (Official Covid19 Website - WHO)
F. Persistent Caches
- Session/Token/JWT Cache (Redis, File, DB, etc) [tested: Redis]
G. Messaging [to-do]
H. Logs [to-do]
1. Clone
$ git clone https://github.com/d3ta-go/ddd-mod-covid19.git
2. Setup
a. copy `conf/config-sample.yaml` to `conf/config.yaml`
b. copy `conf/data/test-data-sample.yaml` to `conf/data/test-data.yaml`
c. setup your dependencies/requirements (e.g: database, redis, smtp, etc.)
3. Runing TDD on Development Stage
3.1. TDD: DB Migration Test
$ cd ddd-mod-covid19
$ sh tdd/clean-testcache.sh
$ sh tdd/ut.db.migration.run-001.sh
$ sh tdd/ut.db.migration.rollback-001.sh
3.2. TDD: Functionality Test (unit test)
$ cd ddd-mod-covid19
$ sh tdd/clean-testcache.sh
$ sh tdd/ut.db.migration.run-001.sh
$ sh tdd/ut.pkg.infra-layer.adapter.covid19.who-001.sh
$ sh tdd/ut.pkg.infra-layer.adapter.covid19.covid19goid-001.sh
$ sh tdd/ut.pkg.infra-layer.repository-001.sh
$ sh tdd/ut.pkg.app-layer.service-001.sh
$ sh tdd/ut.pkg.app-layer.application-001.sh
OR
$ cd ddd-mod-covid19
$ sh tdd/run.tdd.sh
TDD Result Sample:
- MySQL Database (Casbin Rule):
- Redis (Cache):