Mx hiring challenge
Find a file
2022-11-07 21:01:39 +05:30
src add a throw for silent nest errors 2022-11-07 19:35:31 +05:30
test finish unit tests 2022-11-01 13:02:34 +05:30
.dockerignore add dockerignore and change dockerfile steps 2022-11-07 20:02:51 +05:30
.env.example init repo, finish user auth api 2022-10-31 05:27:46 +05:30
.eslintrc.js init repo, finish user auth api 2022-10-31 05:27:46 +05:30
.gitignore init repo, finish user auth api 2022-10-31 05:27:46 +05:30
.prettierrc init repo, finish user auth api 2022-10-31 05:27:46 +05:30
API.md add api docs 2022-11-01 15:16:26 +05:30
docker-compose.yml change deploy command to use node directly instead 2022-11-07 19:17:35 +05:30
Dockerfile add dockerignore and change dockerfile steps 2022-11-07 20:02:51 +05:30
nest-cli.json init repo, finish user auth api 2022-10-31 05:27:46 +05:30
package.json init repo, finish user auth api 2022-10-31 05:27:46 +05:30
pnpm-lock.yaml init repo, finish user auth api 2022-10-31 05:27:46 +05:30
README.md update readme 2022-11-07 21:01:39 +05:30
tsconfig.build.json init repo, finish user auth api 2022-10-31 05:27:46 +05:30
tsconfig.json init repo, finish user auth api 2022-10-31 05:27:46 +05:30

Mx Leaderboard API

Basic leaderboard api using next js, mariadb and typescript.

For API design, refer to API.md.

Architecture

Nest Js is a "skeleton" MVC framework with the application being divided into modules. This project contains 3 modules namely, auth, user, and rank, for authentication, user model related, and rank model related APIs respectively. Validation of incoming data is enabled globally.

Each module has a model service, and a controller that handles routes with some having model definitions as well.

This project has a very basic architecure of the following:

user ---> this api service <---> mariadb

Development

  • Copy .env.example to .env, and add relevant information
  • pnpm install
  • pnpm start:dev

Deployment

  • Copy .env.example to .env, and add relevant information
  • pnpm run i
  • pnpm run build
  • pnpm prune --production
  • node dist/main.js --host 0.0.0.0