Progress Data Structure
Your progress is tracked across three main database tables:User Quests
Tracks which quests you’ve started and completed, including timestamps.
User Locations
Records every location checkpoint you’ve completed with photo verification.
User Profile
Stores your account information from Clerk authentication.
XP System
Experience Points (XP) are the primary measure of your progress in Quest Hunter.How XP Works
- Each quest has a fixed XP value defined in the quest schema
- XP is only awarded upon complete quest completion
- Partial completion (some locations done) does not award XP
- You cannot earn XP from the same quest twice
XP values vary by quest based on difficulty, estimated time, number of locations, and overall complexity.
Earning XP
To earn XP from a quest:- Start the Quest: Create a
userQuestsrecord withstartedAttimestamp - Complete All Locations: Visit every location in order with photo verification
- Finish the Quest: Mark the quest as complete
- Receive XP: The quest’s XP value is added to your total
convex/quests.ts:172-190):
Calculating Total XP
While the current codebase doesn’t show a dedicated XP aggregation query, you can calculate total XP by:- Querying all completed quests for a user
- Fetching the XP value for each quest
- Summing the XP values
Quest Tracking
Your quest history is maintained in theuserQuests table:
Schema Structure
Quest States
A quest can be in one of three states:Not Started
Not Started
No
userQuests record exists for this quest and user combination. The quest appears in the “Recommended” or “New” tabs.In Progress
In Progress
A
userQuests record exists with startedAt but no completedAt. The quest can be resumed from the last completed location.Query implementation (convex/quests.ts:93-106):Completed
Completed
A
userQuests record exists with both startedAt and completedAt timestamps. The quest appears in the “Done” tab and cannot be restarted.Query implementation (convex/quests.ts:74-91):Database Indexes
Three indexes optimize quest progress queries:| Index Name | Fields | Use Case |
|---|---|---|
by_user | [userId] | Fetch all quests for a specific user |
by_quest | [questId] | Find all users who’ve attempted a quest |
by_user_and_quest | [userId, questId] | Check specific quest status for a user |
Location Completion Tracking
Every location you complete is recorded inuserLocations:
Schema Structure
Tracking Features
Photo Evidence
Every completion includes a
photoStorageId linking to your verification photo in Convex storage.Completion Time
The
completedAt timestamp records exactly when you completed each location.Quest Association
Both
questId and locationId are stored, enabling queries by quest or specific location.User History
All your location completions are permanently stored and queryable.
Querying Completed Locations
Fetch all locations completed for a specific quest (convex/locations.ts:36-50):
Location Indexes
Two indexes enable efficient location tracking:| Index Name | Fields | Use Case |
|---|---|---|
by_user_and_quest | [userId, questId] | Get all completed locations for a quest |
by_user_and_location | [userId, locationId] | Check if user completed specific location |
User Profile Data
Your user profile is synced from Clerk authentication:Schema Structure
Profile Management
User data is automatically managed through Clerk webhooks (convex/users.ts):
- Creation: New users are inserted when they first authenticate
- Updates: Profile changes in Clerk sync to the database
- Deletion: User data is removed if account is deleted
You don’t need to manually update your profile in Quest Hunter. Changes made in your Clerk account automatically sync.
Progress Statistics
While not explicitly shown in the current UI, you can derive various statistics from your progress data:Available Metrics
Total Quests Started
Total Quests Started
Count of all
userQuests records (with or without completedAt).Total Quests Completed
Total Quests Completed
Count of
userQuests records where completedAt is defined.Completion Rate
Completion Rate
Percentage: (Completed Quests / Started Quests) × 100
Total Locations Completed
Total Locations Completed
Count of all
userLocations records for the user.Total XP Earned
Total XP Earned
Sum of XP values from all completed quests.
Average Quest Duration
Average Quest Duration
Average time between
startedAt and completedAt for completed quests.Favorite Category
Favorite Category
Most frequently completed quest category (abenteuer, kultur, natur, etc.).
Recent Activity
Recent Activity
List of recently completed locations or quests sorted by
completedAt.Time Tracking
All timestamps use Unix time (milliseconds since epoch):Progress Persistence
All progress is automatically saved to the Convex database in real-time. You can safely close the app and resume quests later without losing progress.
- Immediate Writes: Location completions save instantly
- Cross-Device Sync: Progress syncs across all your devices
- No Manual Save: Everything is automatic
- Permanent History: Completed quests remain in your history forever
Best Practices
Complete Quests
Don’t leave quests partially complete. Finish all locations to earn the XP reward.
Track Your Stats
Monitor your completion rate and total XP to measure improvement over time.
Verify Photos
Ensure photo uploads succeed before moving to the next location. Failed uploads prevent progress.
Resume Quickly
In-progress quests can be resumed anytime. Don’t hesitate to pause and continue later.
Related Features
- Quests - Learn about quest structure and XP values
- Locations - Understand location completion tracking
- Leaderboard - See how your progress compares to others