diff --git a/.env.example b/.env.example index 90f7d170..46c101aa 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ # ============================================================================= -# Prediqo — variables d'environnement (NE PAS committer le fichier .env réel) +# Tloto — variables d'environnement (NE PAS committer le fichier .env réel) # # DÉVELOPPEMENT LOCAL avec Docker (stack identique au VPS, Postgres sur l'hôte) : # • cp .env.docker.example .env.docker @@ -98,7 +98,7 @@ SWEEP_MIN_AMOUNT_RAW=1000000 # HOT_USDT_MIN_RESERVE_RAW=0 RATE_LIMIT_MAX=2000 -# Ports dédiés Prediqo (n'utilise pas 80/443 du VPS) +# Ports dédiés Tloto (n'utilise pas 80/443 du VPS) PREDIQO_HTTP_PORT=9080 PREDIQO_HTTPS_PORT=9443 diff --git a/README.md b/README.md index b8eba4f9..d1d2f42b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Prediqo +# Tloto -**Prediqo** is an online prediction games platform (web + mobile) where players use **cryptocurrencies** as the payment method. The stack includes a crypto wallet layer (**USDT TRC20**, **TRX**, **USDC Polygon**) managed by the platform, ready for game integration. +**Tloto** is an online prediction games platform (web + mobile) where players use **cryptocurrencies** as the payment method. The stack includes a crypto wallet layer (**USDT TRC20**, **TRX**, **USDC Polygon**) managed by the platform, ready for game integration. ## Monorepo layout @@ -191,7 +191,7 @@ npm run migrate --- -## Prediqo Mobile (Flutter) +## Tloto Mobile (Flutter) ### Setup @@ -223,7 +223,7 @@ Configure API base URL: --- -## Prediqo Web (React) +## Tloto Web (React) ### Setup diff --git a/backend/.env.example b/backend/.env.example index 8cdb1862..ec7e953f 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -75,7 +75,7 @@ PASSWORD_RESET_EXPIRY_HOURS=1 # SMTP_SECURE=false # SMTP_USER=your-smtp-user # SMTP_PASS=your-smtp-password -# EMAIL_FROM=Prediqo +# EMAIL_FROM=Tloto # Candle Predict engine (performance tuning for production scale) # CANDLE_PREDICT_ENGINE_TICK_MS=3000 # main loop interval (ms) diff --git a/backend/src/apps/ws.ts b/backend/src/apps/ws.ts index 388fb94f..82e010fd 100644 --- a/backend/src/apps/ws.ts +++ b/backend/src/apps/ws.ts @@ -33,7 +33,7 @@ async function main(): Promise { const server = http.createServer((_req, res) => { res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end('Prediqo WebSocket gateway'); + res.end('Tloto WebSocket gateway'); }); const gameWss = new WebSocketServer({ noServer: true }); diff --git a/backend/src/brand/platformName.ts b/backend/src/brand/platformName.ts new file mode 100644 index 00000000..d3d28f39 --- /dev/null +++ b/backend/src/brand/platformName.ts @@ -0,0 +1,5 @@ +/** Official platform name shown in emails, 2FA issuers, and user-facing copy. */ +export const PLATFORM_NAME = 'Tloto'; + +/** Wordmark spelling used in branded email headers. */ +export const PLATFORM_WORDMARK = 'TLOTO'; diff --git a/backend/src/db/schema.sql b/backend/src/db/schema.sql index 6127df62..6af04242 100644 --- a/backend/src/db/schema.sql +++ b/backend/src/db/schema.sql @@ -648,7 +648,7 @@ CREATE TABLE IF NOT EXISTS candle_predict_config ( wallet_type_code VARCHAR(32) NOT NULL DEFAULT 'USDT_TRC20', auto_modes JSONB NOT NULL DEFAULT '["each_round","interval"]'::jsonb, is_active BOOLEAN NOT NULL DEFAULT TRUE, - -- Display-only synthetic instrument branding (OHLC still from Prediqo engine). + -- Display-only synthetic instrument branding (OHLC still from Tloto engine). instrument_symbol VARCHAR(16) NOT NULL DEFAULT 'FO', instrument_display_name VARCHAR(64) NOT NULL DEFAULT 'Full Option', instrument_quote_currency VARCHAR(16) NOT NULL DEFAULT 'USDT', diff --git a/backend/src/services/authService.ts b/backend/src/services/authService.ts index 2212da70..bdcaadec 100644 --- a/backend/src/services/authService.ts +++ b/backend/src/services/authService.ts @@ -8,6 +8,7 @@ import jwt from 'jsonwebtoken'; import { authenticator } from 'otplib'; import { randomBytes } from 'crypto'; import * as QRCode from 'qrcode'; +import { PLATFORM_NAME } from '../brand/platformName'; import { config } from '../config'; import { hashForIndex, hashForPhone, hashToken, decrypt, encrypt } from '../utils/crypto'; import * as userRepository from '../repositories/userRepository'; @@ -730,7 +731,7 @@ export async function setupTotp( const secret = authenticator.generateSecret(); const encrypted = encrypt(secret); - const otpauth = authenticator.keyuri(user.email_hash, 'Prediqo', secret); + const otpauth = authenticator.keyuri(user.email_hash, PLATFORM_NAME, secret); const qrCodeUrl = await QRCode.toDataURL(otpauth); await userRepository.updateTotp(userId, encrypted, false); await auditLogRepository.create({ diff --git a/backend/src/services/emailService.ts b/backend/src/services/emailService.ts index 56b7b4b0..41befd0e 100644 --- a/backend/src/services/emailService.ts +++ b/backend/src/services/emailService.ts @@ -5,6 +5,7 @@ import nodemailer from 'nodemailer'; import type Transporter from 'nodemailer/lib/mailer'; +import { PLATFORM_NAME, PLATFORM_WORDMARK } from '../brand/platformName'; import { config } from '../config'; let transporter: Transporter | null = null; @@ -94,21 +95,21 @@ function resolveFromAddress(): string { const usesGmail = host.includes('gmail.com') || host.includes('googlemail.com'); if (usesGmail && user.endsWith('@gmail.com') && !fromEmail.endsWith('@gmail.com')) { - return `"Prediqo" <${user}>`; + return `"${PLATFORM_NAME}" <${user}>`; } return from; } -/** Shared Prediqo HTML shell (no external image — works in all mail clients). */ +/** Shared branded HTML shell (no external image — works in all mail clients). */ function brandEmailHtml(title: string, bodyHtml: string): string { return `
-
Prediqo
+
${PLATFORM_WORDMARK}

