Frontend for Crowdsourcing Platform.
- Supports these browsers and features.
- Make sure your following requirements for npm and node are met:
Package | Version |
---|---|
npm | 6.14.14 |
node | 14.17.5 |
If you are using nvm, you can run nvm use
in the root directory to install the correct version of node.
- Open your favorite Terminal and run these commands:
npm install
npm run dev
# Local dev server will automatically starts on http://localhost:8080
In the project directory, you can run:
Clean up cached or build folders.
Runs the app in the development mode.
Open http://localhost:8080 to view it in the browser.
The page will reload if you make edits.
Similar to npm run dev
but also runs @axe-core/react.
For running eslint on source code.
For fixing eslint errors.
For running stylelint on source code.
For fixing stylelint errors.
For running prettier on the source code.
For running typescript typecheck.
Launches the test runner in the interactive watch mode.
Launches the test runner with coverage.
For running lighthouse-ci. Please ensure you ran npm run build
first before running this command.
For running talisman on the source code.
For running lint, stylelint, typecheck, test with coverage and talisman.
Builds the app for production to the .next
folder.
Same as npm run build
but for docker.
It will start the production server on http://localhost:8080. Please ensure you ran npm run build
first before running this command.
It will start the production server on http://localhost:3000 for docker. Please ensure you ran npm run build:docker
first before running this command.
- To setup a new application, create/add the brand configuration file.
{
"brand": {
"initiativeBaseRoute": {
"tts": <tts-initiative-pathname>,
"asr": <asr-initiative-pathname>,
"translation": <translation-initiative-pathname>,
"ocr": <ocr-initiative-pathname>
}
}
}
*url should start with '/' e.g for tts: "/tts-initiative" Rename initiative pages here e.g Initiative folder name should be same as initiative url name e.g if for tts url is "/tts-initiative", then its page name should be "tts-initiative"
-
To enable your brand specific changes first update config/.json file e.g. "brand": "" "contextRoot": "",
-
To enable/disable your auto validation feature on UI, update config/.json file e.g. "autoValidation": "true".
Know More -
Update sitemap.
-
Custom brand images can be added inside a folder with filename format and structure similar to this folder. also change $image-context-root: for background images path to this folder
-
To enable languages for contributions Add language code in config/.json "enabled_languages" to enable languages for contributions e.g. "enabled_languages": ["as", "bn", "en", "gu", "hi", "kn", "ml", "mr", "or", "pa", "ta", "te"];
-
To enable languages for localisation/translations Add language code in config/.json "enabled_locales" to enable languages for localisation/translations e.g. "enabled_locales": ["as", "bn", "en", "gu", "hi", "kn", "ml", "mr", "or", "pa", "ta", "te"], create common.json folder to this folder; e.g to enable "marathi" language , create public/locales/mr/common.json; Copy all the keys from public/locales/en/common.json and paste to your folder i.e public/locales/mr/common.json; Run translation script to get translations in your language.
-
Brand specific english content (text shown on UI) can be customised here. e.g "tts": "", "asr": "", "translation": "", "ocr": "", "logoTitlePrefix": "", "logoTitleSuffix": "" , // update this key only if website name contains two parts "initiativeTextSuffix": "", // update this key only if contains any suffix. e.g 'tts initiative' , here 'tts' is 'initiative name' and 'initiative' is its 'suffix' "recommendQuestionText": "Would you recommend to your friends & family?", "revisitQuestionText": "Would you revisit ?", "asrContributionStatsHeader": "Contributions made to ", "ttsContributionStatsHeader": "Contributions made to ", "ocrContributionStatsHeader": "Contributions made to ", "translationContributionStatsHeader": "Contributions made to ", "metaDescription": ": An initiative for Indian languages that will be as Indian, as you and I. We invite you to contribute data to develop Speech Recognition, Text-to-Speech, Machine Translation and Optical Character Recognition for Indian languages.", "metaOGTitle": " : An initiative for Indian languages"
similarly update <initiative-name> used in other keys.
-
Update T&C
-
Update add in url (if required) to lighthouserc
-
To onboard languages for contributions
NOTE: If language code and language already added in below points you can skip that point.
-
Add language code in config/.json "enabled_languages" to enable languages for contributions.
e.g. "enabled_languages": ["as", "bn", "en", "gu", "hi", "kn", "ml", "mr", "or", "pa", "ta", "te"];
-
Add language code and language in LOCALES_MAPPING, RAW_LANGUAGES AND DISPLAY_LANGUAGES constants to this file.
-
Add language and their unicode in LANGUAGE_UNICODE,OTHER_LANGUAGE_UNICODE constant and language specific keyboard pattern in KeyboardLanguageLayout constant to this file.
Refer below Link for Unicode:
https://jrgraphix.net/r/Unicode/0E00-0E7F
Refer below Link for keyboard layout:
https://github.com/simple-keyboard/simple-keyboard-layouts/tree/master/build/layouts
-
Add validation score for corresponding language to this file. Know More
-
Add language key and value in en.json for localisation to this folder.
e.g. "sanskrit": "Sanskrit",
-
Add language code in config/.json "hasLanguage_image" to enable images and badges.
e.g. "hasLanguage_image": ["as", "bn", "en", "gu", "hi", "kn", "ml", "mr", "or", "pa", "ta", "te"];
-
Add badges and logos for corresponding language in images folder
e.g. to enable "marathi" language logo , create public/images/[brand]/mr/logos and put all logos; to enable "marathi" language badges, create public/images/[brand]/mr/badges and put all badges;
-
-
To onboard languages for localisation/translations
NOTE: If language code and language already added in below points you can skip that point.
-
Add language code in config/.json "enabled_locales" to enable languages for localisation/translations.
e.g. "enabled_locales": ["as", "bn", "en", "gu", "hi", "kn", "ml", "mr", "or", "pa", "ta", "te"],
-
create common.json folder to this folder.
e.g to enable "marathi" language , create public/locales/mr/common.json;
-
Copy all the keys from public/locales/en/common.json and paste to your folder i.e public/locales/mr/common.json;
Run translation script to get translations in your language.
NOTE: If you don't copy all the files from en.json and don't run the translation script then by default translations would be in english.
-
Add language prefix in RAW_LANGUAGES,LOCALES_LANGUAGE_MAPPING AND LOCALE_LANGUAGES constants inside this file.
-
Add language code in config/.json "hasLanguage_image" to enable logos.
e.g. "hasLanguage_image": ["as", "bn", "en", "gu", "hi", "kn", "ml", "mr", "or", "pa", "ta", "te"];
-
Add logos for corresponding language in public/images folder.
e.g. to enable "marathi" language , create public/images/[brand]/mr/logos and add logos;
-