A node.js server which used for reminding and teaching english words to WearOS.
The API is described with Swagger, so you can easily check the docs by this LINK.
git clone git@github.com:KR1470R/eng-words-reminder-server.git && \
cd eng-words-reminder-server/ && \
npm ci
First of all, let's make a copy of the configs/.env.example
:
cp configs/.env.example configs/.env
Variable | Explanation |
---|---|
SERVER_PORT | Port for the local server. |
SERVER_ENV |
demo - makes /docs endpoint available only; dev - all endpoints available for development; prod - makes /docs endpoint disabled.
|
REDIS_CACHE_HOST | Redis host(i.e localhost ). |
REDIS_CACHE_PORT | Redis port(i.e 6379 ). |
REDIS_CACHE_DB | Which DB to use(by default 0 ). |
REDIS_CACHE_USERNAME | Redis username. |
REDIS_CACHE_PASSWORD | Redis user password. |
JWT_SECRET | Your secret for JWT Auth. |
MAX_TERMS_PER_REQUEST | That's the limit for amount vocabulary words should be returned when requesting on dataset-user/book-words (recommended 10 ). |
DATA_PATH | The absolute path to the dataset of the vocabulary(note, that for now the dataset should be in a specific JSON format, exported from the Telegram as messages). Example of such message:/vocab word - meaning; word2 - meaning; and so on... |
GLOBAL_PREFIX | This can be skipped and unset. |
After the project initialized, installed dependencies and configured, you are able to run the server:
ENV_PATH="<absolute-path-to-the-project>/configs/.env" npm run start