All Projects → phodal → Mooa

phodal / Mooa

Licence: other
Mooa 是一个为 Angular 服务的微前端框架。A independent-deployment micro-frontend Framework for Angular from single-spa.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Mooa

Nats.go
Golang client for NATS, the cloud native messaging system.
Stars: ✭ 3,690 (+388.74%)
Mutual labels:  microservices, microservices-architecture
Awesome System Design
A curated list of awesome System Design (A.K.A. Distributed Systems) resources.
Stars: ✭ 4,999 (+562.12%)
Mutual labels:  microservices, microservices-architecture
Eshoponcontainers
Cross-platform .NET sample microservices and container based application that runs on Linux Windows and macOS. Powered by .NET 6, Docker Containers and Azure Kubernetes Services. Supports Visual Studio, VS for Mac and CLI based environments with Docker CLI, dotnet CLI, VS Code or any other code editor.
Stars: ✭ 19,397 (+2469.14%)
Mutual labels:  microservices, spa
Pitstop
This repo contains a sample application based on a Garage Management System for Pitstop - a fictitious garage. The primary goal of this sample is to demonstrate several software-architecture concepts like: Microservices, CQRS, Event Sourcing, Domain Driven Design (DDD), Eventual Consistency.
Stars: ✭ 708 (-6.23%)
Mutual labels:  microservices, microservices-architecture
Piral
Framework for next generation web apps using microfrontends. 🚀
Stars: ✭ 711 (-5.83%)
Mutual labels:  microservices, spa
Java Microservice
A full microservice project using Spring and many others tools
Stars: ✭ 235 (-68.87%)
Mutual labels:  microservices, microservices-architecture
Micronaut Microservices Poc
Very simplified insurance sales system made in a microservices architecture using Micronaut
Stars: ✭ 394 (-47.81%)
Mutual labels:  microservices, microservices-architecture
Java Microservices Examples
Java Microservices: Spring Boot, Spring Cloud, JHipster, Spring Cloud Config, and Spring Cloud Gateway
Stars: ✭ 194 (-74.3%)
Mutual labels:  microservices, microservices-architecture
Restaurant App
Restaurant App 🍔 is a sample open-source e-Commerce 🛒 application for ordering foods, powered by polyglot microservices architecture and cross-platform development including mobile and web
Stars: ✭ 471 (-37.62%)
Mutual labels:  microservices, microservices-architecture
Turkish Microservice Architecture Book
Open Source Turkish Microservices eBook. Feel free to contribute.
Stars: ✭ 469 (-37.88%)
Mutual labels:  microservices, microservices-architecture
Pos
Sample Application DDD, Reactive Microservices, CQRS Event Sourcing Powered by DERMAYON LIBRARY
Stars: ✭ 207 (-72.58%)
Mutual labels:  microservices, microservices-architecture
Madclones
A collection of frameworks that I love with a strong focus on clean code, testing, software architecture/design and devops.
Stars: ✭ 480 (-36.42%)
Mutual labels:  microservices, microservices-architecture
Gramps Legacy
The core data source combination engine of GrAMPS.
Stars: ✭ 198 (-73.77%)
Mutual labels:  microservices, microservices-architecture
Serverless Microservices Reference Architecture
This reference architecture walks you through the decision-making process involved in designing, developing, and delivering a serverless application using a microservices architecture through hands-on instructions for configuring and deploying all of the architecture's components along the way. The goal is to provide practical hands-on experience in working with several Azure services and the technologies that effectively use them in a cohesive and unified way to build a serverless-based microservices architecture.
Stars: ✭ 270 (-64.24%)
Mutual labels:  microservices, microservices-architecture
Nginx Link Function
It is a NGINX module that provides dynamic linking to your application in server context and call the function of your application in location directive
Stars: ✭ 197 (-73.91%)
Mutual labels:  microservices, microservices-architecture
Laravel
[DEPRECATED] See https://github.com/lucidarch/lucid
Stars: ✭ 373 (-50.6%)
Mutual labels:  microservices, microservices-architecture
Modernarchitectureshop
The Microservices Online Shop is an application with a modern software architecture that is cleanly designed and based on.NET lightweight technologies. The shop has two build variations. The first variant is the classic Microservices Architectural Style. The second one is with Dapr. Dapr has a comprehensive infrastructure for building highly decoupled Microservices; for this reason, I am using Dapr to achieve the noble goal of building a highly scalable application with clean architecture and clean code.
Stars: ✭ 154 (-79.6%)
Mutual labels:  microservices, microservices-architecture
Scs
Self-Contained Systems
Stars: ✭ 189 (-74.97%)
Mutual labels:  microservices, microservices-architecture
Netcoremicroservicessample
Sample using micro services in .NET Core 3.1 Focusing on clean code
Stars: ✭ 403 (-46.62%)
Mutual labels:  microservices, microservices-architecture
Resgate
A Realtime API Gateway used with NATS to build REST, real time, and RPC APIs, where all your clients are synchronized seamlessly.
Stars: ✭ 473 (-37.35%)
Mutual labels:  microservices, microservices-architecture

Mooa

Build Status Coverage Status Maintainability node npm

A single SPA Utils for Angular 2+

Simliar Projects: https://github.com/worktile/ngx-planet (Production Ready)

based on single-spa && single-spa-angular-cli

