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, then clone a local copy to build out the project.
git clone --depth 1 https://github.com/YOUR-USERNAME/nest-vue project-name
cd project-name
yarn installTo benefit from future updates, configure the 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) to run apps and containers in your local environment. Follow the guide.
Here's what this monorepo helps to more easily deploy, so the focus can stay on substance:
- Vue 3 Frontend – JavaScript framework with a declarative and component-based programming model that helps efficiently develop user interfaces.
- x (Data) – agnostic data access through TypeORM and GraphQL. PostgreSQL and MongoDB setups included, but configure and use any supported database.
- Nest 8 Backend – progressive Node.js framework for building efficient, reliable, and scalable server-side applications.
- NGINX – high-performance HTTP server and reverse proxy with simple configuration and low resource consumption.
- Nx 13 – extensible build framework with computation caching to rebuild only what is necessary; includes Nest and Vue plugins that expose their CLI generators, etc.
- Yarn 3 – slim dependency management using Plug'N'Play for smaller repositories.
- Docker – spin up the 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 CI/CD pipeline that can be built out to meet requirements.
Learn how to get started with this respository, how to deploy it, how services are set up, and how to customize services at vxnn.troncali.com/guide/.
Scripts run from the monorepo root and must be called with yarn to resolve dependencies. Cross-var and cross-env are used for Windows compatibility.
yarn docker:dev– spins updbandnginxfor 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 (backendorfrontend)backendserved at http://localhost:3001/api/; also HTTPS ifnginxcontainer is runningfrontendserved at http://localhost:8080/
yarn nx [command]– run any normalnxcommandyarn build [app]– output compiled app to./dist/apps/[project]yarn build:prod– output compiled app optimized for productionyarn migration:[create|run|undo]– create, run, or undo a database migration in productionyarn 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:b– outputbackenddocs to./dist/docs/backend; serve at localhost:9997yarn docs:m– output compiled monorepo docs to./dist/docs/vuepressyarn docs:m-dev– watch and serve monorepo docs at localhost:9998yarn jenkins– serve Jenkins at localhost:9999- Must install Jenkins:
brew install jenkins
- Must install Jenkins: