Giter VIP home page Giter VIP logo

api's Introduction

Zesttee Setup Guide

Tools we use


Getting Started

$ yarn
$ yarn start

Commands

Run

# Setup postgresdb
# Run normally
$ yarn start
# Run the application with nodemon for development
$ yarn dev

Use docker for development

$ Install docker
$ Run docker-compose -f docker-compose.dev.yml build to build local docker project
$ Run docker-compose -f docker-compose.yml build up make docker run the stack
$ Run docker exec -it node-server bash to enter the node console
$ In it enter any command to run migration(npm run migrate, npm run seed, npm run rollback)

Test

# Test
$ yarn test                           # Run all test
$ yarn test:unit                      # Run only unit test
$ yarn test:integration               # Run only integration test
# Test (Watch Mode for development)
$ yarn test:watch                     # Run all test with watch mode
$ yarn test:watch:unit                # Run only unit test with watch mode
$ yarn test:watch:integration         # Run only integration test with watch mode
# Test Coverage
$ yarn test:coverage                  # Calculate the coverage of all test
$ yarn test:coverage:unit             # Calculate the coverage of unit test
$ yarn test:coverage:integration      # Calculate the coverage of integration test
# Test consistent coding style (Lint)
$ yarn lint                           # Lint all sourcecode
$ yarn lint:app                       # Lint app sourcecode
$ yarn lint:test                      # Lint test sourcecode

Archive

$ yarn pack

Basic api query use for getAll resources. Only support normal query if need complex or advanced use cases (fulltextsearch, geolocation...) contact server developers to support more.

$ Paginate with limit and offset. Ex: ?limit=5&offset=5
$ Order by fields and order reverse use prefix "-". Ex: ?orderBy=age,-name
$ Include other relate models(rare case caution on use). Ex: users?includes=books (user has many books)
$ Select field on query (Only use in single models). Ex: ?fields=age,name
$ Filter equal ?filter={"name": "Alex"}
$ Filter less than ?filter={"age": {"$lt": 40}}
$ Filter greater than ?filter={"age": {"$gt": 20}}
$ Filter less than and equal ?filter={"age": {"$lte": 40}}
$ Filter greater than equal ?filter={"age": {"$gte": 20}}
$ Filter field in many choice ?filter={"name": {"$in": ["Alex", "Doan"]}}
$ Filter array field is subset of parent array ?filter={"tags": {"$all": ["Tag1", "Tag2"]}}

api's People

Contributors

nickchampion avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.