refactor: migrate fully to Supabase, remove Firebase/Render/Python backend
- DELETED: entire backend/ (Python/FastAPI — replaced by Supabase)
- DELETED: old/ directory (obsolete code)
- DELETED: render.yaml, inject_api.py, check_tags.py, PENDING_FOR_TOMORROW.md
- DELETED: frontend/src/firebaseConfig.ts (Firebase Auth replaced by Supabase Auth)
- DELETED: frontend/src/services/apiClient.ts (HTTP client for dead backend)
- MIGRATED services to Supabase native:
schedulesService, favoritesService, usersService,
telemetryService (stub), reportsService, analyticsService (stub)
- MIGRATED stores/favorites.ts to Supabase direct queries
- MIGRATED views: SplashScreen, AdminTaxis, AdminDrivers, StrategicAnalytics
- MIGRATED utils/imageUrl.ts to Supabase Storage URLs
- FIXED router/index.ts: guard now uses supabase.auth.getSession()
instead of old localStorage auth_token (fixes logout + map loading)
- FIXED AuthView.vue: removed aggressive watch({ immediate: true })
that caused wrong redirects on map route
- FIXED SplashScreen.vue: navigate() now reads Supabase session + role
- FIXED RLS: added INSERT policy on public.users for trigger
- CONFIRMED: admin@sibu.com assigned ADMIN role in Supabase
This commit is contained in:
@ -1,22 +1,9 @@
|
||||
import { apiClient } from './apiClient'
|
||||
|
||||
export interface AnalyticsEvent {
|
||||
event_name: 'app_open' | 'screen_view' | 'route_selected' | 'stop_selected' | 'schedule_viewed' | 'reminder_created' | 'promo_view' | 'promo_click' | 'taxi_view' | 'taxi_click' | 'shuttle_view' | 'shuttle_contact' | 'business_view' | 'business_contact' | 'login' | 'sign_up'
|
||||
screen_name?: string
|
||||
item_id?: string
|
||||
properties?: Record<string, any>
|
||||
}
|
||||
|
||||
/** analyticsService — stub. Analytics via Supabase can be implemented in v3 */
|
||||
export const analyticsService = {
|
||||
logEvent(event: AnalyticsEvent) {
|
||||
// Log asynchronously without awaiting to avoid blocking UI
|
||||
apiClient.post('/api/analytics/event', event).catch(error => {
|
||||
console.warn('Analytics capture failed:', error)
|
||||
})
|
||||
logEvent(_event: { event_name: string; properties?: Record<string, any> }) {
|
||||
// no-op
|
||||
},
|
||||
|
||||
async getStats() {
|
||||
const response = await apiClient.get('/api/analytics/dashboard/stats')
|
||||
return response.data
|
||||
async getDashboardStats() {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user