MicroService Interface/Presentation App: Account RestAPI
As a part of Simple Implementation of Modular DDD Technical Architecture Patterns in Go
.
A. Interface Layer (MicroService)
- Microservice: Account REST API - using Echo Framework [ d3ta-go/ms-account-restapi ]
B. DDD Modules:
- Account (Authentication) - using DDD Layered Architecture (Contract, GORM) [ 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]
- Clone
$ git clone https://github.com/d3ta-go/ms-account-restapi.git
- 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.)
- Runing on Development Stage
$ cd ms-account-restapi
$ go run main.go db migrate
$ go run main.go server restapi
- Build
$ cd ms-account-restapi
$ go build
$ ./ms-account-restapi db migrate
$ ./ms-account-restapi server restapi
- Distribution (binary)
Binary distribution (OS/arch):
- darwin/amd64
- linux/amd64
- linux/386
- windows/amd64
- windows/386
$ cd ms-account-restapi
$ sh build.dist.sh
$ platform: [choose from OS/arch list, for example: darwin/amd64]
$ cd dist/[OS-arch]/
$ ./ms-account-restapi db migrate
$ ./ms-account-restapi server restapi
RESTAPI (console):
Swagger UI (openapis docs):
URL: http://localhost:20202/openapis/docs/index.html
Related Domain/Repositories:
- DDD Module: Account (Generic Subdomain) - d3ta-go/ddd-mod-account
- DDD Module (Indirect): Email (Generic Subdomain) - d3ta-go/ddd-mod-email
- Common System Libraries - d3ta-go/system
Online Demo:*
We DISABLE SMTP SENDER, so any activation code for registration processes would be not delivered. Please use demo account!
URL: https://ms-account-d3tago-demo.mhs.web.id/openapis/docs/index.html
Login with Username & Password:
Username: demo.d3tago
Password: demo
Login with User's Client Apps. (login-app):
Client Key: 35e4a167-55f5-44bb-bb2a-fa932eb72ab8
Secret Key: MmE0OTZhMDg1NzVlN2E4ZTg2ZmUzNzNmZDJhYzE0ZDE0MzYzZGRlMjExYjYwZDQ2NzgxMWNmZTE1NjA5MmJmMw==
References:
-
[Book] Domain-Driven Design: Tackling Complexity in the Heart of Software 1st Edition (Eric Evans, 2004)
-
[Book] Patterns, Principles, and Practices of Domain-Driven Design (Scott Millett & Nick Tune, 2015)
Team & Maintainer:
- Muhammad Hari (https://www.linkedin.com/in/muharihar/)