Skip to content

Nx monorepo with dockerized NestJS backend, Vue frontend, NGINX, Jest & Cypress testing, Jenkins CI/CD, and agnostic data via TypeORM + GraphQL.

License

Notifications You must be signed in to change notification settings

IgorAbramov/nest-vue

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nest-vue

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.

Get Started

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.

VSCode Setup

Yarn has a guide for working with PnP packages in Visual Studio Code. TLDR: yarn dlx @yarnpkg/sdks vscode.

Project Setup

Some minimal setup is required (environment variables, certificates, etc). Follow the guide.

The Stack (VxNN)

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.

Documentation

Learn how to get started with this respository, how services are set up, and how you can customize them to your needs.

Scripts

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.

Development

  • yarn docker:dev: spins up db and nginx 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 or frontend)
  • yarn nx [command]: run any normal nx command
  • yarn build [app]: outputs compiled app to ./builds/[project]
  • yarn build:prod: outputs compiled app optimized for production
  • yarn migration:[create|run|undo]: create, run, or undo a database migration
  • yarn seed: seed the database

Testing

  • yarn test [app]: run unit tests
  • yarn e2e [app]: run integration tests (Cypress for frontend, Jest for backend)
  • yarn snyk: check dependency vulnerabilities

Deployment (Blue/Green)

  • yarn deploy:init: configure for an easy first deployment
  • yarn deploy:migrate: run migrations and seed data
  • yarn deploy:staging: deploy to current staging environment
  • yarn deploy:swap: swap production and staging deployments (no downtime)
  • yarn deploy:production: deploy to current production environment (with downtime)

Support

  • yarn docker:dev-certs: create SSL certificates for local development
  • yarn docker:build: build production docker images
  • yarn docs: output backend (Nest) documentation to ./docs
  • yarn jenkins: serve Jenkins (must install Jenkins, brew install jenkins)

About

Nx monorepo with dockerized NestJS backend, Vue frontend, NGINX, Jest & Cypress testing, Jenkins CI/CD, and agnostic data via TypeORM + GraphQL.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 75.1%
  • JavaScript 10.3%
  • Shell 5.5%
  • Dockerfile 5.1%
  • Vue 3.4%
  • HTML 0.6%