A CLI for RAD (Rapid Application Development), helps you to start a Node.js Monorepo projects.
npm install create-new-monorepoThe resulting monorepo will be managed by npm but you can set any application you want (even with apps in PHP or Python).
You don't need to install anything.
Simply run this command on your terminal and answer the questions:
``sh`
npm create new-monorepo
Then, after the scaffold simply run:
`sh`
npm start
It will launch the frontend and backend server.
You can pass options preceded by -- to avoid interactivity: `sh`
npm create new-monorepo django
This will create a app under /backend and a react app under /frontend directory.
The available options are:
| Command | shorthand | example |
|:--------------:|:---------:|------------------------------------------------------------------------------------------------------------------------|
| --project | -p | npm create new-monorepo -- -p my-project npm create new-monorepo my-project
Alternatively use an argument: |npm create new-monorepo my-project -- -f react
| --frontend | -f | |npm create new-monorepo my-project -- -b django
| --backend | -b | |npm create new-monorepo my-project -- -t
| --tooling | -t | (skips prompt, enables linting and formatting) |
| Frontend |
|-------------------------------------------------------------------------------|
| vanilla, react, vue, svelte, solid, qwik, preact, lit, none |
| Backend |
|-------------------------------------------------------------------------------|
| laravel, django, fastify, none |
During setup, you'll be asked if you want basic linting and formatting tools. If you answer yes (or use --tooling), the CLI will:
- Install ESLint, Prettier, and Lefthook as dev dependencies
- Generate configuration files (.prettierrc.json, .prettierignore, eslint.config.js, lefthook.yml)normalize
- Add npm scripts: , lint, check, and setup:githooks
Lefthook will automatically format and lint your code before each commit.
It will be installed as devDependency. To enable the git hooks (pre-commit linting/formatting), run:
`sh`
npm run setup:githooks
Note: this will work only if you initialize the project with git. If you use npm, the hooks will also be enabled automatically whenever you run npm install (lefthook has a built-in postinstall hook in its package.json).
If you choose django or laravel as a backend service you will need to have installed the requirements (either django-admin or php composer` in the device). This CLI will check if they are installed and exit with an error explanation if not. Due to this checking process (that uses POSIX-compliant system) this CLI will not work on Windows at the moment (in the future proper compatibility will be implemented).