This article is part of the Ionic Framework / Capacitor Advent Calendar 2020.
I often build projects with Ionic/Angular on the frontend and NestJS + MySQL on the backend. After six months, package versions climb and default project layouts shift, so I scaffold with a simple monorepo template.
Setup Steps
- Keep CLI versions up to date
% npm i @ionic/cli@latest @nestjs/cli@latest -g
- Clone the template
% git clone git@github.com:rdlabo-team/create-ionic-nest-app.git your-project-name
% cd your-project-name
% git remote set-url origin git@github.com:your-account/your-repository.git
- Create the Ionic app
% npm run create:app
- Create the NestJS app
If you host somewhere other than Lambda, run:
% npm run create:api
For Lambda hosting, use this instead—a Serverless Framework layout:
% npm run create:api:sls
- Link with lerna
% npm run install
Releasing
There is no GitHub Actions template bundled, but I recommend releasing with:
% npm run release
https://zenn.dev/rdlabo/articles/1fda37f6e1025999e86e may be a useful reference.
What Is Included
- Prettier formatting on pre-commit, configured from the start
I hope this makes it easy to start an Ionic project with an API server. See you next time.