Nx monorepo sensibly configured with NestJS + Fastify backend, Vue frontend, Jest and Cypress testing, and agnostic data via TypeORM + GraphQL.
Managed by Yarn with PnP enabled, and powered by Docker with NGINX + Node.js under the hood, certbot SSL, and Jenkins CI/CD.
git clone --depth 1 https://github.com/troncali/nest-vue your-project
cd your-project
yarn install
Yarn has a guide for working with PnP packages in Visual Studio Code. TLDR: yarn dlx @yarnpkg/sdks vscode
.
Some minimal setup is required (environment variables, certificates, etc). Follow the guide.
Here's what this sensibly configured monorepo is meant to help you easily deploy, so you can jump straight to substance:
- Vue 3
- x (Database) - PostgreSQL and MongoDB setups included, but configure and use any database you want.
- TypeORM
- GraphQL/Apollo
- NestJS
- NGINX
These core services are supported by the following:
- Nx - extensible build framework with computation caching to rebuild only what is necessary; includes Nest and Vue plugins that expose their CLI generators, etc.
- Yarn - slim dependency management using Plug'N'Play for smaller repositories.
- Docker - spin up your database, backend, and frontend with consistent environments both locally and on remote hosts.
- certbot - SSL certificate generation for both local development and remote hosts.
- Jenkins - base pipeline for CI/CD that can be built out to fit your needs.
Learn how to get started with this respository, how services are set up, and how you can customize them to your needs.
- Initial Setup
- Docker - in progress
- Jenkins - in grogress
- Resources - in progress
- Roadmap - in progress
Scripts run from the project root and must be called with yarn
to resolve dependencies.
yarn docker:dev
: spins updb
andnginx
for local development- Nginx proxies to the local backend to mimic production and take advantage of developer tools (like file watching)
yarn nx serve [app]
: serve and watch an app (backend
orfrontend
)backend
served at http://localhost:3001/; also https if nginx container is runningfrontend
served at http://localhost:8080/
yarn nx build [app]
: outputs compiled app to./builds/[project]
yarn migration:[create|run|undo]
: create, run, or undo a database migrationyarn seed
: seed the database
yarn nx test [app]
: run unit testsyarn nx e2e [app]
: run integration tests (Cypress for frontend, Jest for backend)snyk test
: check dependency vulnerabilities
yarn docker:dev-certs
: create SSL certificates for local developmentyarn docker:prod
: builds production docker imagesyarn docker:deploy
: add your docker context for easy deploymentyarn docs
: outputs backend (Nest) documentation to./docs
yarn jenkins
: spin up Jenkins (must install Jenkins,brew install jenkins
)