feat: scaffold offline-first mobile app (RN+Expo, expo-sqlite)

Capa API tipada de los 8 endpoints, BD local espejo del bundle + outbox
(operaciones y media) + cursor de sync, motor runSync (PUSH /sync ->
PUSH /media -> PULL bundle?since) con idempotencia por uuid y last-write-wins,
mutaciones de alto nivel (write local + encolar), sesion con token en
SecureStore, conectividad NetInfo y UI minima (Login -> Proyectos -> Detalle).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
javier
2026-06-18 17:43:48 +02:00
co-authored by Claude Opus 4.8
parent 3f454b59a5
commit 4e9c7d059f
27 changed files with 9057 additions and 20 deletions
+21
View File
@@ -0,0 +1,21 @@
/**
* Estado de conectividad. Hook reactivo + comprobación puntual.
*/
import NetInfo from '@react-native-community/netinfo';
import { useEffect, useState } from 'react';
export function useIsOnline(): boolean {
const [online, setOnline] = useState(true);
useEffect(() => {
const unsubscribe = NetInfo.addEventListener((state) => {
setOnline(Boolean(state.isConnected && state.isInternetReachable !== false));
});
return unsubscribe;
}, []);
return online;
}
export async function isOnline(): Promise<boolean> {
const state = await NetInfo.fetch();
return Boolean(state.isConnected && state.isInternetReachable !== false);
}