256Taras / nest-vue

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nest-vue

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.

Get Started

git clone --depth 1 https://github.com/troncali/nest-vue your-project
cd your-project
yarn install

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

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.

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 nx serve [app]: serve and watch an app (backend or frontend)
  • yarn nx build [app]: outputs compiled app to ./builds/[project]
  • yarn migration:[create|run|undo]: create, run, or undo a database migration
  • yarn seed: seed the database

Testing

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

Support

  • yarn docker:dev-certs: create SSL certificates for local development
  • yarn docker:prod: builds production docker images
  • yarn docker:deploy: add your docker context for easy deployment
  • yarn docs: outputs backend (Nest) documentation to ./docs
  • yarn jenkins: spin up Jenkins (must install Jenkins, brew install jenkins)

About

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

License:MIT License


Languages

Language:TypeScript 82.7%Language:Dockerfile 5.5%Language:Shell 3.8%Language:Vue 3.7%Language:JavaScript 3.7%Language:HTML 0.5%