Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=
EXPO_PUBLIC_SUPABASE_URL=
EXPO_PUBLIC_SUPABASE_ANON_KEY=
EXPO_PUBLIC_ACCOUNT_DELETION_URL=
EXPO_PUBLIC_REVENUECAT_ANDROID_API_KEY=
EXPO_PUBLIC_REVENUECAT_IOS_API_KEY=

# Server-side only. Set these in Supabase Edge Function secrets, never in Expo public env.
SUPABASE_SERVICE_ROLE_KEY=
CLERK_SECRET_KEY=
REVENUECAT_SECRET_API_KEY=
4 changes: 4 additions & 0 deletions .env.preview.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=
EXPO_PUBLIC_SUPABASE_URL=
EXPO_PUBLIC_SUPABASE_ANON_KEY=
EXPO_PUBLIC_ACCOUNT_DELETION_URL=
EXPO_PUBLIC_REVENUECAT_ANDROID_API_KEY=
EXPO_PUBLIC_REVENUECAT_IOS_API_KEY=

# Keep server-only credentials in Supabase Edge Function secrets.
# Do not add them to this file or an EAS mobile build environment.
# Required by AI Edge Functions for server-side subscription validation:
# REVENUECAT_SECRET_API_KEY
4 changes: 4 additions & 0 deletions .env.production.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=
EXPO_PUBLIC_SUPABASE_URL=
EXPO_PUBLIC_SUPABASE_ANON_KEY=
EXPO_PUBLIC_ACCOUNT_DELETION_URL=
EXPO_PUBLIC_REVENUECAT_ANDROID_API_KEY=
EXPO_PUBLIC_REVENUECAT_IOS_API_KEY=

# Production server credentials are intentionally pending.
# Keep them in backend secret storage, never in the mobile build environment.
# Required by AI Edge Functions for server-side subscription validation:
# REVENUECAT_SECRET_API_KEY
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,4 @@ PROMPTS.md
task.md
DB.md
AI.md
DearDiary.md
27 changes: 27 additions & 0 deletions .maestro/00-launch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
appId: com.aryan.deardiary
---
- launchApp:
clearState: false

- assertVisible:
text: "DearDiary"
optional: true

- assertVisible:
text: "Today"

- assertVisible:
text: "Reflect"
optional: true

- assertVisible:
text: "History"
optional: true

- assertVisible:
text: "Insights"
optional: true

- assertVisible:
text: "Profile"
optional: true
35 changes: 35 additions & 0 deletions .maestro/00-smoke-launch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
appId: com.aryan.deardiary
---
- launchApp:
clearState: false

- assertVisible:
id: "login-screen"
optional: true

- assertVisible:
id: "signup-screen"
optional: true

- assertVisible:
id: "home-screen"
optional: true

- assertVisible:
id: "app-lock-screen"
optional: true

- tapOn:
id: "tab-profile-button"
optional: true

- assertVisible:
id: "profile-screen"
optional: true

- tapOn:
id: "tab-today-button"
optional: true

