Please note this project has been developed for a coding exercise.
- The project requires node engine >
14.xx.xx
- Run
yarn install
- Populate a .env file with needed variables (check .env.example).
- Run
yarn dev
to start development
build:prod
Builds the project for production modebuild:dev
Builds the project for development with hotmodule replacementdev
Starts dev server + watch for files to restart on changeswatch
Runs webapck in watch mode (mostly used bydev
script)nodemon
Runs the dev server. it's used bydev
script.lint
Exports eslint command and requries a file/dir path to linttest
Runs jest teststest:watch
Runs jest tests with --watch
- Always use
yarn
overnpm
- All functions should use
Named Parameters
- Project uses babel to transpile the code which is in
src/
directory. The output is inbuild
directory. - Response data is enveloped:
- For success respone :
{result: {} | []}
- For error response:
{error: {} | []}
- For success respone :
- To send errors back to user, throw an error object with the following structure:
{ statusCode: 4xx, message: 'Some Related Error Message', name: 'ERROR_NAME' // unique id for this error type ...rest // any more data needed with this error }