diff --git a/mobile/app.json b/mobile/app.json
index 281cb08..23d3c22 100644
--- a/mobile/app.json
+++ b/mobile/app.json
@@ -25,6 +25,10 @@
"web": {
"favicon": "./assets/favicon.png"
},
- "plugins": ["expo-router", "expo-secure-store"]
+ "plugins": [
+ "expo-router",
+ "expo-secure-store",
+ "expo-font"
+ ]
}
}
diff --git a/mobile/app/(app)/index.tsx b/mobile/app/(app)/index.tsx
index 75609de..6d4d691 100644
--- a/mobile/app/(app)/index.tsx
+++ b/mobile/app/(app)/index.tsx
@@ -1,7 +1,10 @@
-import { View, Text, Pressable, StyleSheet, ActivityIndicator } from "react-native";
+import { View, Text, StyleSheet, ActivityIndicator } from "react-native";
import { useQuery } from "@tanstack/react-query";
import { useAuth, useUser } from "@clerk/expo";
import { useTRPC } from "../../src/api/trpc";
+import { Button } from "../../src/components/Button";
+import { Card } from "../../src/components/Card";
+import { colors, typography } from "../../src/theme/tokens";
/**
* Placeholder home screen — its only job right now is to prove the mobile
@@ -19,32 +22,34 @@ export default function HomeScreen() {
Angemeldet als {user?.primaryEmailAddress?.emailAddress}
-
+
Backend-Verbindung
- {isLoading && }
+ {isLoading && }
{error && {error.message}}
{data && (
<>
- Owner: {data.ownerCount}
- Pets: {data.petCount}
- Sponsoren: {data.sponsorCount}
+ Owner: {data.ownerCount}
+ Pets: {data.petCount}
+ Sponsoren: {data.sponsorCount}
>
)}
-
+
- signOut()}>
- Abmelden
-
+
);
}
const styles = StyleSheet.create({
- container: { flex: 1, padding: 24, gap: 16, paddingTop: 64 },
- title: { fontSize: 18, fontWeight: "600" },
- card: { borderWidth: 1, borderColor: "#e5e7eb", borderRadius: 12, padding: 16, gap: 4 },
- cardTitle: { fontWeight: "600", marginBottom: 8 },
- error: { color: "#dc2626" },
- button: { backgroundColor: "#111827", borderRadius: 8, padding: 14, alignItems: "center" },
- buttonText: { color: "#fff", fontWeight: "600" },
+ container: {
+ flex: 1,
+ padding: 24,
+ gap: 16,
+ paddingTop: 64,
+ backgroundColor: colors.porchWhite,
+ },
+ title: { ...typography.title },
+ cardTitle: { ...typography.label, marginBottom: 4 },
+ cardBody: { ...typography.body },
+ error: { ...typography.body, color: colors.alertRed },
});
diff --git a/mobile/app/(auth)/sign-in.tsx b/mobile/app/(auth)/sign-in.tsx
index 9919d2b..de1ea25 100644
--- a/mobile/app/(auth)/sign-in.tsx
+++ b/mobile/app/(auth)/sign-in.tsx
@@ -1,7 +1,10 @@
import { useState } from "react";
-import { View, Text, TextInput, Pressable, StyleSheet } from "react-native";
+import { View, Text, StyleSheet } from "react-native";
import { useSignIn } from "@clerk/expo";
import { useRouter } from "expo-router";
+import { Button } from "../../src/components/Button";
+import { TextField } from "../../src/components/TextField";
+import { colors, typography } from "../../src/theme/tokens";
/**
* Minimal email/password sign-in — enough to prove the Clerk <-> backend
@@ -11,14 +14,30 @@ import { useRouter } from "expo-router";
* Uses Clerk's newer "Futures" API (signIn.password()/signIn.finalize()) —
* the classic signIn.create()/setActive() pattern from older Clerk docs
* doesn't exist on the installed @clerk/expo version. See AGENTS.md.
+ *
+ * Handles the `needs_client_trust` status: Clerk's Device Trust feature
+ * (tied to the dashboard's Native Applications API) requires an email-code
+ * check the first time a device signs in, separate from any account-level
+ * MFA setting — see signIn.mfa.sendEmailCode()/verifyEmailCode() below.
*/
export default function SignInScreen() {
const { signIn, fetchStatus } = useSignIn();
const router = useRouter();
const [emailAddress, setEmailAddress] = useState("");
const [password, setPassword] = useState("");
+ const [code, setCode] = useState("");
+ const [step, setStep] = useState<"credentials" | "verify-device">("credentials");
const [error, setError] = useState(null);
+ const finalizeIfComplete = async () => {
+ if (signIn.status !== "complete") {
+ setError(`Anmeldung unvollständig — Status: ${signIn.status}`);
+ return;
+ }
+ await signIn.finalize();
+ router.replace("/(app)");
+ };
+
const onSignInPress = async () => {
setError(null);
const { error: signInError } = await signIn.password({ identifier: emailAddress, password });
@@ -26,49 +45,85 @@ export default function SignInScreen() {
setError(signInError.longMessage ?? signInError.message);
return;
}
- if (signIn.status !== "complete") {
- setError("Anmeldung unvollständig — weitere Schritte erforderlich.");
+
+ if (signIn.status === "needs_client_trust") {
+ const { error: sendError } = await signIn.mfa.sendEmailCode();
+ if (sendError) {
+ setError(sendError.longMessage ?? sendError.message);
+ return;
+ }
+ setStep("verify-device");
return;
}
- await signIn.finalize();
- router.replace("/(app)");
+
+ await finalizeIfComplete();
};
+ const onVerifyPress = async () => {
+ setError(null);
+ const { error: verifyError } = await signIn.mfa.verifyEmailCode({ code });
+ if (verifyError) {
+ setError(verifyError.longMessage ?? verifyError.message);
+ return;
+ }
+ await finalizeIfComplete();
+ };
+
+ if (step === "verify-device") {
+ return (
+
+ Gerät bestätigen
+
+ Wir haben einen Code an {emailAddress} geschickt, um dieses Gerät zu bestätigen.
+
+
+ {error ? {error} : null}
+
+
+ );
+ }
+
return (
PawFeed Login
-
-
{error ? {error} : null}
-
- Anmelden
-
+ />
);
}
const styles = StyleSheet.create({
- container: { flex: 1, justifyContent: "center", padding: 24, gap: 12 },
- title: { fontSize: 24, fontWeight: "600", marginBottom: 16 },
- input: { borderWidth: 1, borderColor: "#ccc", borderRadius: 8, padding: 12 },
- error: { color: "#dc2626" },
- button: { backgroundColor: "#111827", borderRadius: 8, padding: 14, alignItems: "center" },
- buttonText: { color: "#fff", fontWeight: "600" },
+ container: {
+ flex: 1,
+ justifyContent: "center",
+ padding: 24,
+ gap: 12,
+ backgroundColor: colors.porchWhite,
+ },
+ title: { ...typography.headline, marginBottom: 16 },
+ hint: { ...typography.body, color: colors.quietGray, marginBottom: 8 },
+ error: { ...typography.body, color: colors.alertRed },
});
diff --git a/mobile/app/_layout.tsx b/mobile/app/_layout.tsx
index 693cf2d..d6db1b3 100644
--- a/mobile/app/_layout.tsx
+++ b/mobile/app/_layout.tsx
@@ -1,11 +1,20 @@
import { useEffect, useMemo, useState } from "react";
+import { ActivityIndicator, View } from "react-native";
import { Slot, useRouter, useSegments } from "expo-router";
-import { ClerkProvider, ClerkLoaded, useAuth } from "@clerk/expo";
+import { ClerkProvider, useAuth } from "@clerk/expo";
import { SafeAreaProvider } from "react-native-safe-area-context";
import { QueryClientProvider } from "@tanstack/react-query";
+import {
+ useFonts,
+ Inter_400Regular,
+ Inter_600SemiBold,
+ Inter_700Bold,
+ Inter_800ExtraBold,
+} from "@expo-google-fonts/inter";
import { secureTokenCache } from "../src/lib/tokenCache";
import { env } from "../src/lib/env";
import { TRPCProvider, createMobileTRPCClient, makeQueryClient } from "../src/api/trpc";
+import { colors } from "../src/theme/tokens";
/**
* Redirects between the (auth) and (app) route groups based on Clerk's
@@ -44,8 +53,22 @@ function ApiProviders({ children }: { children: React.ReactNode }) {
);
}
+function LoadingScreen() {
+ return (
+
+
+
+ );
+}
+
function InitialLayout() {
+ const { isLoaded } = useAuth();
useProtectedRoute();
+
+ if (!isLoaded) {
+ return ;
+ }
+
return (
@@ -54,13 +77,22 @@ function InitialLayout() {
}
export default function RootLayout() {
+ const [fontsLoaded] = useFonts({
+ Inter_400Regular,
+ Inter_600SemiBold,
+ Inter_700Bold,
+ Inter_800ExtraBold,
+ });
+
+ if (!fontsLoaded) {
+ return ;
+ }
+
return (
-
-
-
-
-
+
+
+
);
}
diff --git a/mobile/package-lock.json b/mobile/package-lock.json
index b763feb..27ef7df 100644
--- a/mobile/package-lock.json
+++ b/mobile/package-lock.json
@@ -9,16 +9,19 @@
"version": "1.0.0",
"dependencies": {
"@clerk/expo": "^4.6.1",
+ "@expo-google-fonts/inter": "^0.4.2",
"@tanstack/react-query": "5.101.0",
"@trpc/client": "11.17.0",
"@trpc/tanstack-react-query": "11.17.0",
"expo": "~57.0.18",
"expo-constants": "~57.0.16",
+ "expo-font": "~57.0.3",
"expo-linking": "~57.0.8",
"expo-router": "^5.1.11",
"expo-secure-store": "~57.0.2",
"expo-status-bar": "~57.0.1",
"react": "19.2.3",
+ "react-dom": "19.2.3",
"react-native": "0.86.3",
"react-native-safe-area-context": "~5.7.0",
"react-native-screens": "~4.26.0"
@@ -1295,6 +1298,12 @@
"viem": "^2.27.2"
}
},
+ "node_modules/@expo-google-fonts/inter": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmjs.org/@expo-google-fonts/inter/-/inter-0.4.2.tgz",
+ "integrity": "sha512-syfiImMaDmq7cFi0of+waE2M4uSCyd16zgyWxdPOY7fN2VBmSLKEzkfbZgeOjJq61kSqPBNNtXjggiQiSD6gMQ==",
+ "license": "MIT AND OFL-1.1"
+ },
"node_modules/@expo/code-signing-certificates": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/@expo/code-signing-certificates/-/code-signing-certificates-0.0.6.tgz",
@@ -8254,16 +8263,15 @@
}
},
"node_modules/react-dom": {
- "version": "19.2.8",
- "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.8.tgz",
- "integrity": "sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ==",
+ "version": "19.2.3",
+ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz",
+ "integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==",
"license": "MIT",
- "peer": true,
"dependencies": {
"scheduler": "^0.27.0"
},
"peerDependencies": {
- "react": "^19.2.8"
+ "react": "^19.2.3"
}
},
"node_modules/react-fast-compare": {
diff --git a/mobile/package.json b/mobile/package.json
index 06bec23..13e8697 100644
--- a/mobile/package.json
+++ b/mobile/package.json
@@ -4,16 +4,19 @@
"main": "expo-router/entry",
"dependencies": {
"@clerk/expo": "^4.6.1",
+ "@expo-google-fonts/inter": "^0.4.2",
"@tanstack/react-query": "5.101.0",
"@trpc/client": "11.17.0",
"@trpc/tanstack-react-query": "11.17.0",
"expo": "~57.0.18",
"expo-constants": "~57.0.16",
+ "expo-font": "~57.0.3",
"expo-linking": "~57.0.8",
"expo-router": "^5.1.11",
"expo-secure-store": "~57.0.2",
"expo-status-bar": "~57.0.1",
"react": "19.2.3",
+ "react-dom": "19.2.3",
"react-native": "0.86.3",
"react-native-safe-area-context": "~5.7.0",
"react-native-screens": "~4.26.0"
diff --git a/mobile/src/components/Button.tsx b/mobile/src/components/Button.tsx
new file mode 100644
index 0000000..5542d8c
--- /dev/null
+++ b/mobile/src/components/Button.tsx
@@ -0,0 +1,68 @@
+import { Pressable, Text, StyleSheet, type PressableProps } from "react-native";
+import { colors, radii, fontFamily } from "../theme/tokens";
+
+type Variant = "primary" | "outline";
+
+type Props = PressableProps & {
+ title: string;
+ variant?: Variant;
+};
+
+/**
+ * Mirrors the web app's button-primary/button-outline tokens (DESIGN.md) —
+ * marigold fill for primary, hairline-bordered canvas fill for outline.
+ * Height is 48px rather than the web's 32px: that control size is a
+ * desktop-density choice, too small as a touch target on a phone.
+ */
+export function Button({ title, variant = "primary", style, disabled, ...rest }: Props) {
+ return (
+ [
+ styles.base,
+ variant === "primary" ? styles.primary : styles.outline,
+ disabled && styles.disabled,
+ state.pressed && !disabled && styles.pressed,
+ typeof style === "function" ? style(state) : style,
+ ]}
+ {...rest}
+ >
+ {title}
+
+ );
+}
+
+const styles = StyleSheet.create({
+ base: {
+ height: 48,
+ borderRadius: radii.lg,
+ alignItems: "center",
+ justifyContent: "center",
+ paddingHorizontal: 16,
+ },
+ primary: {
+ backgroundColor: colors.marigoldOrange,
+ },
+ outline: {
+ backgroundColor: colors.porchWhite,
+ borderWidth: 1,
+ borderColor: colors.hairlineGray,
+ },
+ pressed: {
+ transform: [{ translateY: 1 }],
+ opacity: 0.92,
+ },
+ disabled: {
+ opacity: 0.5,
+ },
+ primaryText: {
+ color: colors.pureWhite,
+ fontFamily: fontFamily.semiBold,
+ fontSize: 14,
+ },
+ outlineText: {
+ color: colors.ink,
+ fontFamily: fontFamily.semiBold,
+ fontSize: 14,
+ },
+});
diff --git a/mobile/src/components/Card.tsx b/mobile/src/components/Card.tsx
new file mode 100644
index 0000000..812a885
--- /dev/null
+++ b/mobile/src/components/Card.tsx
@@ -0,0 +1,21 @@
+import { View, StyleSheet, type ViewProps } from "react-native";
+import { colors, radii, spacing } from "../theme/tokens";
+
+/**
+ * Mirrors the web app's card token (DESIGN.md): pure-white surface,
+ * rounded-xl, defined by a hairline ring rather than a resting shadow.
+ */
+export function Card({ style, ...rest }: ViewProps) {
+ return ;
+}
+
+const styles = StyleSheet.create({
+ card: {
+ backgroundColor: colors.pureWhite,
+ borderRadius: radii.xl,
+ borderWidth: 1,
+ borderColor: colors.hairlineGray,
+ padding: spacing.cardDefault,
+ gap: 4,
+ },
+});
diff --git a/mobile/src/components/TextField.tsx b/mobile/src/components/TextField.tsx
new file mode 100644
index 0000000..9dd452e
--- /dev/null
+++ b/mobile/src/components/TextField.tsx
@@ -0,0 +1,25 @@
+import { TextInput, StyleSheet, type TextInputProps } from "react-native";
+import { colors, radii, fontFamily } from "../theme/tokens";
+
+/**
+ * Mirrors the web app's input token (DESIGN.md): rounded-lg, transparent
+ * background, hairline border. Height is 48px rather than the web's 32px —
+ * see Button.tsx for why touch targets diverge from the desktop control size.
+ */
+export function TextField(props: TextInputProps) {
+ return ;
+}
+
+const styles = StyleSheet.create({
+ input: {
+ height: 48,
+ borderRadius: radii.lg,
+ borderWidth: 1,
+ borderColor: colors.hairlineGray,
+ backgroundColor: "transparent",
+ paddingHorizontal: 14,
+ fontFamily: fontFamily.regular,
+ fontSize: 14,
+ color: colors.ink,
+ },
+});
diff --git a/mobile/src/theme/tokens.ts b/mobile/src/theme/tokens.ts
new file mode 100644
index 0000000..e50192c
--- /dev/null
+++ b/mobile/src/theme/tokens.ts
@@ -0,0 +1,89 @@
+/**
+ * Design tokens mirroring the web app's "Spotlight Porch" system — see
+ * ../../../DESIGN.md at the repo root. Hex values are sRGB approximations of
+ * the web app's OKLCH tokens (React Native's StyleSheet doesn't parse oklch()).
+ * Keep in sync by hand when DESIGN.md changes; there's no shared package yet.
+ */
+
+export const colors = {
+ marigoldOrange: "#f97316",
+ marigoldOrangeHover: "#ea580c",
+ marigoldTint: "#ffedd5",
+ marigoldDeep: "#c2410c",
+ porchWhite: "#fafafa",
+ pureWhite: "#ffffff",
+ ink: "#171717",
+ hairlineGray: "#e5e5e5",
+ whisperGray: "#f2f2f2",
+ quietGray: "#737373",
+ alertRed: "#dc2626",
+ alertRedTint: "#fee2e2",
+} as const;
+
+export const radii = {
+ sm: 6,
+ md: 8,
+ lg: 10,
+ xl: 14,
+ "2xl": 18,
+ "3xl": 22,
+ "4xl": 26,
+} as const;
+
+export const spacing = {
+ cardSm: 12,
+ cardDefault: 16,
+} as const;
+
+/**
+ * Font family names as registered by useFonts() in app/_layout.tsx — must
+ * match the @expo-google-fonts/inter export names exactly.
+ */
+export const fontFamily = {
+ regular: "Inter_400Regular",
+ semiBold: "Inter_600SemiBold",
+ bold: "Inter_700Bold",
+ extraBold: "Inter_800ExtraBold",
+} as const;
+
+/**
+ * Named text styles from DESIGN.md's typography scale. React Native has no
+ * letter-spacing keyword like Tailwind's tracking-tight, so values are in
+ * absolute pixels (negative = tighter).
+ */
+export const typography = {
+ display: {
+ fontFamily: fontFamily.extraBold,
+ fontSize: 30,
+ lineHeight: 36,
+ letterSpacing: -0.5,
+ color: colors.ink,
+ },
+ headline: {
+ fontFamily: fontFamily.bold,
+ fontSize: 24,
+ lineHeight: 30,
+ letterSpacing: -0.3,
+ color: colors.ink,
+ },
+ title: {
+ fontFamily: fontFamily.semiBold,
+ fontSize: 20,
+ lineHeight: 28,
+ color: colors.ink,
+ },
+ body: {
+ fontFamily: fontFamily.regular,
+ fontSize: 14,
+ lineHeight: 22,
+ color: colors.ink,
+ },
+ label: {
+ fontFamily: fontFamily.semiBold,
+ fontSize: 12,
+ lineHeight: 16,
+ letterSpacing: 0.3,
+ textTransform: "uppercase",
+ color: colors.quietGray,
+ },
+} as const;