SeamlessC / universal-starter-todo

This is a starter template with Universal stack (React, Relay, Nest.js, Nest Query, MySQL)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Universal Starter Template

Get started

  • Make sure you've installed Node 16 for optimal usage. (14 will work but pnpm setup could be harder)

  • Install pnpm package manager. For node versions before 16, use npm install -g pnpm

    corepack enable
    
  • Install watchman (required for relay) from here https://facebook.github.io/watchman/ or through chocolatey,

    choco install watchman
    
  • Install dependencies through,

    pnpm install
    
  • You should have mysql installed and running on your machine.

  • You can customize the database connection by creating a .env.dev file in backend folder. Structure of the file is as follows.

    DATABASE_NAME=universal_todo
    DATABASE_USER=root
    DATABASE_PASSWORD=root
    
  • Make sure your MySQL has a database with the correct name with correct username and password.

  • Start the development servers with,

    pnpm dev
    

Dependency Installation

Utilize following commands to install in the respective project folders

  • Frontend install (alias for pnpm --filter frontend add)

    pnpm fea lodash
    
  • Backend install (alias for pnpm --filter backend add)

    pnpm bea lodash
    

PNPM Command Usage

Aliases has been created to utilize scoped PNPM commands correctly.

  • backend (for pnpm --filter backend)

    pnpm be
    
  • frontend (for pnpm --filter frontend)

    pnpm fe
    

PNPM Examples

  • Run dev script in backend.

    pnpm be dev
    
  • remove lodash from frontend

    pnpm fe remove lodash
    

CRUD Endpoint generation

  • A custom made version of @nestjs/cli has been created for this project.
  • It is capable of generating an entire CRUD resource (Module, Service, Resolver, Entity, DTOs) by itself.
  • It is integrated with TypeORM and nestjs-query as well.
  • Run the following command to create a new resource.
    pnpm nestgen resource-name
    
  • You should always use this to generate new Endpoints.

Commit guide

We utilize convention commits to put our commits in a standard format. This helps us to generate changelogs and release notes automatically. Please follow the following guide to commit your changes.

The commit message should be structured as follows:

<type>[optional scope]: <description>

[optional body]

[optional footer]

Examples

Commit message with description

feat: add 'comments' option

You should use feat:, fix:, chore:, mainly. Additionally you can use docs:, style:, refactor:, perf:, test: as well.

Commit message with description and breaking change in body

feat: allow provided config object to extend other configs

BREAKING CHANGE: `extends` key in config file is now used for extending other config files

Commit message with no body

docs: correct spelling of CHANGELOG

Commit message with scope

feat(lang): added polish language

Commit message for a fix using an (optional) issue number.

fix: minor typos in code

see the issue for details on the typos fixed

fixes issue #12

Workspace usage

Utilize the workspace file to access the workspace, it contains following folders,

Library Documentation

Backend

Frontend

Database Browsing

Build Process

Todo

Testing

Todo

About

This is a starter template with Universal stack (React, Relay, Nest.js, Nest Query, MySQL)


Languages

Language:TypeScript 94.3%Language:JavaScript 4.2%Language:CSS 1.0%Language:HTML 0.4%Language:Shell 0.2%