summaryrefslogtreecommitdiff
path: root/apps/mobile/lib/config.ts
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-18 17:44:50 +0000
committerGitHub <noreply@github.com>2026-01-18 17:44:50 +0000
commit869f21ee2efaefed6a5aa4fbd417c25df8dec02a (patch)
tree2a90820ac817173e5b7154e0ba5e4f5d095f9613 /apps/mobile/lib/config.ts
parent219bca168508e1ea5e91e8a9ce98338afeddfbd2 (diff)
downloadsoryu-869f21ee2efaefed6a5aa4fbd417c25df8dec02a.tar.gz
soryu-869f21ee2efaefed6a5aa4fbd417c25df8dec02a.zip
Add React Native mobile app for Makima (#3)
* [WIP] Heartbeat checkpoint - 2026-01-18 02:58:27 UTC * feat(mobile): complete mobile app integration and verification - Add ThemeColors type export to Colors.ts for type safety - Export SUPABASE_URL from supabase.ts and use environment variables - Update .env.example with correct default URLs - Add comprehensive README.md with setup instructions Verified: - TypeScript compiles without errors - App exports successfully for iOS and Android - All screens accessible (login, dashboard, tasks, settings, task detail) - Auth flow working with Zustand store and Supabase Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Task completion checkpoint --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'apps/mobile/lib/config.ts')
-rw-r--r--apps/mobile/lib/config.ts89
1 files changed, 89 insertions, 0 deletions
diff --git a/apps/mobile/lib/config.ts b/apps/mobile/lib/config.ts
new file mode 100644
index 0000000..70fce52
--- /dev/null
+++ b/apps/mobile/lib/config.ts
@@ -0,0 +1,89 @@
+import { Platform } from 'react-native';
+
+/**
+ * API configuration for Makima mobile app
+ * Supports different environments and platforms
+ */
+
+// Environment detection
+const isDevelopment = __DEV__;
+
+/**
+ * API base URLs for different environments
+ */
+export const API_CONFIG = {
+ local: 'http://localhost:8080',
+ // Use 10.0.2.2 for Android emulator to access host machine's localhost
+ localAndroid: 'http://10.0.2.2:8080',
+ production: 'https://api.makima.jp',
+} as const;
+
+/**
+ * Get the appropriate API base URL based on environment and platform
+ */
+export function getApiBaseUrl(): string {
+ // Check for environment variable override
+ const envUrl = process.env.EXPO_PUBLIC_API_URL;
+ if (envUrl) {
+ return envUrl;
+ }
+
+ // In production, use the production API
+ if (!isDevelopment) {
+ return API_CONFIG.production;
+ }
+
+ // In development, use local API with platform-specific URL
+ if (Platform.OS === 'android') {
+ return API_CONFIG.localAndroid;
+ }
+
+ return API_CONFIG.local;
+}
+
+/**
+ * App configuration object
+ */
+export const config = {
+ /**
+ * API base URL for making requests
+ */
+ apiBaseUrl: getApiBaseUrl(),
+
+ /**
+ * Whether the app is running in development mode
+ */
+ isDevelopment,
+
+ /**
+ * Supabase URL (from environment or default)
+ */
+ supabaseUrl: process.env.EXPO_PUBLIC_SUPABASE_URL || 'https://ynxyjytytmfwxjqxljzm.supabase.co',
+
+ /**
+ * App version
+ */
+ version: '1.0.0',
+
+ /**
+ * Support/help URL
+ */
+ supportUrl: 'https://makima.jp/support',
+
+ /**
+ * Privacy policy URL
+ */
+ privacyPolicyUrl: 'https://makima.jp/privacy',
+
+ /**
+ * Terms of service URL
+ */
+ termsOfServiceUrl: 'https://makima.jp/terms',
+
+ /**
+ * Forgot password URL (opens in browser)
+ */
+ forgotPasswordUrl: 'https://makima.jp/forgot-password',
+} as const;
+
+export type Config = typeof config;