Turn your daily goals and habits into an epic quest.
Earn XP, unlock rewards, and restrict distractions through a fully gamified productivity system that syncs across web and mobile.
Features โข Architecture โข Tech Stack โข Getting Started โข Roadmap
LifeQuest is a self-gamification platform that transforms productivity into an engaging RPG experience. Manage your goals, track your progress, and control your distractions while earning XP and unlocking rewards.
- ๐ฏ Goal-Oriented: Break down big goals into achievable daily tasks
- ๐ Reward System: Earn XP and unlock real-world or digital rewards
- ๐ Distraction Control: Lock apps until you've earned enough XP
- ๐ Progress Tracking: Visualize streaks, consistency, and achievements
- โ๏ธ Cross-Platform: Seamless sync between web and mobile
- Create goals and break them into daily or weekly tasks
- Earn XP for each completed task
- Track streaks, consistency, and progress over time
- Set deadlines and receive smart reminders
- Define custom rewards (e.g., "1 hour Netflix access" or "15 min gaming")
- Spend XP to unlock rewards
- Optional: Lock distracting apps until you earn enough XP
- Create reward tiers for bigger achievements
- Restrict or unlock apps (e.g., social media) based on backend progress
- Android: Uses Accessibility and Usage APIs for app blocking
- iOS: Limited support through Screen Time API / Shortcuts integration
- Customizable app lock schedules and XP thresholds
- Levels & XP: Progressive difficulty with XP thresholds
- Streak Bonuses: Extra XP for maintaining daily consistency
- Badges & Achievements: Unlock special rewards for milestones
- Reward Shop: Spend XP on privileges and unlocks
- Leaderboards: (Future) Compete with friends
- Manage everything from an intuitive web interface
- Visualize XP, streaks, goals, and task statistics
- Real-time sync with your mobile app
- Dark mode support for late-night productivity
graph TB
subgraph "Client Layer"
A[Web App<br/>Next.js + React]
B[Mobile App<br/>React Native / Flutter]
end
subgraph "API Layer"
C[Backend Server<br/>Node.js + Express]
D[GraphQL / REST API]
end
subgraph "Data Layer"
E[(Database<br/>PostgreSQL / MongoDB)]
F[Firebase<br/>Auth + Notifications]
end
subgraph "Business Logic"
G[Gamification Engine<br/>XP, Levels, Rewards]
H[App Lock Controller<br/>Mobile Integration]
end
A -->|API Requests| D
B -->|API Requests| D
D --> C
C --> G
C --> E
C --> F
G --> E
B --> H
H -->|Sync Status| C
F -->|Push Notifications| A
F -->|Push Notifications| B
style A fill:#4CAF50
style B fill:#2196F3
style C fill:#FF9800
style E fill:#9C27B0
style G fill:#F44336
- User Action: Complete a task on web or mobile
- API Call: Send completion event to backend
- Gamification Engine: Calculate XP, update level, check streaks
- Database Update: Persist progress and unlock status
- Sync: Push updates to all connected devices
- App Control: Update lock/unlock status on mobile
| Layer | Technologies |
|---|---|
| Frontend (Web) | Next.js 14, React 18, TailwindCSS, shadcn/ui |
| Backend | Node.js 18+, Express.js, GraphQL (optional) |
| Database | PostgreSQL / Supabase / Firebase Firestore |
| Mobile App | React Native / Flutter |
| Authentication | Firebase Auth / Auth0 / Supabase Auth |
| Real-time Sync | Firebase Cloud Messaging / WebSockets |
| Hosting | Vercel (Frontend), Render / Railway (Backend) |
| DevOps | Docker, GitHub Actions, ESLint, Prettier |
Click to expand database structure
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
email VARCHAR(255) UNIQUE NOT NULL,
name VARCHAR(255) NOT NULL,
level INTEGER DEFAULT 1,
total_xp INTEGER DEFAULT 0,
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
);CREATE TABLE goals (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID REFERENCES users(id) ON DELETE CASCADE,
title VARCHAR(255) NOT NULL,
description TEXT,
type VARCHAR(50), -- daily, weekly, monthly, custom
target_date DATE,
status VARCHAR(50) DEFAULT 'active', -- active, completed, archived
created_at TIMESTAMP DEFAULT NOW()
);CREATE TABLE tasks (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
goal_id UUID REFERENCES goals(id) ON DELETE CASCADE,
title VARCHAR(255) NOT NULL,
description TEXT,
due_date TIMESTAMP,
xp_value INTEGER DEFAULT 10,
status VARCHAR(50) DEFAULT 'pending', -- pending, completed, failed
completed_at TIMESTAMP,
created_at TIMESTAMP DEFAULT NOW()
);CREATE TABLE rewards (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID REFERENCES users(id) ON DELETE CASCADE,
name VARCHAR(255) NOT NULL,
description TEXT,
cost INTEGER NOT NULL, -- XP cost
type VARCHAR(50), -- unlock, privilege, physical
status VARCHAR(50) DEFAULT 'locked', -- locked, unlocked, redeemed
created_at TIMESTAMP DEFAULT NOW()
);CREATE TABLE progress (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID REFERENCES users(id) ON DELETE CASCADE,
current_xp INTEGER DEFAULT 0,
streak_days INTEGER DEFAULT 0,
last_task_date DATE,
updated_at TIMESTAMP DEFAULT NOW()
);CREATE TABLE app_locks (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID REFERENCES users(id) ON DELETE CASCADE,
app_name VARCHAR(255) NOT NULL,
package_name VARCHAR(255), -- Android package name
is_locked BOOLEAN DEFAULT true,
unlock_xp_threshold INTEGER DEFAULT 50,
created_at TIMESTAMP DEFAULT NOW()
);View API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/auth/register |
POST | Register new user |
/api/auth/login |
POST | Login user |
/api/auth/logout |
POST | Logout user |
/api/auth/refresh |
POST | Refresh auth token |
| Endpoint | Method | Description |
|---|---|---|
/api/users/me |
GET | Get current user profile |
/api/users/me |
PUT | Update user profile |
/api/users/me/stats |
GET | Get user statistics |
| Endpoint | Method | Description |
|---|---|---|
/api/goals |
GET | List all goals |
/api/goals |
POST | Create new goal |
/api/goals/:id |
GET | Get goal details |
/api/goals/:id |
PUT | Update goal |
/api/goals/:id |
DELETE | Delete goal |
| Endpoint | Method | Description |
|---|---|---|
/api/tasks |
GET | List all tasks |
/api/tasks |
POST | Create new task |
/api/tasks/:id |
GET | Get task details |
/api/tasks/:id |
PUT | Update task |
/api/tasks/:id |
DELETE | Delete task |
/api/tasks/:id/complete |
POST | Mark task as complete |
| Endpoint | Method | Description |
|---|---|---|
/api/rewards |
GET | List all rewards |
/api/rewards |
POST | Create new reward |
/api/rewards/:id |
PUT | Update reward |
/api/rewards/:id |
DELETE | Delete reward |
/api/rewards/:id/unlock |
POST | Unlock reward with XP |
| Endpoint | Method | Description |
|---|---|---|
/api/progress |
GET | Get user progress |
/api/progress/xp |
POST | Add XP (internal) |
/api/progress/streak |
GET | Get streak information |
| Endpoint | Method | Description |
|---|---|---|
/api/locks |
GET | Get all app locks |
/api/locks |
POST | Create app lock |
/api/locks/:id |
PUT | Update lock status |
/api/locks/:id |
DELETE | Remove app lock |
/api/locks/sync |
GET | Sync lock status |
- Node.js 18+ and npm/yarn
- PostgreSQL 14+ (or MongoDB 6+)
- Git
# 1. Clone the repository
git clone https://github.com/yourusername/lifequest.git
cd lifequest
# 2. Install dependencies for all packages
npm install
# 3. Set up environment variables
cp .env.example .env
# Edit .env with your database credentials and API keys
# 4. Set up the database
npm run db:setup
# 5. Start the development servers
npm run devlifequest/
โโโ README.md
โโโ package.json
โโโ .env.example
โโโ docs/
โ โโโ API.md # API documentation
โ โโโ ARCHITECTURE.md # System architecture details
โ โโโ CONTRIBUTING.md # Contribution guidelines
โโโ frontend/ # Next.js web dashboard
โ โโโ src/
โ โ โโโ app/ # Next.js 14 app directory
โ โ โโโ components/ # React components
โ โ โโโ lib/ # Utilities and helpers
โ โ โโโ styles/ # Global styles
โ โโโ package.json
โ โโโ next.config.js
โโโ backend/ # Node.js Express backend
โ โโโ src/
โ โ โโโ controllers/ # Route controllers
โ โ โโโ models/ # Database models
โ โ โโโ routes/ # API routes
โ โ โโโ middleware/ # Express middleware
โ โ โโโ services/ # Business logic
โ โ โโโ utils/ # Utility functions
โ โโโ package.json
โ โโโ server.js
โโโ mobile/ # React Native app
โ โโโ src/
โ โ โโโ screens/ # App screens
โ โ โโโ components/ # React Native components
โ โ โโโ navigation/ # Navigation setup
โ โ โโโ services/ # API services
โ โโโ android/ # Android-specific code
โ โโโ ios/ # iOS-specific code
โ โโโ package.json
โโโ shared/ # Shared types and utilities
โโโ types/ # TypeScript types
โโโ constants/ # Shared constants
- Define XP, levels, and reward system logic
- Design database schema
- Set up project structure
- Set up backend (API + database + auth)
- Implement CRUD for goals, tasks, and rewards
- Create basic gamification engine
- Build Next.js frontend with TypeScript
- Implement authentication flow
- Create dashboard with progress tracking
- Build goal and task management UI
- Add reward shop interface
- Integrate with backend API
- Create React Native app structure
- Implement authentication
- Build task completion interface
- Connect with backend API
- Implement app lock/unlock logic (Android first)
- Add push notifications
- Add streak tracking and bonuses
- Implement badge system
- Create reward shop with XP spending
- Build level-up system with animations
- Add achievement notifications
- Create daily/weekly challenges
- Smart task suggestions using ML
- Habit analysis and productivity insights
- Personal AI productivity coach
- Social features and leaderboards
- Integration with Google Calendar / Notion
- Browser extension for web blocking
- Sync Status: Mobile app syncs user's XP & lock status from backend
- Monitor Launches: Accessibility Service monitors app launches in real-time
- Check Threshold: When locked app is launched, check if XP threshold is met
- Block or Allow:
- โ If XP < threshold โ Show motivational overlay and block access
- โ If XP โฅ threshold โ Allow access and optionally deduct XP
- Update Backend: Sync unlock events back to server
// Android Accessibility Service (Simplified)
class AppLockService : AccessibilityService() {
override fun onAccessibilityEvent(event: AccessibilityEvent) {
if (event.eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
val packageName = event.packageName.toString()
if (isAppLocked(packageName)) {
val userXP = getUserXP()
val requiredXP = getRequiredXP(packageName)
if (userXP < requiredXP) {
blockApp(packageName)
showMotivationalOverlay()
}
}
}
}
}- ๐งฉ Integrations: Google Calendar, Notion, Todoist, Trello
- ๐บ๏ธ Social Features: Leaderboards, friend challenges, team quests
- ๐น๏ธ Browser Extension: Block websites based on XP status
- ๐ค AI Coach: Personalized productivity advisor
- ๐ Analytics: Advanced insights and habit patterns
- ๐จ Themes: Customizable UI themes and avatars
- ๐ Localization: Multi-language support
- ๐ฌ Community: Forums and shared quest templates
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This project draws inspiration from:
- Habitica โ Open-source gamified habit tracker with RPG elements
- Forest โ Focus app that rewards concentration time
- LevelUp Life โ Real-world RPG experience for personal development
- Beeminder โ Goal tracking with commitment contracts
- Todoist โ Task management with karma points
- ๐ง Email: support@lifequest.app
- ๐ฌ Discord: Join our community
- ๐ Issues: GitHub Issues
- ๐ Docs: Full Documentation
Made with โค๏ธ to level up your life
โญ Star this repo if you find it helpful!
Report Bug โข Request Feature โข Documentation