Logo Lanfrica

MariaChmite/darija-translator

Domain:

natural language processing

Record type:

software
Creator:
Mar
Host:
# πŸ‡²πŸ‡¦ Darija Translator β€” Full-Stack Project LLM-powered REST service that translates text into Moroccan Arabic Dialect (Darija), with a Chrome extension, PHP client, Python client, and React Native mobile app. --- ## Project Structure ``` darija-translator/ β”œβ”€β”€ java-service/ ← Jakarta EE REST service (WAR) β”‚ β”œβ”€β”€ pom.xml β”‚ └── src/main/java/ma/translator/ β”‚ β”œβ”€β”€ TranslatorApplication.java JAX-RS bootstrap (@ApplicationPath) β”‚ β”œβ”€β”€ resource/ β”‚ β”‚ β”œβ”€β”€ TranslatorResource.java REST endpoint β”‚ β”‚ └── CorsFilter.java CORS for browser clients β”‚ β”œβ”€β”€ service/ β”‚ β”‚ └── TranslationService.java Calls Google Gemini API β”‚ β”œβ”€β”€ security/ β”‚ β”‚ β”œβ”€β”€ SecurityConfig.java @BasicAuthenticationMechanismDefinition β”‚ β”‚ └── DarijaIdentityStore.java In-memory user store β”‚ └── model/ β”‚ β”œβ”€β”€ TranslationRequest.java β”‚ └── TranslationResponse.java β”‚ β”œβ”€β”€ chrome-extension/ ← Manifest V3 Chrome Extension β”‚ β”œβ”€β”€ manifest.json β”‚ β”œβ”€β”€ background.js Service worker: context menu, message routing β”‚ β”œβ”€β”€ sidepanel.html Side panel UI β”‚ └── sidepanel.js Logic: translate, TTS, speech, history β”‚ β”œβ”€β”€ php-client/ β”‚ └── client.php CLI + web interface β”‚ β”œβ”€β”€ python-client/ β”‚ └── client.py CLI + interactive REPL β”‚ β”œβ”€β”€ react-native-client/ β”‚ β”œβ”€β”€ package.json β”‚ └── App.js Full mobile app (Expo) β”‚ └── test_api.sh cURL test commands ``` --- ## 1 β€” Java REST Service ### Prerequisites - JDK 17+ - Maven 3.9+ - A free Google Gemini API key β†’ ai.google.dev ### Get a Gemini API Key 1. Go to aistudio.google.com 2. Click **Create API key** 3. Copy the key β€” you'll set it as an environment variable ### Build & Run (Payara Micro β€” embedded, no server install needed) ```bash cd java-service export GEMINI_API_KEY=y …