feat: implement Iteration 0 foundation (backend + Flutter client)

Backend (Go):
- Project structure with chi router, pgxpool, goose migrations
- JWT auth (access/refresh tokens) with Firebase token verification
- NoopTokenVerifier for local dev without Firebase credentials
- PostgreSQL user repository with atomic profile updates (transactions)
- Mifflin-St Jeor calorie calculation based on profile data
- REST API: POST /auth/login, /auth/refresh, /auth/logout, GET/PUT /profile, GET /health
- Middleware: auth, CORS (localhost wildcard), logging, recovery, request_id
- Unit tests (51 passing) and integration tests (testcontainers)
- Docker Compose setup with postgres healthcheck and graceful shutdown

Flutter client:
- Riverpod state management with GoRouter navigation
- Firebase Auth (email/password + Google sign-in with web popup support)
- Platform-aware API URLs (web/Android/iOS)
- Dio HTTP client with JWT auth interceptor and concurrent refresh handling
- Secure token storage
- Screens: Login, Register, Home (tabs: Menu, Recipes, Products, Profile)
- Unit tests (17 passing)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
dbastrikin
2026-02-20 13:14:58 +02:00
commit 24219b611e
140 changed files with 13062 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
return web;
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.iOS:
return ios;
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
}
// Web config — from Firebase Console → Project Settings → Your apps → Web
static const FirebaseOptions web = FirebaseOptions(
apiKey: 'AIzaSyA9m_zlnQP3T9x0_AZGi5yYH-NQ9C1uPqc',
authDomain: 'food-ai-efd52.firebaseapp.com',
projectId: 'food-ai-efd52',
storageBucket: 'food-ai-efd52.firebasestorage.app',
messagingSenderId: '844967109320',
appId: '1:844967109320:web:3a1c6307a6d14810fdbbfd',
measurementId: 'G-PNKBVM3PDN',
);
// TODO: заполнить после добавления Android-приложения в Firebase Console
static const FirebaseOptions android = FirebaseOptions(
apiKey: 'YOUR_ANDROID_API_KEY',
appId: 'YOUR_ANDROID_APP_ID',
messagingSenderId: '844967109320',
projectId: 'food-ai-efd52',
storageBucket: 'food-ai-efd52.firebasestorage.app',
);
// TODO: заполнить после добавления iOS-приложения в Firebase Console
static const FirebaseOptions ios = FirebaseOptions(
apiKey: 'YOUR_IOS_API_KEY',
appId: 'YOUR_IOS_APP_ID',
messagingSenderId: '844967109320',
projectId: 'food-ai-efd52',
storageBucket: 'food-ai-efd52.firebasestorage.app',
iosBundleId: 'com.foodai.foodAi',
);
}