LinguaLink
==========

LinguaLink is a Java 17 language-learning project with both:
- a console app (`lingualink-app`)
- a Spring Boot web app (`lingualink-web`)

Core features include:
- local dictionary-based translation
- flashcard/topic practice
- multiple-choice quiz sessions
- optional online translation fallback in the web UI via MyMemory


Project Structure
-----------------

- `lingualink-core`
  Domain models and business logic (translation, lessons, quizzes).

- `lingualink-data`
  Data access and loaders for classpath JSON/CSV datasets.

- `lingualink-app`
  Console interface (`com.lingualink.app.LinguaLinkApp`).

- `lingualink-web`
  Spring Boot + Thymeleaf web interface (`com.lingualink.web.LinguaLinkWebApplication`).


Requirements
------------

- Java 17 (JDK)
- Maven (or use the included Maven wrapper on Windows: `mvnw.cmd`)


Quick Start (Windows / PowerShell)
----------------------------------

From the repository root:

1) Build everything
   `.\mvnw.cmd clean package`

2) Run tests
   `.\mvnw.cmd test`

3) Run web app (default port 8080)
   `.\mvnw.cmd -pl lingualink-web spring-boot:run`
   Open: http://localhost:8080

4) Run console app
   `.\mvnw.cmd -pl lingualink-app exec:java' 
   or '.\mvnw.cmd -pl lingualink-web -am org.springframework.boot:spring-boot-maven-plugin:3.2.5:run'


Configuration
-------------

Web module config is in:
- `lingualink-web/src/main/resources/application.properties`

Important properties:
- `server.port` (defaults to 8080; can be overridden with `SERVER_PORT`)
- `lingualink.translation.mymemory.enabled` (online fallback toggle)


Data Files
----------

Seed data lives under:
- `lingualink-data/src/main/resources/data/vocabulary.json`
- `lingualink-data/src/main/resources/data/vocabulary_extra.csv`
- `lingualink-data/src/main/resources/data/quiz.json`

If a local translation is missing, add entries to these datasets and rebuild.


Notes
-----

- The root project includes Maven and Gradle module files, but the ready-to-use
  wrapper in this repository is Maven (`mvnw.cmd`).
- For development convenience, Thymeleaf cache is disabled in web properties.
