feat: production deployment - full update with providers, admin, glossaries, pricing, tests
Major changes across backend, frontend, infrastructure: - Provider system with model selection (Google, DeepL, OpenAI, Ollama, Google Cloud) - Admin panel: user management, pricing, settings - Glossary system with CSV import/export - Subscription and tier quota management - Security hardening (rate limiting, API key auth, path traversal fixes) - Docker compose for dev, prod, and IONOS deployment - Alembic migrations for new tables - Frontend: dashboard, pricing page, landing page, i18n (en/fr) - Test suite and verification scripts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,7 @@ interface ProviderConfig {
|
||||
|
||||
interface SettingsConfig {
|
||||
google: ProviderConfig;
|
||||
google_cloud: ProviderConfig;
|
||||
deepl: ProviderConfig;
|
||||
openai: ProviderConfig;
|
||||
ollama: ProviderConfig;
|
||||
@@ -42,6 +43,7 @@ interface EnvInfo {
|
||||
openrouter_premium: boolean;
|
||||
zai: boolean;
|
||||
ollama: boolean;
|
||||
google_cloud: boolean;
|
||||
}
|
||||
|
||||
interface OllamaModel {
|
||||
@@ -52,6 +54,7 @@ interface OllamaModel {
|
||||
|
||||
const defaultConfig: SettingsConfig = {
|
||||
google: { enabled: true, timeout: 30, max_retries: 3 },
|
||||
google_cloud: { enabled: false, api_key: "", timeout: 30, max_retries: 3 },
|
||||
deepl: { enabled: false, api_key: "", timeout: 30, max_retries: 3 },
|
||||
openai: { enabled: false, api_key: "", timeout: 60, max_retries: 3 },
|
||||
ollama: { enabled: false, base_url: "http://localhost:11434", model: "llama3" },
|
||||
@@ -70,6 +73,7 @@ const defaultEnvInfo: EnvInfo = {
|
||||
openrouter_premium: false,
|
||||
zai: false,
|
||||
ollama: false,
|
||||
google_cloud: false,
|
||||
};
|
||||
|
||||
export default function AdminSettingsPage() {
|
||||
@@ -224,7 +228,7 @@ export default function AdminSettingsPage() {
|
||||
<div className="grid gap-4">
|
||||
<ProviderCard
|
||||
title="Google Translate"
|
||||
description="Tier gratuit : 500 000 caractères/mois. Aucune clé requise."
|
||||
description="Accès web non officiel via deep_translator. Aucune clé requise, usage raisonnable recommandé."
|
||||
enabled={config.google.enabled}
|
||||
onToggle={(enabled) => updateProvider("google", { enabled })}
|
||||
onTest={() => testProvider("google")}
|
||||
@@ -233,6 +237,35 @@ export default function AdminSettingsPage() {
|
||||
noApiKey
|
||||
/>
|
||||
|
||||
<ProviderCard
|
||||
title="Google Cloud Translation (officiel)"
|
||||
description="API officielle Google Cloud. 500 000 car./mois offerts, puis ~$20/M car. Clé API sur console.cloud.google.com"
|
||||
enabled={config.google_cloud.enabled}
|
||||
onToggle={(enabled) => updateProvider("google_cloud", { enabled })}
|
||||
onTest={() => testProvider("google_cloud")}
|
||||
testResult={testResults.google_cloud ?? "idle"}
|
||||
testMessage={testMessages.google_cloud}
|
||||
envKeySet={envInfo.google_cloud}
|
||||
>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="google-cloud-key">Clé API</Label>
|
||||
<Input
|
||||
id="google-cloud-key"
|
||||
type="password"
|
||||
placeholder={
|
||||
envInfo.google_cloud
|
||||
? "Clé configurée dans .env (laisser vide pour l'utiliser)"
|
||||
: "AIza..."
|
||||
}
|
||||
value={config.google_cloud.api_key || ""}
|
||||
onChange={(e) => updateProvider("google_cloud", { api_key: e.target.value })}
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Activez <code>Cloud Translation API</code> dans Google Cloud Console, puis créez une clé API restreinte à cette API.
|
||||
</p>
|
||||
</div>
|
||||
</ProviderCard>
|
||||
|
||||
<ProviderCard
|
||||
title="DeepL"
|
||||
description="Traduction professionnelle. Obtenez une clé sur deepl.com/pro-api"
|
||||
|
||||
Reference in New Issue
Block a user