The backend server for LingDocs
- TypeScript 63.7%
- EJS 29.6%
- JavaScript 3.9%
- Python 1.9%
- CSS 0.5%
- Other 0.4%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| anki-service | ||
| public | ||
| src | ||
| views | ||
| .dockerignore | ||
| .gitignore | ||
| .npmrc | ||
| check-couchdb.ts | ||
| Dockerfile | ||
| google-sheets-app-script.js | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
lingdocs-backend
The backend node server app for LingDocs sites. Handles auth and various apis.
CouchDB
This relies on an external CouchDB instance which manages both the accounts as well as the user's personal databases for wordlists.
When a user upgrades their account level to student or editor:
- A doc in the
_usersdb is created with their authentication info, account level, and a password they can use for syncing their personal wordlistdb - A user database is created which they use to sync their personal wordlist.
There is also a review-tasks database which is used to store all the review tasks for editors and syncs with the review tasks in the app for the editor(s).
Deploying
docker-compose.yml
services:
redis:
image: redis:8
restart: unless-stopped
command: redis-server --appendonly yes
volumes:
- ./volumes/redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
networks:
- backend
python:
image: git.lingdocs.com/lingdocs/lingdocs-anki-service
restart: unless-stopped
networks:
- backend
volumes:
- ./anki-media:/anki-media
app:
image: git.lingdocs.com/lingdocs/lingdocs-backend:latest
restart: unless-stopped
depends_on:
redis:
condition: service_healthy
python:
condition: service_started
ports:
- "4000:4000"
networks:
- backend
volumes:
- ./anki-media:/anki-media
environment:
NODE_ENV: "production"
PORT: "4000"
NTFY_TOPIC:
NTFY_URL:
LINGDOCS_EMAIL_HOST:
LINGDOCS_EMAIL_USER:
LINGDOCS_EMAIL_PASS:
LINGDOCS_COUCHDB:
LINGDOCS_COUCHDB_USERNAME:
LINGDOCS_COUCHDB_PASSWORD:
LINGDOCS_DICTIONARY_URL:
LINGDOCS_ACCOUNT_COOKIE_SECRET:
LINGDOCS_ACCOUNT_GOOGLE_CLIENT_SECRET:
LINGDOCS_ACCOUNT_GITHUB_CLIENT_SECRET:
LINGDOCS_ACCOUNT_RECAPTCHA_SECRET:
LINGDOCS_ACCOUNT_UPGRADE_PASSWORD:
STRIPE_SECRET_KEY:
STRIPE_WEBHOOK_SECRET:
LINGDOCS_SERVICE_ACCOUNT_EMAIL:
LINGDOCS_DICTIONARY_SPREADSHEET:
LINGDOCS_DICTIONARY_SHEET_ID:
LINGDOCS_SERVICE_ACCOUNT_KEY:
networks:
backend:
driver: bridge