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
22 changes: 22 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,28 @@ EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_JWT_ISSUER_DOMAIN=


# -----------------------------------------------------------------------------
# PostHog analytics envs
#
# Expo / React Native app runtime:
# EXPO_PUBLIC_POSTHOG_API_KEY is the PostHog project API key. It is safe to
# expose to the mobile app and should be set in local .env files and EAS/CI.
# Tracking is disabled when this value is empty.
#
# EXPO_PUBLIC_POSTHOG_HOST is optional. Use the EU host for the current
# Validation Phase unless a PostHog reverse proxy is introduced later.
# Default in code: https://eu.i.posthog.com
#
# Validation Phase scope:
# PostHog tracking is identified-only after Clerk sign-in. Anonymous pre-auth
# events, autocapture, lifecycle events, and session replay are intentionally
# out of scope.
# -----------------------------------------------------------------------------

EXPO_PUBLIC_POSTHOG_API_KEY=
EXPO_PUBLIC_POSTHOG_HOST=https://eu.i.posthog.com


# -----------------------------------------------------------------------------
# Convex backend envs: Lernplan file storage
# Set in Convex, not in Expo/EAS public envs.
Expand Down
3 changes: 2 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
"resizeMode": "contain",
"backgroundColor": "#ffffff"
}
]
],
"expo-localization"
]
}
}
1 change: 1 addition & 0 deletions convex/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default defineSchema({
schoolType: v.optional(v.string()),
state: v.optional(v.string()),
avatarUrl: v.optional(v.string()),
validationStudentCode: v.optional(v.string()),
})
.index("by_tokenIdentifier", ["tokenIdentifier"])
.index("by_clerkId", ["clerkId"])
Expand Down
5 changes: 5 additions & 0 deletions convex/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const profileFields = (args: {
schoolType?: string;
state?: string;
avatarUrl?: string;
validationStudentCode?: string;
}) => ({
...(args.email !== undefined ? { email: normalizeEmail(args.email) } : {}),
...(args.name !== undefined ? { name: args.name } : {}),
Expand All @@ -95,6 +96,9 @@ const profileFields = (args: {
...(args.schoolType !== undefined ? { schoolType: args.schoolType } : {}),
...(args.state !== undefined ? { state: args.state } : {}),
...(args.avatarUrl !== undefined ? { avatarUrl: args.avatarUrl } : {}),
...(args.validationStudentCode !== undefined
? { validationStudentCode: args.validationStudentCode }
: {}),
});

export const syncCurrentUser = mutation({
Expand All @@ -106,6 +110,7 @@ export const syncCurrentUser = mutation({
schoolType: v.optional(v.string()),
state: v.optional(v.string()),
avatarUrl: v.optional(v.string()),
validationStudentCode: v.optional(v.string()),
},
handler: async (ctx, args) => {
const identity = await requireIdentity(ctx);
Expand Down
16 changes: 16 additions & 0 deletions docs/contexts/integrations/CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,23 @@ Confluence is the current cross-functional documentation hub and may later move

GitHub Issues is the current issue tracker. A planned migration to Linear is tracked in https://github.com/Dayova/dayova-mvp/issues/20.

## Language

**PostHog Student Profile**:
An identifiable analytics profile for a validation-phase student, used to connect in-app behavior with the team's Confluence-based student table.
_Avoid_: Treating PostHog as the source of record for full research notes or qualitative interview data.

**Validation Student Table**:
The Confluence-based table used by non-technical team members to manage test students, their real deadlines, check-ins, and qualitative observations.
_Avoid_: Splitting founder-facing validation notes across multiple unlinked tools.

**Validation Student Code**:
A short Dayova-owned code such as `S1` or `S2` that links a student in the Confluence validation table to their app user and PostHog profile.
_Avoid_: Using email address or full name as the stable join key between tools.

## Notes

- PostHog identifies validation-phase students with Clerk's stable user ID. The Validation Student Code should live in Dayova data, not Clerk auth metadata, and should be sent to PostHog as a profile property when present.
- PostHog tracking is identified-only during the Validation Phase. Anonymous pre-auth app activity, autocapture, lifecycle events, and session replay are intentionally out of scope unless login or onboarding becomes a measured blocker.
Comment on lines 23 to +26

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify how validationStudentCode is sourced and synced.
rg -nC3 'validationStudentCode' src/context/AuthContext.tsx convex/users.ts convex/schema.ts

Repository: Dayova/dayova-mvp

Length of output: 3207


🏁 Script executed:

#!/bin/bash
set -euo pipefail
sed -n '1,60p' docs/contexts/integrations/CONTEXT.md | cat -n

Repository: Dayova/dayova-mvp

Length of output: 2218


🏁 Script executed:

#!/bin/bash
set -euo pipefail
sed -n '330,410p' src/context/AuthContext.tsx | cat -n

Repository: Dayova/dayova-mvp

Length of output: 3407


Clarify whether this is the target state or the current sync path. validationStudentCode is still read from Clerk unsafeMetadata and copied into Convex today, so this note reads like a completed state. Add a short migration caveat or reword it to describe the current boundary.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/contexts/integrations/CONTEXT.md` around lines 23 - 26, The note
currently reads like the Validation Student Code already lives only in Dayova
data, but the current sync path still pulls validationStudentCode from Clerk
unsafeMetadata and copies it into Convex. Reword the PostHog/Validation Phase
note in CONTEXT.md to clearly distinguish the target state from the present
implementation, or add a brief migration caveat that mentions the Clerk
unsafeMetadata to Convex boundary so readers understand what is current versus
planned.

- Capture integration ownership, external IDs, sync boundaries, and migration decisions here.
- Put integrations ADRs in `docs/contexts/integrations/adr/`.
3 changes: 3 additions & 0 deletions docs/contexts/platform/CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ Confluence is the current cross-functional documentation hub. Keep this file foc

## Notes

- Expo public env vars prefixed with `EXPO_PUBLIC_` are bundled into the mobile app and must only contain public client-side values.
- `EXPO_PUBLIC_POSTHOG_API_KEY` enables PostHog analytics in the Expo app. Leave it empty to disable analytics locally.
- `EXPO_PUBLIC_POSTHOG_HOST` defaults to `https://eu.i.posthog.com`; use a Dayova-owned reverse proxy only if event delivery or privacy requirements justify the extra infrastructure.
- Capture platform conventions, release processes, and environment decisions here.
- Put platform ADRs in `docs/contexts/platform/adr/`.
24 changes: 23 additions & 1 deletion docs/contexts/product/CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,29 @@ Confluence is the current cross-functional documentation hub. Keep this file foc

## Glossary

Add stable product and learning-domain terms here as they are agreed.
**Validation Phase**:
A focused learning period where Dayova is tested with a small number of students who have real school deadlines, to learn whether the product causes earlier and more committed action.
_Avoid_: Treating generic app usage, polite feedback, or TestFlight downloads as validation.

**First Real Block**:
The first genuine learning or work block a student starts for a real exam, assignment, presentation, or graded task before the last possible moment.
_Avoid_: Counting planning-only activity or artificial test tasks as this signal.

**Product Signal**:
Observed behavior that suggests Dayova itself helped the student act, such as starting a slot without a personal check-in, returning voluntarily, or entering a second real use case.
_Avoid_: Mixing this with action triggered by a founder or coach message.

**Accountability Signal**:
Observed behavior that happens reliably after a personal check-in or reminder, showing that accountability may be part of the product value.
_Avoid_: Treating check-in-driven action as pure product-loop success.

**Core Loop**:
The product behavior loop of entering a real task, seeing the next step, starting, documenting the result, replanning after failure, and returning.
_Avoid_: Describing the loop as app engagement or calendar usage.

**Recovery Loop**:
The part of the Core Loop where a missed or failed slot is explained, made smaller or replanned, and attempted again.
_Avoid_: Treating missed slots only as churn or lack of motivation.

## Notes

Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,18 @@
"clsx": "^2.1.1",
"convex": "^1.39.1",
"expo": "~56.0.2",
"expo-application": "~56.0.3",
"expo-constants": "^56.0.13",
"expo-crypto": "^56.0.3",
"expo-dev-client": "~56.0.13",
"expo-device": "~56.0.4",
"expo-document-picker": "~56.0.3",
"expo-file-system": "~56.0.7",
"expo-font": "~56.0.5",
"expo-image-picker": "~56.0.11",
"expo-linear-gradient": "~56.0.4",
"expo-linking": "^56.0.10",
"expo-localization": "~56.0.6",
"expo-notifications": "~56.0.11",
"expo-router": "^56.2.4",
"expo-secure-store": "~56.0.3",
Expand All @@ -61,6 +64,7 @@
"expo-updates": "~56.0.14",
"nativewind": "^4.2.3",
"officeparser": "^6.1.0",
"posthog-react-native": "^4.45.14",
"react": "19.2.3",
"react-dom": "19.2.3",
"react-native": "0.85.3",
Expand Down
111 changes: 111 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading