LLM-powered English to Moroccan Darija Translator (REST + PHP + Chrome Extension)
# LLM-powered English → Moroccan Darija Translator
## Description du projet
Ce projet consiste à développer un **service web RESTful** permettant la traduction automatique
de l’anglais vers le dialecte marocain **Darija**, en s’appuyant sur un **Large Language Model (LLM)**.
Le système repose sur une **architecture client–service** :
* un service REST développé en **Java (Jakarta EE / JAX-RS)**,
* des clients consommateurs (PHP et extension Chrome).
La traduction est assurée par l’API **Google Gemini (offre gratuite)**.
## Objectifs du projet
* Exposer une API REST `/api/translate`
* Traduire un texte anglais vers le Darija
* Intégrer un LLM pour une traduction contextuelle
* Proposer plusieurs clients pour consommer le service
* Gérer les erreurs (quota API, service indisponible)
## Architecture du projet
Darija-Translator
* translator-service
* pom.xml
* src/main/java/com/service/translation
* TranslationApp.java
* TranslatorResource.java
* Translator.java
* package-info.java
* src/main/webapp
* index.html
* DarijaTranslatorClient
* php-client
* index.php
* translate.php
* style.css
* chrome-extension
* manifest.json
* sidepanel.html
* sidepanel.js
* README.md
## ⚙️ Technologies utilisées
* Java 11+
* Jakarta EE / JAX-RS
* Google Gemini API (LLM)
* PHP
* HTML / CSS / JavaScript
* Chrome Extension (Manifest V3)
* Maven
* Postman, SoapUI, cURL
## 🔌 Service REST (Partie Java)
* Endpoint principal : `/api/translate`
* Méthode : POST
* Entrée : texte en anglais (text/plain)
* Sortie : traduction en Darija (text/plain)
* Communication avec l’API Gemini
* Gestion des erreurs (quota API, indisponibilité)
## 🖥️ Clients consommateurs
### Client Web PHP
* Interface web simple
* Envoi du texte au service Java
* Nettoyage de la réponse
* Support RTL pour l’arabe
Fichiers :
* index.php
* translate.php
* style.css
### Extension Chrome
* Side Panel (Manifest V3)
* Traduction directe dans le navigateur
* Communication avec le client PHP
* Aff …