This library available at quiz-sdk
Quiz is a common feature used across Byju ecosystem companies like Whitehat, Byju, Toppr. So there was a need to unify the effort to make a World class Quiz Platform to be consumed by each company.
- if any operationId in swagger-doc is added or updated, please update the serverhandler in mock to avoid UT failing.
- if you add any new type of question, please add max-attempt-limit in
utils/getValidAttemptsNoForQuestion
file. - Please use the svg for icon, if icon can be used in many place by just changing the color. see step in
shared/icons/index
file.
- nvm (node package manager)
- yarn (npm i yarn -g)
- create .npmrc file in the root of the project repo
- add below line of code to .npmrc file.
- @WHJR2-0:registry=https://npm.pkg.github.com
- Create your personal Token on github (profile -> settings -> developer setting -> personal token ). This is one time job. https://github.com/settings/apps
- Run below command
- npm login --registry=https://npm.pkg.github.com
- password = Personal token
- Try npm install
- NOTE: DON'T PUSH .npmrc file (keep it local to your machine)
- Lastly,
npm i @WHJR2-0/quiz-sdk
- Package Manager: Yarn
- UI Library: React
- Scripting Language: Typescript
- Unit test case library: React-testing-library and Jest
- CICD integration: github
- i18n: react-intl
- Error, alerts and Monitoring: Datadog
- API lib for rest: Swagger client
- CSS framework: Tailwind CSS
In the project directory, you can run
Runs the app in the development mode Open http://localhost:3006 to view it in the browser.
Launches the test runner in the interactive watch mode.
To create the css file with all available classes before start of development.
It is also in-build with start
and 'babel-build` script
it is for final package build which create dist
folder.
-
src/lib
main folder for our code-
apis
: contain swagger and apollo client and responsible for API call -
assets
: for images and svgs -
components
: contains all component for all pages -
constants
: contain constants for testing role-label, data-testid, app -
lang
: have all language files for internationlization -
pages
: contain all pages -
themes
: conatin theme like default, dark -
typings
: have configuration for typescript type for packages -
utils
: conatin important helper function like get, coookie, timeWorker ... -
index.css
: main glocal css file withall classes
while dev mode andused classes
for production mode -
index.ts
: entry point for our package
-
-
src/condig/key
file for client custom variable like theme, apollo-client url, quiz-id, tenantid -
src/index/tsx
file that is Entry point for our library -
src/tailwind.css
file for all tailwindcss in-build and custom classes -
src/setupTests.ts
file to setup environment for test, mocking for browser API like web-worker, localStorage -
tailwind.config.js
very important file to add custom color, variant
All rights reserved under WhiteHatjr.