This is a single express app serving both the frontend and backend components, for simplicity. This could be easily separated.
- This app uses Firestore as backend with the firebase-admin npm for node.js, so it requires the google serviceAccountKey.json file to be downloaded from the Firebase console. Please place in a safe location and set the GOOGLE_APPLICATION_CREDENTIALS environment variable pointing to its location. See instructions to generate the file and set the environment variable here. This project uses
dotenv
, so see .env.sampe file for reference. - Run locally as:
npm start
or in debug mode:DEBUG=app:* npm start
- Browse to http://localhost:3000
From the project root folder (so it can read google credentials file):
- node scripts/import_sentences.js scripts/sentences.jsonl.600.txt
(*) Please note that importing the 20,000 sentences file will exceed the free Firebase quota allocation.
From the project root folder (so it can read google credentials file):
- node scripts/word_ranking.js
- Import script: Implemented but for some reason the data is not getting stored in Firestore.
- English translation with Yandex: There is no free tier for individual developers.
- Tests
- Host the app on Railway or a similar platform
Other:
- Proper error handling and error pages
- There is basic API authentication based on headers, but the api key is passed through the meta tag. Proper api key management is missing.