Coder Social home page Coder Social logo

mystica2000 / youtube-webapp-turborepo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vugar005/youtube-webapp-turborepo

1.0 0.0 0.0 1.9 MB

Angular Youtube clone with Module Federation. Turborepo edition.

Home Page: http://youtube.vugar.app

TypeScript 67.83% JavaScript 6.51% HTML 12.29% SCSS 13.35% Shell 0.02%

youtube-webapp-turborepo's Introduction

Youtube microfrontend using Angular, Module Federation. Turborepo edition.

Youtube Angular brand


NOTE:

This is project is for education purpose only and was made to illustrate example of building microfrontend using Angular, Module Federation.


There is 1 host (shell) and 3 remote apps (watch-app, likes-app, history-app). Each app is deployed to different hosting storage.

There are 3 versions of source codes available:
Turborepo (Current Repo)
Nx
Lerna


NOTE:

Server side rendering is implemented only on Lerna and Turborepo edition


Features:

☑ Multiple Angular applications on different domains
☑ Shared UI components and utils
☑ NgRx Store state management on each application
☑ Communication between angular applications
☑ Routing between applications
☑ Server Side Rendering

Mission:

My mission is to make complex microfrontend app as much as possible to have many cases for developers.

Demo: ▶

NOTE:

Hosted application is using Turborepo edition repo


Getting Started 🚀

Prerequisites

Since workspaces are available from npm v7, you should have NodeJs 16+ installed.

1- Install turbo globally:

npm install [email protected] -g

2- On root project install dependencies:

npm install

3- Start project and navigate to localhost:4200:

npm run serve

Other commands: please see package.json for other commands.


NOTE:

In case of error that components are not exported from youtube/common-ui, on project root run command npm run clean and then npm install


Tech Stack:

Angular Angular Material Angular Universal Angular Universal NgRx store NgRx store Turborepo

Pros and cons of Nx, Turborepo and Lerna tools

Below are just my experiences working in those tools. They can be inaccurate.

Lerna

✅ Supports both same and different versions of libraries (such as Angular, RxJs)
✅ Native - Use Angular CLI
❌ Configuration of applications required a change to angular.json to make it work. Switched to ngx-build-plus builders to support custom webpack config.
❌ Slow development efficiency. Rebuild everytime you make changes to common packages such as UI
❌ No dependency graph

Nx

❌ Not supports both same and different versions of libraries (such as Angular, RxJs). Only Monorepo.
❌ Not native. Uses Nx CLI
❌ Configuration of applications required a change to angular.json to make it work. Switched to Nx Officially Supported Builders to support custom webpack config.
Problems with adding new packages (such as ssr)
✅ Very fast development efficiency
✅ Powerful dependency graph

Turborepo

❌ Not supports both same and different versions of libraries (such as Angular, RxJs). Only Monorepo.
✅ Native - Use Angular CLI
❌ Configuration of applications required a change to angular.json to make it work. Switched to ngx-build-plus builders to support custom webpack config.
✅ Fast development efficiency
✅ Dependency graph

What is next?

Currently, the unit tests were not aded since the project was focused on main features such as module federation, managing state, intercommucation and so on. It can be started soon.

Backlog

  1. Add I18n translations
  2. Add Authorization with Auth0 to enable faster api fetcing and more features.

Contribution guide 🌴

Want to contribute to improve community app? Looking forward for pull requests. Let's get started :)

Supporting guide

Found repo useful? :) Let's star it ⭐

About me 🌴🏌️

Xtreme Junior Front end developer focused on nice architecture and long term webapps.

youtube-webapp-turborepo's People

Contributors

coly010 avatar

Stargazers

Roman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.