Skip to content
forked from troncali/nest-vue

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

daymos/nest-vue

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 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, 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 install

To benefit from future updates, configure the 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) to run apps and containers in your local environment. Follow the guide.

The Stack

Here's what this monorepo helps to more easily deploy, so the focus can stay on substance:

Apps (VxNN)

  • 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.

Tools

  • 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.

Documentation

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

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.

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] – output compiled app to ./dist/apps/[project]
  • yarn build:prod – output compiled app optimized for production
  • yarn migration:[create|run|undo] – create, run, or undo a database migration in production
  • 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:initconfigure 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:b – output backend docs to ./dist/docs/backend; serve at localhost:9997
  • yarn docs:m – output compiled monorepo docs to ./dist/docs/vuepress
  • yarn docs:m-dev – watch and serve monorepo docs at localhost:9998
  • yarn jenkins – serve Jenkins at localhost:9999
    • 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 72.5%
  • JavaScript 13.7%
  • Shell 5.2%
  • Dockerfile 4.9%
  • Vue 3.2%
  • HTML 0.5%