Skip to content
/ boilerplate Public template

PWA via Angular/Dart 2 with GopherJS, CLI and Shared Lib

License

Notifications You must be signed in to change notification settings

michilu/boilerplate

Repository files navigation

boilerplate

Install

Use go get -u github.com/michilu/boilerplate.

OR

$ git clone --depth=1 https://github.com/michilu/boilerplate.git
$ cd boilerplate
$ make

develop

dependencies

require go1.14

protobuf

go generate

$ go get -u github.com/cheekybits/genny
$ GO111MODULE=on go get -u github.com/rjeczalik/interfaces/cmd/interfacer

build

  • make

  • make golang build Go code

  • make proto generate Go codes from proto

  • make generate generate Go codes via go-generate

  • make gox: cross compile

  • make channel: push out self update files to develop channel

  • make release: push out self update files to release channel

  • make uml: generate PlantUML from Go codes

  • make godoc: generate GoDoc from Go codes

  • make gopherjs

  • make serve

  • make clean: clean up

launch

$ ./assets/daemon/loop ./boilerplate --debug --verbose --trace --profiler --update run

Architecture

DDD

Each directory contains:

  • domain: Domain Service, Domain Rule, Entity, Value Object, Repository Interface
    • Layered architecture: Domain
    • Hexagonal architecture: Domain Model
    • Onion architecture: Domain Model, Domain Service
    • Clean architecture: Entities
  • application: Application, Handler of Entity/Value Object, Dataflow
    • Layered architecture: Application
    • Hexagonal architecture: Application
    • Onion architecture: Application Service
    • Clean architecture: Use Cases, Controllers
  • infra: Repository
    • Layered architecture: Infrastructure
    • Hexagonal architecture: Adapter
    • Onion architecture: Infrastructure
    • Clean architecture: Gateways
  • presentation: Endpoint
    • Layered architecture: User Interface, Presentation
    • Hexagonal architecture: Adapter
    • Onion architecture: User Interface
    • Clean architecture: Presentaters
  • usecase: Use Case, Requirements
    • The context in Agile software development, not DDD.

Event-driven architecture

NOT the Event Sourcing System.

deploy

$ make deploy

environment variables for Wercker

see: https://app.wercker.com/<organization>/<application>/environment

setup the workflows on Wercker

see: https://app.wercker.com/<organization>/<application>/workflows

tools

optimize

  1. minify: https://github.com/gopherjs/gopherjs#performance-tips

:

7,196,874 bytes:  100%:   $ gopherjs build
4,661,791 bytes:   65%:   $ gopherjs build --minify
  1. UglifyJS 3: https://github.com/mishoo/UglifyJS2

:

4,547,810 bytes:   63%:   $ gopherjs build --minify && uglifyjs
4,274,152 bytes:   59%:   $ gopherjs build --minify && uglifyjs --compress
3,843,890 bytes:   53%:   $ gopherjs build --minify && uglifyjs --compress --mangle

sync subtree

Add upstream:

$ git clone git@github.com:michilu/boilerplate.git .
$ git remote add upstream https://github.com/dart-lang/angular.git
$ git checkout upstream/master
$ git subtree split --prefix=examples/hacker_news_pwa -b examples/hacker_news_pwa

Sync to upstream:

$ git fetch upstream master
$ git checkout upstream/master
$ git subtree push --prefix=examples/hacker_news_pwa origin examples/hacker_news_pwa
$ git checkout upstream
$ git subtree pull --prefix=app origin examples/hacker_news_pwa

ref:

for proto

Add upstream:

$ git remote add googleapis https://github.com/googleapis/googleapis
$ git fetch --depth=1 --no-tags googleapis
$ git checkout googleapis/master
$ git subtree split --prefix=google/type -b google/type

Add subtree:

$ git checkout dev
$ git subtree add --prefix=vendor/github.com/googleapis/googleapis/google/type google/type

Sync to upstream:

$ git fetch --no-tags googleapis
(TBD)
$ git subtree pull --prefix=vendor/github.com/googleapis/googleapis/google/type origin google/type