difference:

  • Host <-> Apps Architecture
  • Configurable App (no loader require)
  • Independent App in Different Repo and runnable

Mooa Architecture

Examples: see in examples/

Online Demo:

  1. http://mooa.pho.im/ (host in AWS S3)
  2. http://mooa.phodal.com/ (host in GitHub Pages)

Features:

  1. SPA by Configurable file, ex: apps.json
  2. Pluggable APP
  3. support Child APP navigate
  4. CLI for Generate Config

Goal:

  1. 构建插件化的 Web 开发平台,满足业务快速变化及分布式多团队并行开发的需求
  2. 构建服务化的中间件,搭建高可用及高复用的前端微服务平台
  3. 支持前端的独立交付及部署

Usecase

If you are mooa, please provide you case to help this project.

Theory

Research and Application of Micro Frontends

Boilerplate

App Boilerplate: https://github.com/phodal/mooa-boilerplate

Usage

1. Install mooa

in Host and Child App

yarn add mooa

2. Config Host

  1. add get Apps logic in AppComponent (app.component.ts)
constructor(private renderer: Renderer2, http: HttpClient, private router: Router) {
  // config Mooa
  this.mooa = new Mooa({
    mode: 'iframe',
    debug: false,
    parentElement: 'app-home',
    urlPrefix: 'app',
    switchMode: 'coexist',
    preload: true,
    includeZone: true
  });
  http.get<IAppOption[]>('/assets/apps.json')
    .subscribe(
      data => {
        this.createApps(data);
      },
      err => console.log(err)
    );
}

private createApps(data: IAppOption[]) {
  data.map((config) => {
    this.mooa.registerApplication(config.name, config, mooaRouter.matchRoute(config.prefix));
  });

  this.router.events.subscribe((event) => {
    if (event instanceof NavigationEnd) {
      this.mooa.reRouter(event);
    }
  });

  return this.mooa.start();
}

3. Config App

  1. config App main.ts for load
import { mooaPlatform } from 'mooa';

if (environment.production) {
  enableProdMode();
}

mooaPlatform.mount('help').then((opts) => {
  platformBrowserDynamic().bootstrapModule(AppModule).then((module) => {
    opts['attachUnmount'](module);
  });
});

  1. setup app routing in app.module.ts
const appRoutes: Routes = [
  {path: '*', component: AppComponent}
  ...
];

@NgModule({
  declarations: [
    AppComponent,
    ...
  ],
  imports: [
    BrowserModule,
    RouterModule.forRoot(
      appRoutes
    )
  ],
  providers: [
    {provide: APP_BASE_HREF, useValue: mooaPlatform.appBase()},
  ],
  bootstrap: [AppComponent]
})
export class AppModule {

}
  1. Add for handle URL Change in app.component.ts
constructor(private router: Router) {
  mooaPlatform.handleRouterUpdate(this.router, 'app1');
}

4. Setup apps.json with Mooa CLI

  1. install global cli
npm install -g mooa
  1. create URL list files

Examples: apps.txt

http://mooa.phodal.com/assets/app1
http://mooa.phodal.com/assets/help
  1. Generate Config File
mooa -g apps.txt

Examples:

[
  {
    "name": "app1",
    "selector": "app-app1",
    "baseScriptUrl": "/assets/app1",
    "styles": [
      "styles.bundle.css"
    ],
    "prefix": "app/app1",
    "scripts": [
      "inline.bundle.js",
      "polyfills.bundle.js",
      "main.bundle.js"
    ]
  }
]

Mooa Config

config in Host app's app.component.ts

this.mooa = new Mooa({
  mode: 'iframe',
  debug: false,
  parentElement: 'app-home',
  urlPrefix: 'app',
  switchMode: 'coexist'
}) 

mode: 'iframe'

use iframe as application container:

<app-home _nghost-c2="">
  <iframe frameborder="" width="100%" height="100%" src="http://localhost:4200/app/help/homeassets/iframe.html" id="help_206547"></iframe>
</app-home>

switchMode: 'coexist'

hidden application when inactive:

<app-home _nghost-c2="">
  <app-app1 _nghost-c0="" ng-version="5.2.8" style="display: none;"><nav _ngcontent-c0="" class="navbar"></app-app1>
  <iframe frameborder="" width="100%" height="100%" src="http://localhost:4200/app/help/homeassets/iframe.html" id="help_206547"></iframe>
</app-home>

For Angular Lazyload Module

inline.bundle.js will load script for / path.

So, just copy *.chunk.js files to dist/, then deploy it.

API

registerApplicationByLink

exmples:

mooa.registerApplicationByLink('help', '/assets/help', mooaRouter.matchRoute('help'));

registerApplication

mooa.registerApplication(config.name, config, mooaRouter.matchRoute(config.prefix));

hybrid

if (config.sourceType) {
  that.mooa.registerApplicationByLink(config.name, config.link, mooaRouter.matchRoute(config.name));
} else {
  that.mooa.registerApplication(config.name, config, mooaRouter.matchRoute(config.prefix));
}

navigateTo Custom App

mooaPlatform.navigateTo({
  appName: 'help',
  router: 'home'
});

License

Phodal's Idea

Copyright (c) 2013-2014 Christopher Simpkins Copyright (c) 2017-2018 Robin Coma Delperier

© 2018 A Phodal Huang's Idea. This code is distributed under the MIT license. See LICENSE in this directory.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].