Skip to content

Commit a9c4e16

Browse files
committed
1 parent 6befd40 commit a9c4e16

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+10186
-0
lines changed

packages/app/.eslintrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: ["universe/native"],
4+
};

packages/app/.gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
node_modules/
2+
.expo/
3+
dist/
4+
npm-debug.*
5+
*.jks
6+
*.p8
7+
*.p12
8+
*.key
9+
*.mobileprovision
10+
*.orig.*
11+
web-build/
12+
13+
.env
14+
15+
.cursorrules
16+
17+
# macOS
18+
.DS_Store
19+
# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb
20+
# The following patterns were generated by expo-cli
21+
22+
expo-env.d.ts
23+
# @end expo-cli

packages/app/.prettierrc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": false,
6+
"quoteProps": "as-needed",
7+
"jsxSingleQuote": false,
8+
"trailingComma": "all",
9+
"bracketSpacing": true,
10+
"bracketSameLine": false,
11+
"arrowParens": "always",
12+
"useTabs": true
13+
}

packages/app/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Vincent Fleming
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/app/app.json

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"expo": {
3+
"name": "ExpoSupabaseStarter",
4+
"slug": "ExpoSupabaseStarter",
5+
"scheme": "expo-supabase-starter",
6+
"version": "1.0.0",
7+
"orientation": "portrait",
8+
"icon": "./assets/icon.png",
9+
"userInterfaceStyle": "automatic",
10+
"assetBundlePatterns": ["**/*"],
11+
"newArchEnabled": true,
12+
"ios": {
13+
"supportsTablet": true,
14+
"config": {
15+
"usesNonExemptEncryption": false
16+
},
17+
"splash": {
18+
"image": "./assets/splash.png",
19+
"resizeMode": "cover",
20+
"backgroundColor": "#ffffff",
21+
"dark": {
22+
"backgroundColor": "#000000",
23+
"resizeMode": "cover",
24+
"image": "./assets/splash-dark.png"
25+
}
26+
}
27+
},
28+
"android": {
29+
"adaptiveIcon": {
30+
"foregroundImage": "./assets/adaptive-icon.png"
31+
},
32+
"splash": {
33+
"image": "./assets/splash.png",
34+
"resizeMode": "cover",
35+
"backgroundColor": "#ffffff",
36+
"dark": {
37+
"backgroundColor": "#000000",
38+
"resizeMode": "cover",
39+
"image": "./assets/splash-dark.png"
40+
}
41+
}
42+
},
43+
"experiments": {
44+
"typedRoutes": true
45+
},
46+
"plugins": ["expo-router", "expo-secure-store"]
47+
}
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { Tabs } from "expo-router";
2+
import React from "react";
3+
4+
import { colors } from "@/constants/colors";
5+
import { useColorScheme } from "@/lib/useColorScheme";
6+
7+
export default function ProtectedLayout() {
8+
const { colorScheme } = useColorScheme();
9+
10+
return (
11+
<Tabs
12+
screenOptions={{
13+
headerShown: false,
14+
tabBarStyle: {
15+
backgroundColor:
16+
colorScheme === "dark"
17+
? colors.dark.background
18+
: colors.light.background,
19+
},
20+
tabBarActiveTintColor:
21+
colorScheme === "dark"
22+
? colors.dark.foreground
23+
: colors.light.foreground,
24+
tabBarShowLabel: false,
25+
}}
26+
>
27+
<Tabs.Screen name="index" options={{ title: "Home" }} />
28+
<Tabs.Screen name="settings" options={{ title: "Settings" }} />
29+
</Tabs>
30+
);
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { router } from "expo-router";
2+
import { View } from "react-native";
3+
4+
import { Button } from "@/components/ui/button";
5+
import { Text } from "@/components/ui/text";
6+
import { H1, Muted } from "@/components/ui/typography";
7+
8+
export default function Home() {
9+
return (
10+
<View className="flex-1 items-center justify-center bg-background p-4 gap-y-4">
11+
<H1 className="text-center">Home</H1>
12+
<Muted className="text-center">
13+
You are now authenticated and this session will persist even after
14+
closing the app.
15+
</Muted>
16+
<Button
17+
className="w-full"
18+
variant="default"
19+
size="default"
20+
onPress={() => router.push("/(app)/modal")}
21+
>
22+
<Text>Open Modal</Text>
23+
</Button>
24+
</View>
25+
);
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { View } from "react-native";
2+
3+
import { Button } from "@/components/ui/button";
4+
import { Text } from "@/components/ui/text";
5+
import { H1, Muted } from "@/components/ui/typography";
6+
import { useSupabase } from "@/context/supabase-provider";
7+
8+
export default function Settings() {
9+
const { signOut } = useSupabase();
10+
11+
return (
12+
<View className="flex-1 items-center justify-center bg-background p-4 gap-y-4">
13+
<H1 className="text-center">Sign Out</H1>
14+
<Muted className="text-center">
15+
Sign out and return to the welcome screen.
16+
</Muted>
17+
<Button
18+
className="w-full"
19+
size="default"
20+
variant="default"
21+
onPress={signOut}
22+
>
23+
<Text>Sign Out</Text>
24+
</Button>
25+
</View>
26+
);
27+
}

packages/app/app/(app)/+not-found.tsx

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { View } from "react-native";
2+
3+
import { H1, Muted } from "@/components/ui/typography";
4+
5+
export default function NotFound() {
6+
return (
7+
<View className="flex flex-1 items-center justify-center bg-background p-4 gap-y-4">
8+
<H1 className="text-center">404</H1>
9+
<Muted className="text-center">This page could not be found.</Muted>
10+
</View>
11+
);
12+
}

packages/app/app/(app)/_layout.tsx

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import { Stack } from "expo-router";
2+
3+
import { colors } from "@/constants/colors";
4+
import { useColorScheme } from "@/lib/useColorScheme";
5+
6+
export const unstable_settings = {
7+
initialRouteName: "(root)",
8+
};
9+
10+
export default function AppLayout() {
11+
const { colorScheme } = useColorScheme();
12+
13+
return (
14+
<Stack screenOptions={{ headerShown: false, gestureEnabled: false }}>
15+
<Stack.Screen name="(protected)" />
16+
<Stack.Screen name="welcome" />
17+
<Stack.Screen
18+
name="sign-up"
19+
options={{
20+
presentation: "modal",
21+
headerShown: true,
22+
headerTitle: "Sign Up",
23+
headerStyle: {
24+
backgroundColor:
25+
colorScheme === "dark"
26+
? colors.dark.background
27+
: colors.light.background,
28+
},
29+
headerTintColor:
30+
colorScheme === "dark"
31+
? colors.dark.foreground
32+
: colors.light.foreground,
33+
gestureEnabled: true,
34+
}}
35+
/>
36+
<Stack.Screen
37+
name="sign-in"
38+
options={{
39+
presentation: "modal",
40+
headerShown: true,
41+
headerTitle: "Sign In",
42+
headerStyle: {
43+
backgroundColor:
44+
colorScheme === "dark"
45+
? colors.dark.background
46+
: colors.light.background,
47+
},
48+
headerTintColor:
49+
colorScheme === "dark"
50+
? colors.dark.foreground
51+
: colors.light.foreground,
52+
gestureEnabled: true,
53+
}}
54+
/>
55+
<Stack.Screen
56+
name="modal"
57+
options={{
58+
presentation: "modal",
59+
headerShown: true,
60+
headerTitle: "Modal",
61+
headerStyle: {
62+
backgroundColor:
63+
colorScheme === "dark"
64+
? colors.dark.background
65+
: colors.light.background,
66+
},
67+
headerTintColor:
68+
colorScheme === "dark"
69+
? colors.dark.foreground
70+
: colors.light.foreground,
71+
gestureEnabled: true,
72+
}}
73+
/>
74+
</Stack>
75+
);
76+
}

packages/app/app/(app)/modal.tsx

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { View } from "react-native";
2+
3+
import { H1, Muted } from "@/components/ui/typography";
4+
5+
export default function Modal() {
6+
return (
7+
<View className="flex flex-1 items-center justify-center bg-background p-4 gap-y-4">
8+
<H1 className="text-center">Modal</H1>
9+
<Muted className="text-center">This is a modal screen.</Muted>
10+
</View>
11+
);
12+
}

0 commit comments

Comments
 (0)