Nx monorepo 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.
Fork this repository to your account, then clone a local copy to build out your project.
git clone --depth 1 https://github.com/YOUR-USERNAME/nest-vue your-project
cd your-project
yarn install
If you want to benefit from future updates, configure your fork to sync with this repository.
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 monorepo is meant to help you easily deploy, so you can jump straight to substance:
- Vue v3
- x (Database) - PostgreSQL and MongoDB setups included, but configure and use any database you want.
- TypeORM
- GraphQL/Apollo
- NestJS v8
- NGINX
These core services are supported by the following:
- Nx v13 - extensible build framework with computation caching to rebuild only what is necessary; includes Nest and Vue plugins that expose their CLI generators, etc.
- Yarn v3 - 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
- Deploy
- 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. Cross-var and cross-env are used for Windows compatibility.
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 start [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 [command]
: run any normalnx
commandyarn build [app]
: outputs compiled app to./builds/[project]
yarn build:prod
: outputs compiled app optimized for productionyarn migration:[create|run|undo]
: create, run, or undo a database migrationyarn seed
: seed the database
yarn test [app]
: run unit testsyarn e2e [app]
: run integration tests (Cypress for frontend, Jest for backend)yarn snyk
: check dependency vulnerabilities
yarn deploy:init
: configure for an easy first deploymentyarn deploy:migrate
: run migrations and seed datayarn deploy:staging
: deploy to current staging environmentyarn deploy:swap
: swap production and staging deployments (no downtime)yarn deploy:production
: deploy to current production environment (with downtime)
yarn docker:dev-certs
: create SSL certificates for local developmentyarn docker:build
: build production docker imagesyarn docs
: outputbackend
(Nest) documentation to./docs
yarn jenkins
: serve Jenkins (must install Jenkins,brew install jenkins
)