Main tech-stack: TypeScript, Nest.js, React.js, MobX.
- Node >=
12.x - NPM >=
6.x
npm run server:start:dev- compilesdist/server/*and run nest.js local server in dev-mode (watch).npm run client:start:dev- compilesdist/client/*files in dev-mode (watch).- Open in browser http://localhost:3000/login
- Login with any username and password ==
adminto get access token for restricted apis. - JWT-token (issued via
@nestjs/jwt) stored in browser's session storage after successful login. - After that you will be redirected
/quiz/randomto get a quiz.
/app home page (redirects to random-quiz page)/login- user login form page/quiz/random- find random-quiz and redirect to quiz page/quiz/:quizId- quiz page/quiz/:quizId/result- quiz results page
POST /api/v1/auth/login
GET /api/v1/auth/user
GET /api/v1/user/quiz/random
GET /api/v1/user/quiz/:quizId
GET /ap i/v1/user/quiz/:quizId/result
POST /api/v1/user/quiz/:quizId/submit
- I personally dislike the direction where React.JS went with hooks and functions (maybe it make sense in case of SSR, e.g. Next.js) and I don't think using classes is outdated or slow thing. In most of the cases it proves better readability and maintainability when properly utilized. When paired with MobX for state management it's becoming a charm and fully scalable.
- I used custom router as PoC for mobx-observable-history package (see:
/client/components/Navigation/*) since I use alreadymobxfor state management in the project. Otherwise, if not enough, standardreact-router-domwould be recommended.