Getting Started โ
Mono-repo is a way to build a large-scale, modular front-end on top of the Vue ecosystem. The goal is a maintainable, clean, complex project that takes minimum effort to grow.
Concept โ
Vue gives every project the same predictable shape:
src/pagesโ routingsrc/layoutsโ layouts
Inside a layout you usually find the same generic pieces: Sidebar, Navbar, Login, Logout, Middleware. Every normal website needs them.
Mono-repo makes this simple. Those generic pieces live once in the Host, and every Remote can use them without rebuilding.
A Remote only adds its own modules. It does not re-create Login, Logout, or any of the generic things โ the Host already handles all of that.
Because of this modular concept, the Host can have many Remotes, and all of them live inside the Host. Think about a house that have many rooms.
Visual Example โ
Host โ owns the shell of the app.
host/
โโโ src/
โโโ pages/ # login, logout, etc.
โโโ layouts/ # sidebar, navbar, etc.
โโโ ...etc/Remote โ just adds modules, for example a Budget module.
remote/
โโโ src/
โโโ pages/ # budget module
โโโ ...etc/Install โ
Before we getting started, there is package that required to install. Place this below code inside your package.json after that just install with pnpm i. You'll need a GitHub token.
json
{
"dependencies": {
"jwt-decode": "^4.0.0",
},
"devDependencies": {
"mono-utils": "git+https://<GITHUB_CLASSIC_TOKEN>@github.com/EJI-ICT/libs#path:/packages/mono-utils"
}
}Templates โ
Starter projects for Host and Remote:
- Host โ https://github.com/EJI-ICT/mono-host
- Remote โ https://github.com/EJI-ICT/mono-vue