${title}

${bodyHtml}

- Prediqo — premium prediction platform + ${PLATFORM_NAME} — premium prediction platform

`; @@ -122,9 +123,9 @@ const CTA_STYLE = * @param verifyUrl - Full URL opened by the user to confirm ownership */ export async function sendVerificationEmail(to: string, verifyUrl: string): Promise { - const subject = 'Verify your Prediqo email address'; + const subject = 'Verify your Tloto email address'; const text = [ - 'Welcome to Prediqo!', + 'Welcome to Tloto!', '', 'Please verify your email address by opening this link:', verifyUrl, @@ -136,7 +137,7 @@ export async function sendVerificationEmail(to: string, verifyUrl: string): Prom const html = brandEmailHtml( 'Verify your email', ` -

Thanks for joining Prediqo. Confirm your email address to secure your account.

+

Thanks for joining Tloto. Confirm your email address to secure your account.

Verify email

@@ -171,9 +172,9 @@ export async function sendVerificationEmail(to: string, verifyUrl: string): Prom * Sends a password reset message with a clickable link. */ export async function sendPasswordResetEmail(to: string, resetUrl: string): Promise { - const subject = 'Reset your Prediqo password'; + const subject = 'Reset your Tloto password'; const text = [ - 'You requested a password reset for your Prediqo account.', + 'You requested a password reset for your Tloto account.', '', 'Open this link to choose a new password:', resetUrl, @@ -185,7 +186,7 @@ export async function sendPasswordResetEmail(to: string, resetUrl: string): Prom const html = brandEmailHtml( 'Reset your password', ` -

We received a request to reset the password for your Prediqo account.

+

We received a request to reset the password for your Tloto account.

Reset password

@@ -233,9 +234,9 @@ export async function sendSecurityAlertEmail( to: string, alert: SecurityAlertPayload ): Promise { - const subject = `[Prediqo Security ${alert.severity.toUpperCase()}] ${alert.title}`; + const subject = `[Tloto Security ${alert.severity.toUpperCase()}] ${alert.title}`; const text = [ - 'A security alert was raised on the Prediqo platform.', + 'A security alert was raised on the Tloto platform.', '', `Alert ID: ${alert.alertId}`, `Severity: ${alert.severity}`, @@ -348,10 +349,10 @@ async function sendUserSecurityEmail( export async function sendNewLoginEmail(to: string, ctx: SecurityEmailContext): Promise { await sendUserSecurityEmail( to, - 'New sign-in to your Prediqo account', + 'New sign-in to your Tloto account', 'New sign-in detected', [ - 'We detected a sign-in to your Prediqo account from a new IP address or device.', + 'We detected a sign-in to your Tloto account from a new IP address or device.', '', formatSecurityContext(ctx), '', @@ -370,10 +371,10 @@ export async function sendNewCountryLoginEmail(to: string, ctx: SecurityEmailCon const country = ctx.countryCode?.trim() || 'unknown'; await sendUserSecurityEmail( to, - 'Sign-in from a new country on your Prediqo account', + 'Sign-in from a new country on your Tloto account', 'New country sign-in', [ - `We detected a sign-in to your Prediqo account from a new country (${country}).`, + `We detected a sign-in to your Tloto account from a new country (${country}).`, '', formatSecurityContext(ctx), '', @@ -391,16 +392,16 @@ export async function sendNewCountryLoginEmail(to: string, ctx: SecurityEmailCon export async function sendPasswordChangedEmail(to: string, ctx: SecurityEmailContext): Promise { await sendUserSecurityEmail( to, - 'Your Prediqo password was changed', + 'Your Tloto password was changed', 'Password changed', [ - 'The password for your Prediqo account was just changed.', + 'The password for your Tloto account was just changed.', '', formatSecurityContext(ctx), '', `Time: ${new Date().toISOString()}`, ], - `

The password for your Prediqo account was just changed.

+ `

The password for your Tloto account was just changed.

    ${formatSecurityContextHtml(ctx)}

Time: ${new Date().toISOString()}

` ); @@ -410,10 +411,10 @@ export async function sendPasswordChangedEmail(to: string, ctx: SecurityEmailCon export async function sendTotpEnabledEmail(to: string, ctx: SecurityEmailContext): Promise { await sendUserSecurityEmail( to, - 'Two-factor authentication enabled on Prediqo', + 'Two-factor authentication enabled on Tloto', '2FA enabled', [ - 'Two-factor authentication was enabled on your Prediqo account.', + 'Two-factor authentication was enabled on your Tloto account.', '', formatSecurityContext(ctx), '', @@ -429,10 +430,10 @@ export async function sendTotpEnabledEmail(to: string, ctx: SecurityEmailContext export async function sendTotpDisabledEmail(to: string, ctx: SecurityEmailContext): Promise { await sendUserSecurityEmail( to, - 'Two-factor authentication disabled on Prediqo', + 'Two-factor authentication disabled on Tloto', '2FA disabled', [ - 'Two-factor authentication was disabled on your Prediqo account.', + 'Two-factor authentication was disabled on your Tloto account.', '', formatSecurityContext(ctx), '', @@ -453,10 +454,10 @@ export async function sendRolesChangedEmail( const roleList = roles.join(', ') || '(none)'; await sendUserSecurityEmail( to, - 'Your Prediqo account roles were updated', + 'Your Tloto account roles were updated', 'Account roles updated', [ - 'An administrator updated the roles assigned to your Prediqo account.', + 'An administrator updated the roles assigned to your Tloto account.', '', `New roles: ${roleList}`, '', @@ -480,10 +481,10 @@ export async function sendPermissionsChangedEmail( const permList = permissions.join(', ') || '(none)'; await sendUserSecurityEmail( to, - 'Your Prediqo account permissions were updated', + 'Your Tloto account permissions were updated', 'Account permissions updated', [ - 'An administrator updated the permissions assigned to your Prediqo account.', + 'An administrator updated the permissions assigned to your Tloto account.', '', `Effective permissions: ${permList}`, '', diff --git a/backend/src/tests/mobileApiE2e.test.ts b/backend/src/tests/mobileApiE2e.test.ts index ff5a98e1..b3dbcac3 100644 --- a/backend/src/tests/mobileApiE2e.test.ts +++ b/backend/src/tests/mobileApiE2e.test.ts @@ -1,5 +1,5 @@ /** - * E2E API contract tests for the Prediqo mobile app. + * E2E API contract tests for the Tloto mobile app. * Validates endpoints, payloads, and response shapes the Flutter client relies on. */ import { test, describe, mock, afterEach, before } from 'node:test'; diff --git a/brand/prediqo-lockup.svg b/brand/prediqo-lockup.svg index a507a40d..31d1fe37 100644 --- a/brand/prediqo-lockup.svg +++ b/brand/prediqo-lockup.svg @@ -1,4 +1,4 @@ - + @@ -8,5 +8,5 @@ - Prediqo + TLOTO diff --git a/brand/prediqo-mark.svg b/brand/prediqo-mark.svg index 77c9effd..65a15b14 100644 --- a/brand/prediqo-mark.svg +++ b/brand/prediqo-mark.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/DEPLOY-VPS.md b/docs/DEPLOY-VPS.md index 28c62f36..137b2944 100644 --- a/docs/DEPLOY-VPS.md +++ b/docs/DEPLOY-VPS.md @@ -1,6 +1,6 @@ -# Guide de déploiement Prediqo sur VPS +# Guide de déploiement Tloto sur VPS -Ce guide décrit comment lancer Prediqo sur un serveur Linux (VPS) **sans perturber** les autres applications (ports dédiés **9080** / **9443**). +Ce guide décrit comment lancer Tloto sur un serveur Linux (VPS) **sans perturber** les autres applications (ports dédiés **9080** / **9443**). **Démarrage sur base vierge (VPS + local) :** voir la [section 4](#4-démarrage-sur-base-de-données-vierge-vps-et-local). @@ -280,7 +280,7 @@ SMTP_PORT=587 SMTP_SECURE=false SMTP_USER=votre-compte@gmail.com SMTP_PASS=xxxxxxxxxxxxxxxx -EMAIL_FROM="Prediqo" +EMAIL_FROM="Tloto" APP_PUBLIC_URL=https://prediqo.redirectme.net:9443 RESET_PASSWORD_PATH=/reset-password ``` diff --git a/package.json b/package.json index e7fe8d7e..180a2e48 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "prediqo", "private": true, - "description": "Prediqo monorepo — Phase B Docker Compose helpers", + "description": "Tloto monorepo — Phase B Docker Compose helpers", "scripts": { "phase-b:init": "docker compose run --rm --no-deps --build backend node dist/db/migrate.js && docker compose --profile http up -d --build", "phase-b:init:https": "docker compose run --rm --no-deps --build backend node dist/db/migrate.js && docker compose --profile https-dns up -d --build", diff --git a/prediqo_mobile/README.md b/prediqo_mobile/README.md index 1087cefc..48ca0d38 100644 --- a/prediqo_mobile/README.md +++ b/prediqo_mobile/README.md @@ -1,4 +1,4 @@ -# Prediqo Mobile +# Tloto Mobile ## API URL (compile-time) diff --git a/prediqo_mobile/TESTING.md b/prediqo_mobile/TESTING.md index b245292f..139641ec 100644 --- a/prediqo_mobile/TESTING.md +++ b/prediqo_mobile/TESTING.md @@ -1,4 +1,4 @@ -# Prediqo Mobile — Tests E2E +# Tloto Mobile — Tests E2E Guide pour exécuter les tests end-to-end de l'application mobile et des contrats API associés. diff --git a/prediqo_mobile/android/app/src/main/AndroidManifest.xml b/prediqo_mobile/android/app/src/main/AndroidManifest.xml index 5420a5e0..cc9f5b9b 100644 --- a/prediqo_mobile/android/app/src/main/AndroidManifest.xml +++ b/prediqo_mobile/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ diff --git a/prediqo_mobile/assets/brand/prediqo-mark.svg b/prediqo_mobile/assets/brand/prediqo-mark.svg index 77c9effd..65a15b14 100644 --- a/prediqo_mobile/assets/brand/prediqo-mark.svg +++ b/prediqo_mobile/assets/brand/prediqo-mark.svg @@ -1,4 +1,4 @@ - + diff --git a/prediqo_mobile/integration_test/app_e2e_test.dart b/prediqo_mobile/integration_test/app_e2e_test.dart index 06c137a4..12e6f892 100644 --- a/prediqo_mobile/integration_test/app_e2e_test.dart +++ b/prediqo_mobile/integration_test/app_e2e_test.dart @@ -10,7 +10,7 @@ import '../test/support/e2e_fixtures.dart'; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - group('Prediqo mobile E2E', () { + group('Tloto mobile E2E', () { tearDown(() async { if (sl.isRegistered()) { await sl.reset(); diff --git a/prediqo_mobile/ios/Runner/Info.plist b/prediqo_mobile/ios/Runner/Info.plist index 6b3668a7..4393e9d3 100644 --- a/prediqo_mobile/ios/Runner/Info.plist +++ b/prediqo_mobile/ios/Runner/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - Prediqo + Tloto CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - Prediqo + Tloto CFBundlePackageType APPL CFBundleShortVersionString diff --git a/prediqo_mobile/lib/app.dart b/prediqo_mobile/lib/app.dart index c73514ee..59d2138c 100644 --- a/prediqo_mobile/lib/app.dart +++ b/prediqo_mobile/lib/app.dart @@ -74,7 +74,7 @@ class _PrediqoAppState extends State { listenable: _localeController, builder: (context, _) { return MaterialApp.router( - title: 'Prediqo', + title: 'Tloto', debugShowCheckedModeBanner: false, theme: AppTheme.light, darkTheme: AppTheme.dark, diff --git a/prediqo_mobile/lib/core/realtime/game_socket_service.dart b/prediqo_mobile/lib/core/realtime/game_socket_service.dart index e9058662..09fda7f5 100644 --- a/prediqo_mobile/lib/core/realtime/game_socket_service.dart +++ b/prediqo_mobile/lib/core/realtime/game_socket_service.dart @@ -88,6 +88,22 @@ class GameSocketService { } } + /// Forces a fresh, verified reconnect regardless of [isConnected]. + /// + /// After the OS suspends the app in the background for a while (screen + /// lock, app switcher, etc.), the underlying socket can be silently closed + /// by the network/OS without ever firing `onDone`/`onError` — `_channel` + /// stays non-null so [isConnected] wrongly reports healthy. Call this on + /// app foreground-resume to guarantee a real, working connection instead of + /// possibly reusing a zombie one. + Future forceReconnect() async { + _reconnectAttempt = 0; + _disposeChannel(); + await connect(); + final interval = _subscribedInterval; + if (interval != null && isConnected) subscribe(interval); + } + void subscribe(int intervalMinutes) { _subscribedInterval = intervalMinutes; _send({'type': 'subscribe', 'intervalMinutes': intervalMinutes}); diff --git a/prediqo_mobile/lib/core/theme/app_theme.dart b/prediqo_mobile/lib/core/theme/app_theme.dart index 153892f0..d26779fa 100644 --- a/prediqo_mobile/lib/core/theme/app_theme.dart +++ b/prediqo_mobile/lib/core/theme/app_theme.dart @@ -5,7 +5,7 @@ import 'app_typography.dart'; export 'app_colors.dart'; -/// Material 3 themes for Prediqo — dark-first premium fintech aesthetic. +/// Material 3 themes for Tloto — dark-first premium fintech aesthetic. class AppTheme { static ThemeData get dark => _build(Brightness.dark); static ThemeData get light => _build(Brightness.light); diff --git a/prediqo_mobile/lib/data/models/candle_predict_instrument.dart b/prediqo_mobile/lib/data/models/candle_predict_instrument.dart index 306ab3f8..1c79d72d 100644 --- a/prediqo_mobile/lib/data/models/candle_predict_instrument.dart +++ b/prediqo_mobile/lib/data/models/candle_predict_instrument.dart @@ -1,6 +1,6 @@ /// Synthetic chart instrument for Candle Predict (display identity only). /// -/// OHLC always comes from the Prediqo backend — never from an external market. +/// OHLC always comes from the Tloto backend — never from an external market. /// Runtime values come from game config and are edited in web Catalog → Candle. class CandlePredictInstrument { const CandlePredictInstrument({ diff --git a/prediqo_mobile/lib/features/prediction/bloc/prediction_bloc.dart b/prediqo_mobile/lib/features/prediction/bloc/prediction_bloc.dart index e4e4f0fa..4af382cc 100644 --- a/prediqo_mobile/lib/features/prediction/bloc/prediction_bloc.dart +++ b/prediqo_mobile/lib/features/prediction/bloc/prediction_bloc.dart @@ -44,6 +44,7 @@ class PredictionBloc extends Bloc { on(_onOlderCandles); on(_onPaused); on(_onResumed); + on(_onAppResumed, transformer: _sequential()); on(_onBalancesRefresh); on((event, emit) { emit(state.copyWith(clearError: true, betPlaced: false)); @@ -180,6 +181,31 @@ class PredictionBloc extends Bloc { add(const PredictionLoadRequested()); } + /// True root fix for "countdown stuck until I leave and reopen the page": + /// mobile OSes suspend Dart `Timer`s and can silently drop the WebSocket + /// while backgrounded (screen lock, app switcher, incoming call, long time + /// on the page with the screen off) — none of which fires `onDone`, so + /// [GameSocketService.isConnected] keeps reporting healthy. Nothing was + /// listening for the app returning to the foreground, so the zombie + /// connection / disrupted poll schedule silently lingered until the user + /// manually left and reopened the prediction screen (which forces a fresh + /// `_onLoad`). Wiring [PredictionAppResumed] to `AppLifecycleState.resumed` + /// (see `_PredictionScreenState.didChangeAppLifecycleState`) closes that gap + /// without requiring any user action. + Future _onAppResumed( + PredictionAppResumed event, + Emitter emit, + ) async { + if (!_screenActive) return; + if (_socket.isEnabled) { + await _socket.forceReconnect(); + } + // Old recursive Timer chain may have been suspended mid-flight; restart + // it fresh instead of trusting whatever was already scheduled. + _startPolling(); + add(const PredictionRefreshTick(forceGameState: true)); + } + Future _onBalancesRefresh(PredictionBalancesRefreshRequested event, Emitter emit) async { final labels = await _loadBalances(state.gameState?.config.walletTypeCode); emit(state.copyWith( diff --git a/prediqo_mobile/lib/features/prediction/bloc/prediction_event.dart b/prediqo_mobile/lib/features/prediction/bloc/prediction_event.dart index 8a959f7f..8384ead2 100644 --- a/prediqo_mobile/lib/features/prediction/bloc/prediction_event.dart +++ b/prediqo_mobile/lib/features/prediction/bloc/prediction_event.dart @@ -138,6 +138,18 @@ class PredictionResumed extends PredictionEvent { const PredictionResumed(); } +/// Fired when the OS brings the app back to the foreground (screen unlock, +/// app switcher return, etc.) while already on the prediction screen. +/// +/// Unlike [PredictionResumed] (screen navigation), this does NOT trust that +/// the existing WebSocket connection / poll timer chain are still healthy: +/// mobile OSes routinely suspend timers and silently drop sockets while +/// backgrounded without ever firing `onDone`/`onError`, so `isConnected` can +/// stay (wrongly) true. This forces a verified-fresh reconnect + full resync. +class PredictionAppResumed extends PredictionEvent { + const PredictionAppResumed(); +} + /// Reload main / bonus / test wallet labels for the stake selector. class PredictionBalancesRefreshRequested extends PredictionEvent { const PredictionBalancesRefreshRequested(); diff --git a/prediqo_mobile/lib/features/prediction/presentation/prediction_screen.dart b/prediqo_mobile/lib/features/prediction/presentation/prediction_screen.dart index d1289abd..c6afaf8e 100644 --- a/prediqo_mobile/lib/features/prediction/presentation/prediction_screen.dart +++ b/prediqo_mobile/lib/features/prediction/presentation/prediction_screen.dart @@ -24,7 +24,7 @@ class PredictionScreen extends StatefulWidget { State createState() => _PredictionScreenState(); } -class _PredictionScreenState extends State { +class _PredictionScreenState extends State with WidgetsBindingObserver { late final PredictionBloc _bloc; Timer? _uiClock; @@ -37,15 +37,29 @@ class _PredictionScreenState extends State { _uiClock = Timer.periodic(const Duration(seconds: 1), (_) { if (mounted) setState(() {}); }); + WidgetsBinding.instance.addObserver(this); } @override void dispose() { + WidgetsBinding.instance.removeObserver(this); _uiClock?.cancel(); _bloc.add(const PredictionPaused()); super.dispose(); } + /// Screen navigation (`initState`/`dispose`) is NOT the only way this page's + /// timers/socket can go stale — the OS backgrounding the whole app (screen + /// lock, app switcher, phone call) while the user stays on this route is + /// far more common, especially over "several minutes". Force a verified + /// reconnect + full resync every time the app comes back to the foreground. + @override + void didChangeAppLifecycleState(AppLifecycleState state) { + if (state == AppLifecycleState.resumed) { + _bloc.add(const PredictionAppResumed()); + } + } + void _setHistoryFilters({String? wallet, String? status}) { _bloc.add(PredictionHistoryFilterChanged( walletFilter: wallet, diff --git a/prediqo_mobile/lib/features/share_cards/presentation/share_result_widgets.dart b/prediqo_mobile/lib/features/share_cards/presentation/share_result_widgets.dart index f3fbb7fb..0df2a344 100644 --- a/prediqo_mobile/lib/features/share_cards/presentation/share_result_widgets.dart +++ b/prediqo_mobile/lib/features/share_cards/presentation/share_result_widgets.dart @@ -102,13 +102,13 @@ class _ShareResultDialogState extends State<_ShareResultDialog> { : (payload.status ?? 'result'); final id = (payload.isWallet ? payload.transactionId : payload.betId) ?? 'x'; final shortId = id.length >= 8 ? id.substring(0, 8) : id; - final file = File('${dir.path}/prediqo-$tag-$shortId.png'); + final file = File('${dir.path}/tloto-$tag-$shortId.png'); await file.writeAsBytes(bytes.buffer.asUint8List()); await SharePlus.instance.share( ShareParams( files: [XFile(file.path)], text: payload.registerUrl.isNotEmpty ? payload.registerUrl : payload.verifyUrl, - subject: 'Prediqo', + subject: 'Tloto', ), ); } catch (_) { @@ -283,7 +283,7 @@ class _WalletCard extends StatelessWidget { }; return _CardShell( - title: 'Prediqo Wallet', + title: 'Tloto Wallet', accent: _accent, amountLine: '${payload.amountSignedDisplay ?? '0'} ${payload.assetSymbol ?? ''}', subtitle: opLabel, @@ -396,8 +396,8 @@ class _CardShell extends StatelessWidget { Expanded( child: Text( s.t( - 'Scan to verify · Authentic Prediqo result', - 'Scanner pour vérifier · Résultat Prediqo authentique', + 'Scan to verify · Authentic Tloto result', + 'Scanner pour vérifier · Résultat Tloto authentique', ), style: const TextStyle(color: Colors.white70, fontSize: 11), ), diff --git a/prediqo_mobile/lib/l10n/app_locale.dart b/prediqo_mobile/lib/l10n/app_locale.dart index 3875452a..18ca17e6 100644 --- a/prediqo_mobile/lib/l10n/app_locale.dart +++ b/prediqo_mobile/lib/l10n/app_locale.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:shared_preferences/shared_preferences.dart'; -/// Supported locales for the Prediqo mobile app. +/// Supported locales for the Tloto mobile app. class AppLocale { static const Locale english = Locale('en'); static const Locale french = Locale('fr'); diff --git a/prediqo_mobile/lib/l10n/app_strings.dart b/prediqo_mobile/lib/l10n/app_strings.dart index b6bacaa5..f9605921 100644 --- a/prediqo_mobile/lib/l10n/app_strings.dart +++ b/prediqo_mobile/lib/l10n/app_strings.dart @@ -10,7 +10,7 @@ class AppStrings { String t(String en, String fr) => isFr ? fr : en; // Brand - String get appName => 'Prediqo'; + String get appName => 'Tloto'; String get tagline => t( 'Premium prediction platform', 'Plateforme de prédiction premium', @@ -42,7 +42,7 @@ class AppStrings { 'Une plateforme de prédiction premium : règlement instantané, portefeuilles USDT sécurisés et réseau de parrainage.', ); String get welcomeGetStarted => t('Get started', 'Commencer'); - String get welcomeWhyTitle => t('Why Prediqo', 'Pourquoi Prediqo'); + String get welcomeWhyTitle => t('Why Tloto', 'Pourquoi Tloto'); String get welcomeWhyPredict => t( 'Live candle predictions with clear Short / Long outcomes.', 'Prédictions sur bougies en direct, résultats Short / Long clairs.', @@ -68,8 +68,8 @@ class AppStrings { String get signIn => t('Sign in', 'Connexion'); String get signUp => t('Create account', 'Créer un compte'); String get registerSubtitle => t( - 'Fill in your details to create your Prediqo account.', - 'Renseignez vos informations pour créer votre compte Prediqo.', + 'Fill in your details to create your Tloto account.', + 'Renseignez vos informations pour créer votre compte Tloto.', ); String get email => t('Email', 'E-mail'); String get emailRequired => t('Email *', 'E-mail *'); @@ -501,7 +501,7 @@ class AppStrings { 'Referral snapshot', 'Aperçu de votre parrainage', ); - String get howItWorks => t('How Prediqo works', 'Comment fonctionne Prediqo'); + String get howItWorks => t('How Tloto works', 'Comment fonctionne Tloto'); String get howItWorksSubtitle => t( 'Learn the rules, wallets, and prediction types', 'Règles, portefeuilles et types de prédiction', diff --git a/prediqo_mobile/lib/shared/widgets/prediqo_logo.dart b/prediqo_mobile/lib/shared/widgets/prediqo_logo.dart index 98c635b4..1bdedcee 100644 --- a/prediqo_mobile/lib/shared/widgets/prediqo_logo.dart +++ b/prediqo_mobile/lib/shared/widgets/prediqo_logo.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import '../../../core/theme/app_colors.dart'; -/// Prediqo brand mark (SVG/PNG asset) with optional wordmark. +/// Tloto brand mark (SVG/PNG asset) with optional wordmark. class PrediqoLogo extends StatelessWidget { const PrediqoLogo({ super.key, @@ -37,7 +37,7 @@ class PrediqoLogo extends StatelessWidget { mark, SizedBox(width: gap), Text( - 'Prediqo', + 'TLOTO', style: wordmarkStyle ?? Theme.of(context).textTheme.headlineMedium?.copyWith( fontWeight: FontWeight.w900, diff --git a/prediqo_mobile/pubspec.yaml b/prediqo_mobile/pubspec.yaml index 25cf81a1..3ef46637 100644 --- a/prediqo_mobile/pubspec.yaml +++ b/prediqo_mobile/pubspec.yaml @@ -1,5 +1,5 @@ name: prediqo_mobile -description: "Prediqo mobile app - prediction games and crypto wallet." +description: "Tloto mobile app - prediction games and crypto wallet." publish_to: 'none' version: 2.0.0+1 diff --git a/prediqo_mobile/test/e2e_app_flow_test.dart b/prediqo_mobile/test/e2e_app_flow_test.dart index 66af26a0..06f5d306 100644 --- a/prediqo_mobile/test/e2e_app_flow_test.dart +++ b/prediqo_mobile/test/e2e_app_flow_test.dart @@ -10,7 +10,7 @@ import 'support/e2e_fixtures.dart'; void main() { setUpAll(configureE2eTestEnvironment); - group('Prediqo mobile E2E (UI)', () { + group('Tloto mobile E2E (UI)', () { tearDown(() async { if (sl.isRegistered()) { await sl.reset(); diff --git a/prediqo_mobile/test/support/e2e_fixtures.dart b/prediqo_mobile/test/support/e2e_fixtures.dart index 69aff217..fd247c13 100644 --- a/prediqo_mobile/test/support/e2e_fixtures.dart +++ b/prediqo_mobile/test/support/e2e_fixtures.dart @@ -94,7 +94,7 @@ class E2eMockInterceptor extends Interceptor { { 'id': 'ad-1', 'placement': 'home_hero', - 'title': 'Welcome to Prediqo', + 'title': 'Welcome to Tloto', 'subtitle': 'Predict candle direction', 'ctaLabel': 'Play', 'linkUrl': '/predict', @@ -404,7 +404,7 @@ class FakeAdvertisementRepository implements AdvertisementRepository { AdvertisementModel( id: 'ad-1', placement: 'home_hero', - title: 'Welcome to Prediqo', + title: 'Welcome to Tloto', subtitle: 'Predict candle direction', ctaLabel: 'Play', linkUrl: '/predict', diff --git a/prediqo_mobile/test/widget_test.dart b/prediqo_mobile/test/widget_test.dart index 1b7ea0b6..9e16db9c 100644 --- a/prediqo_mobile/test/widget_test.dart +++ b/prediqo_mobile/test/widget_test.dart @@ -17,7 +17,7 @@ void main() { } }); - testWidgets('Login screen shows Prediqo branding', (tester) async { + testWidgets('Login screen shows Tloto branding', (tester) async { await setupE2eDependencies(loggedIn: false); final authBloc = sl(); await tester.pumpWidget( @@ -26,7 +26,7 @@ void main() { ), ); await e2ePump(tester); - expect(find.text('Prediqo'), findsOneWidget); + expect(find.text('Tloto'), findsOneWidget); expect(find.byKey(const Key('login_email')), findsOneWidget); }); diff --git a/prediqo_mobile/web/index.html b/prediqo_mobile/web/index.html index 62ec92c9..b903a596 100644 --- a/prediqo_mobile/web/index.html +++ b/prediqo_mobile/web/index.html @@ -18,18 +18,18 @@ - + - + - Prediqo + Tloto diff --git a/prediqo_mobile/web/manifest.json b/prediqo_mobile/web/manifest.json index 463c6646..e9f31de4 100644 --- a/prediqo_mobile/web/manifest.json +++ b/prediqo_mobile/web/manifest.json @@ -1,11 +1,11 @@ { - "name": "Prediqo", - "short_name": "Prediqo", + "name": "Tloto", + "short_name": "Tloto", "start_url": ".", "display": "standalone", "background_color": "#0B0F1A", "theme_color": "#10B981", - "description": "Prediqo — premium prediction games and crypto wallet.", + "description": "Tloto — premium prediction games and crypto wallet.", "orientation": "portrait-primary", "prefer_related_applications": false, "icons": [ diff --git a/prediqo_web/README.md b/prediqo_web/README.md index ad76bb00..0ccfcf02 100644 --- a/prediqo_web/README.md +++ b/prediqo_web/README.md @@ -1,6 +1,6 @@ -## Prediqo Web +## Tloto Web -Application web React (TypeScript + Vite) pour **Prediqo** — plateforme de jeux de prédiction avec paiements en cryptomonnaies. +Application web React (TypeScript + Vite) pour **Tloto** — plateforme de jeux de prédiction avec paiements en cryptomonnaies. Le web regroupe deux grands modules (en cours d’extension) : - **Platform** : gestion admin (utilisateurs, paramètres, overview, etc.) diff --git a/prediqo_web/index.html b/prediqo_web/index.html index 5c842172..bd408aa1 100644 --- a/prediqo_web/index.html +++ b/prediqo_web/index.html @@ -7,7 +7,7 @@ - Prediqo + Tloto
diff --git a/prediqo_web/public/brand/prediqo-lockup.svg b/prediqo_web/public/brand/prediqo-lockup.svg index a507a40d..31d1fe37 100644 --- a/prediqo_web/public/brand/prediqo-lockup.svg +++ b/prediqo_web/public/brand/prediqo-lockup.svg @@ -1,4 +1,4 @@ - + @@ -8,5 +8,5 @@ - Prediqo + TLOTO diff --git a/prediqo_web/public/brand/prediqo-mark.svg b/prediqo_web/public/brand/prediqo-mark.svg index cba7c7c1..b3954608 100644 --- a/prediqo_web/public/brand/prediqo-mark.svg +++ b/prediqo_web/public/brand/prediqo-mark.svg @@ -1,4 +1,4 @@ - + diff --git a/prediqo_web/public/favicon.svg b/prediqo_web/public/favicon.svg index ea13393f..481f3b4c 100644 --- a/prediqo_web/public/favicon.svg +++ b/prediqo_web/public/favicon.svg @@ -1,4 +1,4 @@ - + diff --git a/prediqo_web/src/app/App.tsx b/prediqo_web/src/app/App.tsx index 5a443be9..89e799fc 100644 --- a/prediqo_web/src/app/App.tsx +++ b/prediqo_web/src/app/App.tsx @@ -1,6 +1,6 @@ /** * Root application component and global provider composition. - * Wires React Query, authentication, MUI theme, and routing for Prediqo web. + * Wires React Query, authentication, MUI theme, and routing for Tloto web. */ import { CssBaseline, ThemeProvider } from '@mui/material'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; diff --git a/prediqo_web/src/features/auth/LoginPage.tsx b/prediqo_web/src/features/auth/LoginPage.tsx index c30d4b32..3938d765 100644 --- a/prediqo_web/src/features/auth/LoginPage.tsx +++ b/prediqo_web/src/features/auth/LoginPage.tsx @@ -1,5 +1,5 @@ /** - * Login page for the Prediqo web app (platform admin and player access). + * Login page for the Tloto web app (platform admin and player access). * Authenticates via `/api/v1/auth/login`, stores tokens in auth context, * and redirects to the route the user attempted before sign-in. */ diff --git a/prediqo_web/src/features/profile/ProfilePage.tsx b/prediqo_web/src/features/profile/ProfilePage.tsx index 4968663e..f40afd80 100644 --- a/prediqo_web/src/features/profile/ProfilePage.tsx +++ b/prediqo_web/src/features/profile/ProfilePage.tsx @@ -1,5 +1,5 @@ /** - * User profile page for Prediqo web. + * User profile page for Tloto web. * Displays account information and self-service edits for personal data, password, and 2FA. */ import { diff --git a/prediqo_web/src/features/share-cards/ShareResultCard.tsx b/prediqo_web/src/features/share-cards/ShareResultCard.tsx index 233ec619..7c5cdbc5 100644 --- a/prediqo_web/src/features/share-cards/ShareResultCard.tsx +++ b/prediqo_web/src/features/share-cards/ShareResultCard.tsx @@ -108,7 +108,7 @@ function WalletOpCard({ const created = new Date(payload.createdAt); return ( - + - Prediqo + {PLATFORM_WORDMARK} ) : null} diff --git a/prediqo_web/src/shared/brand/platformName.ts b/prediqo_web/src/shared/brand/platformName.ts new file mode 100644 index 00000000..bc5fbfae --- /dev/null +++ b/prediqo_web/src/shared/brand/platformName.ts @@ -0,0 +1,5 @@ +/** Official platform name shown in UI, emails, and share surfaces. */ +export const PLATFORM_NAME = 'Tloto'; + +/** Wordmark / lockup spelling used next to the brand mark. */ +export const PLATFORM_WORDMARK = 'TLOTO'; diff --git a/prediqo_web/src/shared/i18n/index.ts b/prediqo_web/src/shared/i18n/index.ts index be9985e5..e2c9aa68 100644 --- a/prediqo_web/src/shared/i18n/index.ts +++ b/prediqo_web/src/shared/i18n/index.ts @@ -1,5 +1,5 @@ /** - * i18n bootstrap — English and French for the Prediqo web app. + * i18n bootstrap — English and French for the Tloto web app. */ import i18n from 'i18next'; import { initReactI18next } from 'react-i18next'; diff --git a/prediqo_web/src/shared/i18n/locales/en.ts b/prediqo_web/src/shared/i18n/locales/en.ts index 8c454727..079062f9 100644 --- a/prediqo_web/src/shared/i18n/locales/en.ts +++ b/prediqo_web/src/shared/i18n/locales/en.ts @@ -104,7 +104,7 @@ export const en = { captchaMathLabel: 'Security check: {{prompt}}', captchaMathHelper: 'Enter the result to continue after several failed attempts.', resendFailed: 'Failed to resend verification email', - registerSubtitle: "Join Prediqo — use a friend's referral link or sign up directly.", + registerSubtitle: "Join Tloto — use a friend's referral link or sign up directly.", invitedWithCode: 'You were invited with referral code {{code}}.', fullName: 'Full name', fullNameRequired: 'Full name *', @@ -178,7 +178,7 @@ export const en = { setupComplete: 'Setup complete', adminExists: 'An administrator account already exists. Sign in to access the platform.', goToLogin: 'Go to sign in', - title: 'Prediqo setup', + title: 'Tloto setup', subtitle: 'Create the first administrator account to configure the platform in production.', tokenEnvWarning: 'Set the INITIAL_SETUP_TOKEN environment variable on the server (min. 16 random characters), then restart the API.', @@ -263,11 +263,11 @@ export const en = { modeSingle: 'Single candle', modeMulti: 'Multi candle', verifyTitle: 'Scan to verify', - verifyHint: 'Authentic Prediqo result', - verifyPageTitle: 'Verified Prediqo share', - verifyAuthentic: 'This Prediqo share is authentic.', + verifyHint: 'Authentic Tloto result', + verifyPageTitle: 'Verified Tloto share', + verifyAuthentic: 'This Tloto share is authentic.', verifyInvalid: 'This share link is invalid or no longer available.', - joinCta: 'Join Prediqo', + joinCta: 'Join Tloto', operation: 'Operation', amount: 'Amount', asset: 'Asset', @@ -341,7 +341,7 @@ export const en = { }, transferDialog: { title: 'Send to user', - subtitle: 'Transfer to another Prediqo account instantly. On-chain fees do not apply.', + subtitle: 'Transfer to another Tloto account instantly. On-chain fees do not apply.', recipientEmail: 'Recipient email', networkAuto: 'Network: {{network}} (auto-selected)', available: 'Available: {{amount}}', @@ -935,7 +935,7 @@ export const en = { support: { widget: { ariaLabel: 'Support', - title: 'Prediqo Support', + title: 'Tloto Support', subtitle: 'Real-time response from our team', }, chat: { @@ -1453,7 +1453,7 @@ export const en = { 'Synthetic candles are generated from player stake pools — no real market data. Interval-specific overrides are managed below; empty fields inherit these defaults.', instrumentTitle: 'Chart instrument', instrumentIntro: - 'Display-only branding for the candlestick chart. This is a synthetic Prediqo instrument — not a real market pair. Candles still come from the game engine.', + 'Display-only branding for the candlestick chart. This is a synthetic Tloto instrument — not a real market pair. Candles still come from the game engine.', instrumentSymbol: 'Symbol', instrumentSymbolHint: 'Short ticker shown on the chart (e.g. FO)', instrumentDisplayName: 'Full name', diff --git a/prediqo_web/src/shared/i18n/locales/fr.ts b/prediqo_web/src/shared/i18n/locales/fr.ts index dca3e16c..3df8bcf9 100644 --- a/prediqo_web/src/shared/i18n/locales/fr.ts +++ b/prediqo_web/src/shared/i18n/locales/fr.ts @@ -106,7 +106,7 @@ export const fr = { captchaMathHelper: 'Saisissez le résultat pour continuer après plusieurs échecs.', resendFailed: 'Échec de l’envoi de l’e-mail de vérification', registerSubtitle: - 'Rejoignez Prediqo — utilisez le lien de parrainage d’un ami ou inscrivez-vous directement.', + 'Rejoignez Tloto — utilisez le lien de parrainage d’un ami ou inscrivez-vous directement.', invitedWithCode: 'Vous avez été invité avec le code de parrainage {{code}}.', fullName: 'Nom complet', fullNameRequired: 'Nom complet *', @@ -183,7 +183,7 @@ export const fr = { adminExists: 'Un compte administrateur existe déjà. Connectez-vous pour accéder à la plateforme.', goToLogin: 'Aller à la connexion', - title: 'Initialisation Prediqo', + title: 'Initialisation Tloto', subtitle: 'Créez le premier compte administrateur pour configurer la plateforme en production.', tokenEnvWarning: @@ -270,11 +270,11 @@ export const fr = { modeSingle: 'Single candle', modeMulti: 'Multi candle', verifyTitle: 'Scanner pour vérifier', - verifyHint: 'Résultat Prediqo authentique', - verifyPageTitle: 'Partage Prediqo vérifié', - verifyAuthentic: 'Ce partage Prediqo est authentique.', + verifyHint: 'Résultat Tloto authentique', + verifyPageTitle: 'Partage Tloto vérifié', + verifyAuthentic: 'Ce partage Tloto est authentique.', verifyInvalid: 'Ce lien de partage est invalide ou n’est plus disponible.', - joinCta: 'Rejoindre Prediqo', + joinCta: 'Rejoindre Tloto', operation: 'Opération', amount: 'Montant', asset: 'Actif', @@ -349,7 +349,7 @@ export const fr = { }, transferDialog: { title: 'Envoyer à un utilisateur', - subtitle: 'Transférez vers un autre compte Prediqo instantanément. Pas de frais on-chain.', + subtitle: 'Transférez vers un autre compte Tloto instantanément. Pas de frais on-chain.', recipientEmail: 'E-mail du destinataire', networkAuto: 'Réseau : {{network}} (sélection automatique)', available: 'Disponible : {{amount}}', @@ -949,7 +949,7 @@ export const fr = { support: { widget: { ariaLabel: 'Assistance', - title: 'Assistance Prediqo', + title: 'Assistance Tloto', subtitle: 'Réponse en temps réel de notre équipe', }, chat: { @@ -1469,7 +1469,7 @@ export const fr = { 'Les bougies synthétiques sont générées à partir des mises des joueurs — pas de données de marché réelles. Les dérogations par intervalle se gèrent ci-dessous ; les champs vides héritent de ces valeurs par défaut.', instrumentTitle: 'Instrument du graphique', instrumentIntro: - 'Identité affichée sur le graphique en chandeliers. Instrument synthétique Prediqo — pas une paire de marché réelle. Les bougies viennent toujours du moteur de jeu.', + 'Identité affichée sur le graphique en chandeliers. Instrument synthétique Tloto — pas une paire de marché réelle. Les bougies viennent toujours du moteur de jeu.', instrumentSymbol: 'Symbole', instrumentSymbolHint: 'Ticker court affiché sur le graphique (ex. FO)', instrumentDisplayName: 'Nom complet', @@ -1624,7 +1624,7 @@ export const fr = { gasOk: 'suffisant pour les retraits', gasLow: 'sous le minimum {{min}} {{symbol}} — rechargez avant les retraits', gasHint: - 'Le gas natif (BNB / TRX) n’est pas un solde ledger Prediqo. Il reste on-chain sur le hot wallet et est vérifié en direct avant chaque retrait. Historique : lien explorateur.', + 'Le gas natif (BNB / TRX) n’est pas un solde ledger Tloto. Il reste on-chain sur le hot wallet et est vérifié en direct avant chaque retrait. Historique : lien explorateur.', gasTransferTitle: 'Déplacer le gas entre Hot et Cold', gasTransferSubtitle: 'Alimentez le cold en BNB ou TRX depuis le hot (ou l’inverse) sans passer par un exchange. Hot → Cold est signé par la plateforme après approbation. Cold → Hot est envoyé depuis MetaMask, puis confirmé ici.', diff --git a/prediqo_web/src/shared/layout/AppShell.tsx b/prediqo_web/src/shared/layout/AppShell.tsx index d3537f35..418eb5a4 100644 --- a/prediqo_web/src/shared/layout/AppShell.tsx +++ b/prediqo_web/src/shared/layout/AppShell.tsx @@ -1,5 +1,5 @@ /** - * Authenticated application layout for the Prediqo web app. + * Authenticated application layout for the Tloto web app. * Renders responsive navigation, header actions, and nested route content. */ import {