DDD Module: Account (Generic Subdomain)
As a part of Simple Implementation of Modular DDD Technical Architecture Patterns in Go
.
A. Interface Layer (None)
B. DDD Modules:
-
Account - using DDD Layered Architecture (Contract, Adapters) [ d3ta-go/ddd-mod-account ]
-
Email (Indirect) - using DDD Layered Architecture (Contract, GORM, SMTP) [ d3ta-go/ddd-mod-email ]
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. Persistent Caches
- Session/Token/JWT Cache (Redis, File, DB, etc) [tested: Redis]
F. Messaging [to-do]
G. Logs [to-do]
1. Clone
$ git clone https://github.com/d3ta-go/ddd-mod-account.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
Pre-requisites:
TDD script in DDD Email Modul [ d3ta-go/ddd-mod-email ] section "3.2. TDD: Functionality Test (unit test)" has been executed.
3.1. TDD: DB Migration Test
$ cd ddd-mod-account
$ 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-account
$ sh tdd/clean-testcache.sh
$ sh tdd/ut.db.migration.run-001.sh
# Hold !!!
# ------------------------------------------------------
# To do:
# Set all `ClientKey` and `SecretKey` fields value in `conf/data/test-data.yaml`
# based on default client application in database table:
# `iam_sys_user_client_apps`
# ------------------------------------------------------
$ 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
TDD Result Sample:
- MySQL Database:
- MailHog (SMTP Email Server):