@corvina/create-corvina-app
v1.9.15
Published
Setup a corvina web app in one command!
Downloads
365
Keywords
Readme
create corvina app
Setup a corvina web app in one command!
The template generated by this command is tested and supported by the Corvina team. It is a good starting point for building a web app that can be embedded in the Corvina platform.
Note: We test the app template generated by this command on the following platforms:
- Ubuntu 20+
- macOS 11+
- Windows 11 with WSL2
Usage
You can create a new corvina web app by running the following command:
npx @corvina/create-corvina-app@latest webapp
This will prompt you to select a name for your app, and then create a new directory called corvina-app-{name}
. Inside the directory, it will generate the initial project structure.
The basic structure of the project is as follows:
corvina-app-{name}
├── README.md # NB: all the instruction to run and develop the app!!
├── docker-compose.yaml
├── /app # frontend application written in vuejs and typescript
│ ├── package.json
| ├── Dockerfile
│ ├── /src
│ ├── ...
├── /service # backend service written in nestjs and typescript
│ ├── package.json
| ├── Dockerfile
│ ├── /src
│ ├── ...
├── /helm-charts # helm charts for the service and the app for local development and for deploying in corvina kubernetes cluster
│ ├── /corvina-app-{name}
│ │ ├── Chart.yaml
│ │ ├── values.yaml
│ │ ├── templates
│ │ ├── ...
You can also create the app without prompting:
npx @corvina/create-corvina-app@latest webapp --name myapp --kubernetes
Meaning of helm charts
The helm charts are used to deploy the application in a kubernetes cluster. The corvina-app-{name}
chart is used to deploy the application in the Corvina platform. We provide this structure as an example of how we build and deploy our applications in Corvina. You can use this structure as a starting point for your own application or you can use your own structure (there is no need to deploy on kubernetes).
We use to develop our application using minikube on our laptop. For that reason, at the root of the project, you will find some scripts to help you:
./start-all-locally.minikube.sh
: starts all the stuff you need to run the app locally (postgresql, redis, service, app and istio ingress)./install-certificate-locally.sh
: installs the certificate for the app locally (you need to run this script after running the previous one)./cleanup.minikube.sh
: delete all the resources created by ./start-all-locally.minikube.sh
Moreover to easily handle deployment on different environments, we leverage the power of helmfile. A utility script deploy.sh <environment>
wraps call to Helmfile to deploy the application on a specific kubernetes cluster. The script will use the environment name to select the values specific for it.
Develop on this repo
If you want to develop on this repo, you need to install the following softwares:
Deploy a new version
You need to be a member of @corvina organization on npm to deploy a new version of this package. If you are, you can run the following command:
npm run prepublish
npm run deploy
NB: remember to update the version in the package.json file before deploying a new version!
Resyncing an existing app with scaffold
If you want to resync an existing app with the latest scaffold, you can run the following command:
./scripts/resync-create-corvina-app-sh
The script requires to run in a valid git repo.
The first time the script will initialize a branch named create-corvina-app
running the create-corvina-app command at the version used for scaffolding the app.
Afterwards, the script will rebase the branch on the latest version of the create-corvina-app command.
You can use this branch to cherry-pick the changes you want to apply to your app, or to contribute back changes to create-corvina-app.