- assertVisible:
id: "home-screen"
7 changes: 4 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"expo": {
"name": "DearDiary",
"slug": "dear-diary",
"version": "1.0.4",
"version": "1.0.6",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "deardiary",
"userInterfaceStyle": "automatic",
"newArchEnabled": true,
"ios": {
"buildNumber": "4",
"buildNumber": "6",
"supportsTablet": true
},
"android": {
Expand All @@ -21,7 +21,8 @@
],
"icon": "./assets/images/icon.png",
"package": "com.aryan.deardiary",
"versionCode": 4,
"permissions": ["com.android.vending.BILLING"],
"versionCode": 6,
"adaptiveIcon": {
"backgroundColor": "#FFDDE8",
"foregroundImage": "./assets/images/icon.png"
Expand Down
6 changes: 6 additions & 0 deletions app/(onboarding)/onboarding-screen-1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ export default function OnboardingScreenOne() {
>
<Link href={nextHref} asChild>
<Pressable
testID="onboarding-next-button"
accessibilityLabel="Next onboarding screen"
accessibilityRole="button"
className="w-full items-center justify-center rounded-full"
style={{
backgroundColor: colors.brandPrimary,
Expand All @@ -322,6 +325,9 @@ export default function OnboardingScreenOne() {
</Link>

<Pressable
testID="onboarding-login-button"
accessibilityLabel="I already have an account"
accessibilityRole="button"
className="px-4 py-1"
onPress={handleExistingAccountPress}
>
Expand Down
10 changes: 9 additions & 1 deletion app/(onboarding)/onboarding-screen-2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ export default function OnboardingScreenTwo() {
>
<Link href={nextHref} asChild>
<Pressable
testID="onboarding-next-button"
accessibilityLabel="Next onboarding screen"
accessibilityRole="button"
className="w-full items-center justify-center rounded-full"
style={{
backgroundColor: colors.brandPrimary,
Expand All @@ -386,7 +389,12 @@ export default function OnboardingScreenTwo() {
</Link>

<Link href={backHref} asChild>
<Pressable className="px-4 py-1">
<Pressable
testID="onboarding-back-button"
accessibilityLabel="Previous onboarding screen"
accessibilityRole="button"
className="px-4 py-1"
>
<Text
className="text-[15px] font-medium leading-6"
style={{ color: mutedPlum }}
Expand Down
2 changes: 2 additions & 0 deletions app/(onboarding)/onboarding-screen-3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ export default function OnboardingScreenThree() {
>
<Link href={nextHref} asChild>
<Pressable
testID="onboarding-next-button"
accessibilityLabel="Next onboarding screen"
accessibilityRole="button"
className="w-full flex-row items-center justify-center gap-3 rounded-full bg-brand-primary"
Expand All @@ -304,6 +305,7 @@ export default function OnboardingScreenThree() {

<Link href={backHref} asChild>
<Pressable
testID="onboarding-back-button"
accessibilityLabel="Previous onboarding screen"
accessibilityRole="button"
className="px-4 py-1"
Expand Down
2 changes: 2 additions & 0 deletions app/(onboarding)/onboarding-screen-4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ export default function OnboardingScreenFour() {
>
<Link href={nextHref} asChild>
<Pressable
testID="onboarding-next-button"
accessibilityLabel="Next onboarding screen"
accessibilityRole="button"
className="w-full items-center justify-center rounded-full"
Expand All @@ -251,6 +252,7 @@ export default function OnboardingScreenFour() {

<Link href={backHref} asChild>
<Pressable
testID="onboarding-back-button"
accessibilityLabel="Previous onboarding screen"
accessibilityRole="button"
className="px-4 py-1"
Expand Down
2 changes: 2 additions & 0 deletions app/(onboarding)/onboarding-screen-5.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ export default function OnboardingScreenFive() {
}}
>
<Pressable
testID="onboarding-complete-button"
accessibilityLabel="Start writing"
accessibilityRole="button"
className="w-full items-center justify-center rounded-full"
Expand All @@ -236,6 +237,7 @@ export default function OnboardingScreenFive() {
</Pressable>

<Pressable
testID="onboarding-maybe-later-button"
accessibilityLabel="Maybe later"
accessibilityRole="button"
className="px-4 py-1"
Expand Down
12 changes: 10 additions & 2 deletions app/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { useAuth } from "@clerk/expo";
import { Redirect, Stack } from "expo-router";
import { Stack, useRouter } from "expo-router";
import { useEffect } from "react";

import { AutoSyncManager } from "@/components/sync/auto-sync-manager";
import { bottomTabRouteTransitions } from "@/navigation/route-transition-map";
import { useNativeTransitionOptions } from "@/navigation/transitions";

export default function HomeTabLayout() {
const router = useRouter();
const { isLoaded, isSignedIn } = useAuth();
const tabOptions = useNativeTransitionOptions(
bottomTabRouteTransitions["home-tab/index"],
Expand All @@ -14,12 +16,18 @@ export default function HomeTabLayout() {
bottomTabRouteTransitions["journal-editor/index"],
);

useEffect(() => {
if (isLoaded && !isSignedIn) {
router.replace("/login");
}
}, [isLoaded, isSignedIn, router]);

if (!isLoaded) {
return null;
}

if (!isSignedIn) {
return <Redirect href="/login" />;
return null;
}

return (
Expand Down
6 changes: 5 additions & 1 deletion app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { useNativeTransitionOptions } from "@/navigation/transitions";
import { AppLockProvider } from "@/providers/AppLockProvider";
import { AppDialogProvider } from "@/providers/AppDialogProvider";
import { ConnectivityProvider } from "@/providers/ConnectivityProvider";
import { SubscriptionProvider } from "@/providers/SubscriptionProvider";

export default function RootLayout() {
if (!publicEnvironmentResult.isValid) {
Expand All @@ -40,7 +41,9 @@ export default function RootLayout() {
>
<ConnectivityProvider>
<AppDialogProvider>
<AppStack />
<SubscriptionProvider>
<AppStack />
</SubscriptionProvider>
</AppDialogProvider>
</ConnectivityProvider>
</ClerkProvider>
Expand Down Expand Up @@ -111,6 +114,7 @@ function RootNavigator() {
name="legal/privacy-policy"
options={standardDetailOptions}
/>
<Stack.Screen name="paywall" options={standardDetailOptions} />
<Stack.Screen name="legal/terms" options={standardDetailOptions} />
<Stack.Screen name="settings" options={standardDetailOptions} />
<Stack.Screen name="sso" options={sensitiveOptions} />
Expand Down
Loading