Skip to content

MicroService Interface/Presentation App: Account RestAPI

License

Notifications You must be signed in to change notification settings

d3ta-go/ms-account-restapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ms-account-restapi ( Go Report Card )

MicroService Interface/Presentation App: Account RestAPI

As a part of Simple Implementation of Modular DDD Technical Architecture Patterns in Go.

Diagram v 0.2.2-Modular

DDD-Technical-Architecture-Patterns-Golang-0.2.2-MS Account RESTAPI

Components

A. Interface Layer (MicroService)

  1. Microservice: Account REST API - using Echo Framework [ d3ta-go/ms-account-restapi ]

B. DDD Modules:

  1. Account (Authentication) - using DDD Layered Architecture (Contract, GORM) [ d3ta-go/ddd-mod-account ]
  2. Email (Indirect) - using DDD Layered Architecture (Contract, GORM, SMTP) [ d3ta-go/ddd-mod-email ]

C. Common System Libraries [ d3ta-go/system ]:

  1. Configuration - using yaml
  2. Identity & Securities - using JWT, Casbin (RBAC)
  3. Initializer
  4. Email Sender - using SMTP
  5. Handler
  6. Migrations
  7. Utils

D. Databases

  1. MySQL (tested)
  2. PostgreSQL (untested)
  3. SQLServer (untested)
  4. SQLite3 (untested)

E. Persistent Caches

  1. Session/Token/JWT Cache (Redis, File, DB, etc) [tested: Redis]

F. Messaging [to-do]

G. Logs [to-do]

Development

  1. Clone
$ git clone https://github.com/d3ta-go/ms-account-restapi.git
  1. 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.)
  1. Runing on Development Stage
$ cd ms-account-restapi
$ go run main.go db migrate
$ go run main.go server restapi
  1. Build
$ cd ms-account-restapi
$ go build
$ ./ms-account-restapi db migrate
$ ./ms-account-restapi server restapi
  1. 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):

Microservice: Account REST API

Swagger UI (openapis docs):

URL: http://localhost:20202/openapis/docs/index.html

Openapis: Acount REST AIP

Related Domain/Repositories:

  1. DDD Module: Account (Generic Subdomain) - d3ta-go/ddd-mod-account
  2. DDD Module (Indirect): Email (Generic Subdomain) - d3ta-go/ddd-mod-email
  3. 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:

  1. [Book] Domain-Driven Design: Tackling Complexity in the Heart of Software 1st Edition (Eric Evans, 2004)

  2. [Book] Patterns, Principles, and Practices of Domain-Driven Design (Scott Millett & Nick Tune, 2015)

Team & Maintainer:

  1. Muhammad Hari (https://www.linkedin.com/in/muharihar/)