Merge pull request #215 from trails-cool/feat/mobile-app-foundation
Initialize mobile app with Expo 55 and NativeTabs
This commit is contained in:
commit
423499d21d
18 changed files with 5630 additions and 32 deletions
41
apps/mobile/.gitignore
vendored
Normal file
41
apps/mobile/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# Expo
|
||||||
|
.expo/
|
||||||
|
dist/
|
||||||
|
web-build/
|
||||||
|
expo-env.d.ts
|
||||||
|
|
||||||
|
# Native
|
||||||
|
.kotlin/
|
||||||
|
*.orig.*
|
||||||
|
*.jks
|
||||||
|
*.p8
|
||||||
|
*.p12
|
||||||
|
*.key
|
||||||
|
*.mobileprovision
|
||||||
|
|
||||||
|
# Metro
|
||||||
|
.metro-health-check*
|
||||||
|
|
||||||
|
# debug
|
||||||
|
npm-debug.*
|
||||||
|
yarn-debug.*
|
||||||
|
yarn-error.*
|
||||||
|
|
||||||
|
# macOS
|
||||||
|
.DS_Store
|
||||||
|
*.pem
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env*.local
|
||||||
|
|
||||||
|
# typescript
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# generated native folders
|
||||||
|
/ios
|
||||||
|
/android
|
||||||
36
apps/mobile/app.config.ts
Normal file
36
apps/mobile/app.config.ts
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
import { ExpoConfig, ConfigContext } from "expo/config";
|
||||||
|
|
||||||
|
export default ({ config }: ConfigContext): ExpoConfig => ({
|
||||||
|
...config,
|
||||||
|
name: "trails.cool",
|
||||||
|
slug: "trails-cool",
|
||||||
|
version: "0.0.1",
|
||||||
|
scheme: "trailscool",
|
||||||
|
orientation: "portrait",
|
||||||
|
icon: "./assets/icon.png",
|
||||||
|
userInterfaceStyle: "light",
|
||||||
|
newArchEnabled: true,
|
||||||
|
splash: {
|
||||||
|
image: "./assets/splash-icon.png",
|
||||||
|
resizeMode: "contain",
|
||||||
|
backgroundColor: "#ffffff",
|
||||||
|
},
|
||||||
|
ios: {
|
||||||
|
supportsTablet: true,
|
||||||
|
bundleIdentifier: "cool.trails.app",
|
||||||
|
},
|
||||||
|
android: {
|
||||||
|
adaptiveIcon: {
|
||||||
|
foregroundImage: "./assets/adaptive-icon.png",
|
||||||
|
backgroundColor: "#ffffff",
|
||||||
|
},
|
||||||
|
package: "cool.trails.app",
|
||||||
|
},
|
||||||
|
web: {
|
||||||
|
favicon: "./assets/favicon.png",
|
||||||
|
},
|
||||||
|
experiments: {
|
||||||
|
monorepo: true,
|
||||||
|
},
|
||||||
|
plugins: ["expo-router"],
|
||||||
|
});
|
||||||
36
apps/mobile/app/(tabs)/_layout.tsx
Normal file
36
apps/mobile/app/(tabs)/_layout.tsx
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
import { NativeTabs } from "expo-router/unstable-native-tabs";
|
||||||
|
|
||||||
|
export default function TabLayout() {
|
||||||
|
return (
|
||||||
|
<NativeTabs>
|
||||||
|
<NativeTabs.Trigger name="index">
|
||||||
|
<NativeTabs.Trigger.Icon
|
||||||
|
sf={{ default: "map", selected: "map.fill" }}
|
||||||
|
md="map"
|
||||||
|
/>
|
||||||
|
<NativeTabs.Trigger.Label>Map</NativeTabs.Trigger.Label>
|
||||||
|
</NativeTabs.Trigger>
|
||||||
|
<NativeTabs.Trigger name="routes">
|
||||||
|
<NativeTabs.Trigger.Icon
|
||||||
|
sf={{ default: "signpost.right", selected: "signpost.right.fill" }}
|
||||||
|
md="route"
|
||||||
|
/>
|
||||||
|
<NativeTabs.Trigger.Label>Routes</NativeTabs.Trigger.Label>
|
||||||
|
</NativeTabs.Trigger>
|
||||||
|
<NativeTabs.Trigger name="activities">
|
||||||
|
<NativeTabs.Trigger.Icon
|
||||||
|
sf={{ default: "bicycle", selected: "bicycle" }}
|
||||||
|
md="directions_bike"
|
||||||
|
/>
|
||||||
|
<NativeTabs.Trigger.Label>Activities</NativeTabs.Trigger.Label>
|
||||||
|
</NativeTabs.Trigger>
|
||||||
|
<NativeTabs.Trigger name="profile">
|
||||||
|
<NativeTabs.Trigger.Icon
|
||||||
|
sf={{ default: "person", selected: "person.fill" }}
|
||||||
|
md="person"
|
||||||
|
/>
|
||||||
|
<NativeTabs.Trigger.Label>Profile</NativeTabs.Trigger.Label>
|
||||||
|
</NativeTabs.Trigger>
|
||||||
|
</NativeTabs>
|
||||||
|
);
|
||||||
|
}
|
||||||
14
apps/mobile/app/(tabs)/activities.tsx
Normal file
14
apps/mobile/app/(tabs)/activities.tsx
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { View, Text, StyleSheet } from "react-native";
|
||||||
|
|
||||||
|
export default function ActivitiesScreen() {
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<Text style={styles.text}>Activities</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: { flex: 1, justifyContent: "center", alignItems: "center" },
|
||||||
|
text: { fontSize: 18, color: "#666" },
|
||||||
|
});
|
||||||
14
apps/mobile/app/(tabs)/index.tsx
Normal file
14
apps/mobile/app/(tabs)/index.tsx
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { View, Text, StyleSheet } from "react-native";
|
||||||
|
|
||||||
|
export default function MapScreen() {
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<Text style={styles.text}>Map</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: { flex: 1, justifyContent: "center", alignItems: "center" },
|
||||||
|
text: { fontSize: 18, color: "#666" },
|
||||||
|
});
|
||||||
17
apps/mobile/app/(tabs)/profile.tsx
Normal file
17
apps/mobile/app/(tabs)/profile.tsx
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
import { View, Text, StyleSheet } from "react-native";
|
||||||
|
import { API_VERSION } from "@trails-cool/api";
|
||||||
|
|
||||||
|
export default function ProfileScreen() {
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<Text style={styles.text}>Profile</Text>
|
||||||
|
<Text style={styles.version}>API v{API_VERSION}</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: { flex: 1, justifyContent: "center", alignItems: "center" },
|
||||||
|
text: { fontSize: 18, color: "#666" },
|
||||||
|
version: { fontSize: 12, color: "#999", marginTop: 8 },
|
||||||
|
});
|
||||||
14
apps/mobile/app/(tabs)/routes.tsx
Normal file
14
apps/mobile/app/(tabs)/routes.tsx
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { View, Text, StyleSheet } from "react-native";
|
||||||
|
|
||||||
|
export default function RoutesScreen() {
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<Text style={styles.text}>Routes</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: { flex: 1, justifyContent: "center", alignItems: "center" },
|
||||||
|
text: { fontSize: 18, color: "#666" },
|
||||||
|
});
|
||||||
5
apps/mobile/app/_layout.tsx
Normal file
5
apps/mobile/app/_layout.tsx
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
import { Stack } from "expo-router";
|
||||||
|
|
||||||
|
export default function RootLayout() {
|
||||||
|
return <Stack screenOptions={{ headerShown: false }} />;
|
||||||
|
}
|
||||||
BIN
apps/mobile/assets/adaptive-icon.png
Normal file
BIN
apps/mobile/assets/adaptive-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
apps/mobile/assets/favicon.png
Normal file
BIN
apps/mobile/assets/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
apps/mobile/assets/icon.png
Normal file
BIN
apps/mobile/assets/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
BIN
apps/mobile/assets/splash-icon.png
Normal file
BIN
apps/mobile/assets/splash-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
1
apps/mobile/index.ts
Normal file
1
apps/mobile/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
import "expo-router/entry";
|
||||||
30
apps/mobile/package.json
Normal file
30
apps/mobile/package.json
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
"name": "@trails-cool/mobile",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"private": true,
|
||||||
|
"main": "index.ts",
|
||||||
|
"scripts": {
|
||||||
|
"start": "expo start",
|
||||||
|
"android": "expo start --android",
|
||||||
|
"ios": "expo start --ios",
|
||||||
|
"web": "expo start --web"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@trails-cool/api": "workspace:*",
|
||||||
|
"@trails-cool/gpx": "workspace:*",
|
||||||
|
"@trails-cool/i18n": "workspace:*",
|
||||||
|
"@trails-cool/map-core": "workspace:*",
|
||||||
|
"@trails-cool/types": "workspace:*",
|
||||||
|
"expo": "~55.0.14",
|
||||||
|
"expo-router": "~55.0.12",
|
||||||
|
"expo-status-bar": "~55.0.5",
|
||||||
|
"react": "19.2.0",
|
||||||
|
"react-native": "0.83.4",
|
||||||
|
"react-native-safe-area-context": "~5.6.2",
|
||||||
|
"react-native-screens": "~4.23.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/react": "~19.2.14",
|
||||||
|
"typescript": "~5.9.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
6
apps/mobile/tsconfig.json
Normal file
6
apps/mobile/tsconfig.json
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"extends": "expo/tsconfig.base",
|
||||||
|
"compilerOptions": {
|
||||||
|
"strict": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
### 1.1 App Scaffold
|
### 1.1 App Scaffold
|
||||||
|
|
||||||
- [ ] 1.1.1 Initialize Expo managed project at `apps/mobile/` with TypeScript template
|
- [x] 1.1.1 Initialize Expo managed project at `apps/mobile/` with TypeScript template
|
||||||
- [ ] 1.1.2 Configure pnpm workspace to include `apps/mobile` and resolve shared packages (`@trails-cool/types`, `@trails-cool/gpx`, `@trails-cool/i18n`)
|
- [x] 1.1.2 Configure pnpm workspace to include `apps/mobile` and resolve shared packages (`@trails-cool/types`, `@trails-cool/gpx`, `@trails-cool/i18n`)
|
||||||
- [ ] 1.1.3 Set up Expo Router with bottom tab navigation (Map, Routes, Activities, Profile) and placeholder screens
|
- [x] 1.1.3 Set up Expo Router with bottom tab navigation (Map, Routes, Activities, Profile) and placeholder screens
|
||||||
- [ ] 1.1.4 Add app icon, splash screen, and `app.config.ts` with bundle identifiers for iOS and Android
|
- [x] 1.1.4 Add app icon, splash screen, and `app.config.ts` with bundle identifiers for iOS and Android
|
||||||
- [ ] 1.1.5 Configure EAS Build for development and preview profiles
|
- [ ] 1.1.5 Configure EAS Build for development and preview profiles
|
||||||
|
|
||||||
### 1.2 API Contract Package
|
### 1.2 API Contract Package
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,10 @@
|
||||||
"db:push": "drizzle-kit push --config packages/db/drizzle.config.ts --force",
|
"db:push": "drizzle-kit push --config packages/db/drizzle.config.ts --force",
|
||||||
"db:studio": "drizzle-kit studio --config packages/db/drizzle.config.ts",
|
"db:studio": "drizzle-kit studio --config packages/db/drizzle.config.ts",
|
||||||
"dev:services": "docker compose -f docker-compose.dev.yml up -d",
|
"dev:services": "docker compose -f docker-compose.dev.yml up -d",
|
||||||
"dev:full": "./scripts/dev.sh"
|
"dev:full": "./scripts/dev.sh",
|
||||||
|
"dev:mobile": "pnpm --filter @trails-cool/mobile start",
|
||||||
|
"dev:mobile:ios": "pnpm --filter @trails-cool/mobile ios",
|
||||||
|
"dev:mobile:android": "pnpm --filter @trails-cool/mobile android"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"overrides": {
|
"overrides": {
|
||||||
|
|
|
||||||
5435
pnpm-lock.yaml
generated
5435
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue