Mx hiring challenge
| src | ||
| test | ||
| .dockerignore | ||
| .env.example | ||
| .eslintrc.js | ||
| .gitignore | ||
| .prettierrc | ||
| API.md | ||
| docker-compose.yml | ||
| Dockerfile | ||
| nest-cli.json | ||
| package.json | ||
| pnpm-lock.yaml | ||
| README.md | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
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.exampleto.env, and add relevant information pnpm installpnpm start:dev
Deployment
- Copy
.env.exampleto.env, and add relevant information pnpm run ipnpm run buildpnpm prune --productionnode dist/main.js --host 0.0.0.0