MicroService Interface/Presentation App: Email GraphQL API
As a part of Simple Implementation of Modular DDD Technical Architecture Patterns in Go
.
A. Interface Layer (MicroService)
- Microservice: Email GraphQL API [ d3ta-go/ms-email-graphql-api ]
B. DDD Modules:
- Email - 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-email-graphql-api.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-email-graphql-api
$ go run main.go db migrate
$ go run main.go server graphqlapi
- Build
$ cd ms-email-graphql-api
$ go build
$ ./ms-email-graphql-api db migrate
$ ./ms-email-graphql-api server graphqlapi
- Distribution (binary)
Binary distribution (OS/arch):
- darwin/amd64
- linux/amd64
- linux/386
- windows/amd64
- windows/386
$ cd ms-email-graphql-api
$ sh build.dist.sh
$ platform: [choose from OS/arch list, for example: darwin/amd64]
$ cd dist/[OS-arch]/
$ ./ms-email-graphql-api db migrate
$ ./ms-email-graphql-api server graphqlapi
GraphQL API (console):
GraphQL Playground (graphql schema docs):
URL: http://localhost:21201/graphql/playground
Related Domain/Repositories:
-
DDD Module: Email (Generic Subdomain) - d3ta-go/ddd-mod-email
-
Common System Libraries - d3ta-go/system
-
Need JWT Authorization/Token from: Account (Generic Subdomain) Module/Account REST API - d3ta-go/ms-account-restapi.
Please use shared redis server to store/retrieve JWT Token.
-
Email REST API Microservice - d3ta-go/ms-email-restapi
Online Demo:*
URL: https://ms-email-graphql-d3tago-demo.mhs.web.id/graphql/playground
For demo user account please grab it via: d3ta-go/ms-account-restapi
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/)