The Vigilant Project is a bootstrap for monorepos with an api as backend and frontend based on Vue. The monorepo is supported by turborepo.
This Turborepo includes the following packages and apps:
Apps
- api: an Fastify server with GraphQL and Neo4j (more)
- admin: a Vite / Vue app for administration (more)
- storefront: a Vite / Vue app (more)
Packages
- oui: OUI (One UI) a lightweight Vue 3 component library (more)
- oui: Documentation of the component UI by VitePress (UI Documentation)
Utilities
This turborepo has some additional tools already setup for you:
- Prettier for code formatting
- clean clean up all projects from build, cache and node modules files.
- lint run linter on all projects
- test run testing on all projects
- build run build on all projects
- dev start development mode on all projects
The development mode start the backend api and the front ends at once.
Technologies used in the project.
- turborepo to manage the monorepo
- Typescript for static type checking on frontend applications
- ESLint for code linting
- XO for linting NodeJS applications
- Jest test runner for frontend applications
- AVA test runner for NodeJS applications
- Prettier for code formatting
- VitePress for documentation
To unleash the full power of a monorepo we implement the OUI package as a git submodule. Here are the commands you need for installtion and some help to handle git submodules.
In order to add a Git submodule, use the “git submodule add” command and specify the URL of the Git remote repository to be included as a submodule.
$ git submodule add <remote_url> <destination_folder>
To pull a Git submodule, use the “git submodule update” command with the “–init” and the “–recursive” options.
$ git submodule update --init --recursive
In order to update an existing Git submodule, you need to execute the “git submodule update” with the “–remote” and the “–merge” option.
$ git submodule update --remote --merge
To fetch new commits done in the submodule repository, head into your submodule folder and run the “git fetch” command first (you will get the new submodule commits)
$ cd repository/submodule
$ git fetch
Now, if you run the “git log” command again, you will be able to see the new commits you are looking to integrate.
$ git log --oneline origin/master -3
93360a2 (origin/master, origin/HEAD) Second commit
88db523 First commit
43d0813 (HEAD -> master) Initial commit
Now, in order for your submodule to be in-line with the newest commits, you can run the “git checkout” command and specify the SHA that you want to update your submodule to (in this case 93360a2)
$ git checkout -q 93360a2
In order to remove a Git submodule from your repository, use the “git submodule deinit” command followed by the “git rm” command and specify the name of the submodule folder.
$ git submodule deinit <submodule>
$ git rm <submodule>