Giter Club home page Giter Club logo

api-js's Introduction

api-js-reference

Reference repo for JS API project.

Prerequisites

  • We will use yarn to enable monorepo
  • Not tested in M$ Windows.

Mongodb server

This project requires mongodb server. You can easily set it up using docker compose. A docker-compose.yml is included in the repo.

docker compose up -d

Yarn workspaces

Example commands

# install all packages
yarn

# run npm script in root
yarn <script-name>
yarn lint-staged

# install an npm package in root project
yarn add some-package
yarn add serverless
yarn add -D prettier

# run npm script in sub package
yarn workspace <project-name> <script-name>
yarn workspace model lint
yarn workspace model test

# install an npm package in sub project
yarn workspace <project-name> add some-package
yarn workspace model add mongoose
yarn workspace model add -D eslint

Coding

Auto code formatter and linting

We use prettier to format our codes and eslint to lint,

VSCode extensions:

Auto check code format and lint every commit

We use lint-staged and husky to make this happen.

To configure, edit the file .lintstagedrc.json. For more info, go to lint-staged documentation.

Run unit/integration tests

# One time execution
yarn workspace <package-name> test
yarn workspace model test

# Run every time a file has changed
yarn workspace <package-name> test:watch
yarn workspace model test:watch

Build package

# One time execution
yarn workspace <package-name> build
yarn workspace model build

# Run every time a file has changed
yarn workspace <package-name> build:watch
yarn workspace model build:watch

Able to run APIs in one serverless-offline instances

Coming soon.

Continuous Integration

Auto check code format and lint every commit

Coming soon.

Run unit/integration tests

Coming soon.

Able to run APIs in one serverless-offline instances

Coming soon.

Run static code analysis

Coming soon.

Continuous Deployment

Deploy each API separately

Coming soon.

Yarn

Cache packages

Coming soon.

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.