A platform for parallel reading of books in foreign languages with an integrated dictionary and flashcard system
The system consists of the following microservices:
- Book Service - manages books, chapters, and pages
- Translation Service - translates words via the Yandex Dictionary API. Using StanfordNLP for lemmatization
- Dictionary Service - manages user flashcards and vocabulary, implements the SuperMemo 2 algorithm for interval repetition
- Book Upload Service - parses book texts using Apache OpenNLP
- Auth Service - user registration, password reset, etc
- Admin Client - web interface for administrators
Frontend app (Vue.js 3, Typescript, Vite, TailWind): https://github.com/TVFK/parallel-reading-frontend
- PostgreSQL - main data storage
- Redis - caching frequently requested data
- Kafka - asynchronous communication
- MinIO - stores book covers and texts
- Keycloak - OAuth 2.0/OIDC authentication
- Nginx - reverse proxy and static content distribution
- Victoria Metrics - collection of metrics
- Grafana Loki - log collection
- Grafana Tempo - collecting traces
- Grafana - visualization of metrics, logs and traces
- standalone - for local Spring services startup without Docker
- docker - local startup of all services without HTTPS, nginx, monitoring etc.
- prod - for production deployment
The entire application can be run locally using the compose.yaml file, all services will be deployed on localhost
- Clone the repository
git clone https://github.com/TVFK/parallel-reading.git- project collection
mvn clean package -DskipTests- Start all services
docker compose up -d --buildThe application will be available at: http://localhost
admin console: http://localhost:8083
MinIO console: http://localhost:9090
Keycloak console: http://localhost:8082
Translation service requires:
YANDEX_DICT_API_KEY=your_yandex_dictionary_keyAPI key for Yandex Dictionary can be obtained at https://yandex.ru/dev/dictionary/
- Clone the repository
git clone https://github.com/TVFK/parallel-reading.git- Creating Environment variables
In the root of the project next to compose.prod.yaml it is necessary to create a .env file with these variables:
BASE_URL=
DOMAIN=
# Keycloak variables
KEYCLOAK_DB_PASSWORD=
KEYCLOAK_ADMIN_LOGIN=
KEYCLOAK_ADMIN_PASSWORD=
# Minio variables
MINIO_ROOT_USER=
MINIO_ROOT_PASSWORD=
# Services db
BOOKS_DB_PASSWORD=
DICTIONARY_DB_PASSWORD=
# Services cache
BOOKS_SERVICE_CACHE_PASSWORD=
TRANSLATION_SERVICE_CACHE_PASSWORD=
GRAFANA_ADMIN_PASSWORD=
YANDEX_DICT_API_KEY=
- Building Spring Services
mvn clean package -DskipTests- Configuring nginx
In the config/nginx/prod/nginx-prod.conf file, you need to change the domain to your own
- Obtaining a TLS certificate
To work with HTTPS you need to get certificates. You can do this using [certbot](https://certbot.eff.org /)
- Starting compose.prod.yaml
docker-compose -f compose.prod.yaml up -d --build