Kin: personal relationships app — server (cadence/due/migrations) + Expo Android app
Some checks failed
Build & Release APK / build (push) Failing after 13s

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-09 00:49:45 -07:00
commit ac0b82e6a0
101 changed files with 11534 additions and 0 deletions

32
app/src/lib/config.ts Normal file
View File

@@ -0,0 +1,32 @@
import AsyncStorage from "@react-native-async-storage/async-storage";
export const DEFAULT_URL = "https://crm.rehbock.xyz/api";
const KEYS = { url: "kin_api_url", token: "kin_api_token", hour: "kin_notif_hour" };
let cached: { url: string; token: string; notifHour: number } | null = null;
export async function getConfig() {
if (cached) return cached;
const [url, token, hour] = await Promise.all([
AsyncStorage.getItem(KEYS.url),
AsyncStorage.getItem(KEYS.token),
AsyncStorage.getItem(KEYS.hour),
]);
cached = {
url: url || DEFAULT_URL,
token: token || "",
notifHour: hour ? Number(hour) : 9,
};
return cached;
}
export async function setConfig(url: string, token: string, notifHour: number) {
const cleanUrl = (url.trim() || DEFAULT_URL).replace(/\/+$/, "");
cached = { url: cleanUrl, token: token.trim(), notifHour };
await Promise.all([
AsyncStorage.setItem(KEYS.url, cleanUrl),
AsyncStorage.setItem(KEYS.token, cached.token),
AsyncStorage.setItem(KEYS.hour, String(notifHour)),
]);
}