Skip to content

votUCA/votUCAback

Repository files navigation

Backed Logo

NestJS Version TypeGraphQL Version Typescript Version Typegoose Version Apollo Server Version GraphQL Version

Prerequisites

Node

If you don't have node yet, install using nvm

Yarn

$ npm -g install yarn

Installation

$ yarn install

Running the app

# start mongodb from docker
$ yarn start:mongo

# development
$ yarn start

# watch mode
$ yarn start:dev

# production mode
$ yarn start:prod

Test

# unit tests
$ yarn test

# e2e tests
$ yarn test:e2e

# test coverage
$ yarn test:cov

Code Style

This project use standardjs code style

Formatting

This project has configured eslint + prettier to follow the standardjs code style

If you use VSCode add the following to your settings to autoformat on save

  "eslint.autoFixOnSave": true,
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    {
      "language": "typescript",
      "autoFix": true
    },
    {
      "language": "typescriptreact",
      "autoFix": true
    }
  ]

How to commit

This project is going to use conventionalcommits as commit format to help us create changelogs

Example

git commit -m "chore: update dependencies"

If you don't know the coventionalcommits syntax:

Install commitizen as global utility

yarn global add commitizen cz-conventional-changelog

Create a .czrc file in your home directory, with path referring to cz-conventional-changelog

echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc

Commiting with commitizen prompt

with this approach use always the terminal

If the commands doesn't work add the following line export PATH="$PATH:$(yarn global bin)" to your .bashrc or .zshrc

Built With

TypeScript is a superset of JavaScript which primarily provides optional static typing, classes and interfaces

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications on top of TypeScript.

Apollo Server is the best way to quickly build a production-ready, self-documenting API for GraphQL clients, using data from any source

GraphQL is a syntax that describes how to ask for data, and is generally used to load data from a server to a client

Allow us to create GraphQL schema and resolvers with TypeScript, using classes and decorators

MongoDB is a document database with provide us scalability and flexibility

Typegoose is a wrapper for mongoose’s models

Mongoose provides a straight-forward, schema-based solution to model our application data