Skip to content

Simply put together a demo app using Nest.js to better understand the ins and outs of the Nest.js module.

Notifications You must be signed in to change notification settings

ShinMini/shinmini-server

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Nest.js Server Demo

Introduction

This is the repository of Nest.js Server Demo App. It contains most of the Exchange features.

Nest.js Demo Server App is developed with Nest.js in TypeScript.

Architecture

Folder Structure

/scripts/gen-module.sh # Create module template
/src|__assets # Folder to store the project's image, SVG icon
 |__components # Folder containing all the shared components of the project
 |__hooks # The folder containing the project's custom hooks
 |__contexts # The folder containing the project's custom contexts
 |__i18n # Folder containing the project's multilingual configuration section
 |__libs # Folder containing custom libs
 |__modules # Folder contains subfolders which collectively group features and contents that serve a common business-related purpose
 |__redux
    |__persists # Folder of persist custom for each reducer
    |__reducers # Folder of redux reducers
    |__sagas # Folder of redux config saga
    |__stores # Config store
 |__services
    |event-bus.ts # File containing events sent in App
    |api-request.ts # File contains request api . methods
    |firebase.ts # File contains firebase-related configs for push notifications
    |socket.ts # File to handle the real time part related to socket IO
 |__storage # Folder contains functions to save and retrieve values from local storage
 |__themes # Folder config colors, fonts, sizes
 |__typings # Folder contains root interface
 |__utils # Folder contains common processing functions in App

App Folder

Assets

The ./src/assets folder contains all assets:

Folder Description
/fonts This folder store all fonts
/images This folder store all images
/svgs This folder store all icons using

Components

The ./src/components folder contains all common components:

Folder Description
/base This folder contains original component of RN with custom props
/loading This folder contains loading global
/root This folder contains socket listener global
/button This folder contains button common (ButtonHorizontal, etc)
/image This folder contains image common (CircleImage, etc)

Modules

The ./src/modules folder contains subfolders which collectively group features and contents that serve a common business-related purpose. For instance, login is a module and user is another module. Each sub folder under module folder adapt to this universal folder structure:

Folder Description
<module>/assets This folder is to store the image.ts file. Instructions of to add images can be found here.
<module>/src This folder is to store all action, constant, saga, selector and logic related files of the module (utils), etc.
<module>/tests This folder is to store all unit testing files of the module.
<module>/translations This folder is to store all translation file for the module.
<module>/typings This folder is to store the ambient types files of the module.
<module>/views This folder is to store all screens and views file.

Prerequisites

Tools to Download

Note: .x or .x.x indicates the latest stable minor version of that tool, e.g.: 1.x.x > 1.62.3

Tool Version How to Check How To Get
Nest.js 9.x.x yarn
Visual Studio Code 1.x.x code --version brew install --cask visual-studio-code or https://code.visualstudio.com/Download
Node 18.x.x node -v brew install node@16
NVM 0.39.1 nvm -v brew install nvm
Yarn 1.x.x yarn -v npm install --global yarn

How-Tos

Create modules template

  1. Grant permission file Sh (if not grant): sudo chmod 755 ./scripts/gen-module.sh

  2. Module name: Home => home || Profile Setting => profileSetting

  3. Run: sudo chmod 755 ./scripts/gen-module.sh => Name Module

Create merge request

  1. Create new branch git checkout -b [feature|bugfix]/action_change

    e.g.: This should be written entirely in lowercase with 2 mandatory prefixs feature or bugfix

    git checkout -b feature/add_login_ui
  2. Add file git add . or git add specific_file.ts|tsx

    e.g.:

    git add .
  3. Commit change git commit -m "description of change..."

    e.g.: This should be written entirely in lowercase

    git commit "add login screen ui"
  4. Push git push

  5. Create merge request

    • Title of merge request: This should be the description of commit change and capitalize the first letter.
    Add login screen UI
    

How to Build the Project

Additional workflow prerequisites:

  • Node.js >= 16 (from brew or from Web)
  • Nest.js
  • yarn
  1. Check if you have all the dependencies and files in Prerequisites
  2. Clone the repository
  3. Check out to main branch
  4. Launch terminal and cd to the project
  5. Exec yarn install or yarn to install NPM dependencies
  6. start with yarn dev to join the Nest.js World! 🎉

How to Add Images

Comming soon

Pre-requisites

Remember, you are writing test to guard your code against logic error and future regressions, not to chase test coverage!. However, make sure you cover all the edge cases!

Description

Nest framework TypeScript starter repository.

Installation

yarn install

Running the app

# development
yarn run start

# watch mode
yarn run start:dev

# production mode
yarn run start:prod

Test

# unit tests
yarn run test

# e2e tests
yarn run test:e2e

# test coverage
yarn run test:cov

Set Up PostGRESQL

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed. 👦

Troubleshooting

Comming soon

About

Simply put together a demo app using Nest.js to better understand the ins and outs of the Nest.js module.

Resources

Stars

Watchers

Forks

Packages

No packages published