TekTree Functional Requirements
Version: 1.0.0 Last Updated: 2025-12-16 Status: Foundation (Pre-Implementation)Document Purpose
This document defines the functional requirements for TekTree, organized by domain and feature area. Each requirement includes user stories, acceptance criteria, and priority classification.Priority Classification
- P0 (Critical): MVP blocker, must have for launch
- P1 (High): Important for user experience, launch within 30 days
- P2 (Medium): Valuable enhancement, launch within 90 days
- P3 (Low): Nice to have, future consideration
1. User Management & Authentication
FR-1.1: User Registration
Priority: P0 User Story: As a new user, I want to create an account so that I can start building my knowledge tree. Acceptance Criteria:- User can register with email and password
- Email verification required before full access
- Password must meet complexity requirements (min 8 chars, 1 uppercase, 1 number, 1 special)
- Duplicate email detection with helpful error message
- Welcome email sent on successful registration
- Free tier subscription automatically created
- Initial 100 XP welcome bonus awarded
user.registereduser.email.verification.sentgamification.xp.earned(welcome bonus)
FR-1.2: User Authentication
Priority: P0 User Story: As a registered user, I want to log in securely so that I can access my personalized content. Acceptance Criteria:- Email + password authentication
- JWT access token (15min expiry) + refresh token (7 days expiry)
- Refresh token stored in HTTP-only cookie
- Failed login attempts tracked (max 5 attempts, 15min lockout)
- “Remember me” option extends refresh token to 30 days
- Logout invalidates tokens
user.authenticateduser.login.faileduser.locked.out
FR-1.3: User Profile Management
Priority: P0 User Story: As a user, I want to customize my profile so that others can learn about my expertise. Acceptance Criteria:- Editable fields: firstName, lastName, handle, image, bio
- Handle uniqueness validation
- Image upload (max 5MB, JPEG/PNG/WebP)
- Profile visibility settings (public, connections only, private)
- Profile view counter
- Public profile URL:
/u/:handle
user.profile.updateduser.handle.changeduser.avatar.uploaded
2. Knowledge Management
FR-2.1: Create Knowledge Areas
Priority: P0 User Story: As a user, I want to organize my knowledge into hierarchical areas so that I can structure my learning path. Acceptance Criteria:- Create top-level areas (e.g., “Programming”, “Design”)
- Create nested sub-areas (max depth: 5 levels)
- Area properties: title, description, tags, visibility
- Parent-child relationships with breadcrumb navigation
- Area URL:
/area/:id/:slug - Tag autocomplete based on popular tags
- Rich text editor for descriptions (Markdown support)
- Create first area: +10 XP
- Create area with 5+ sub-areas: +25 XP
knowledge.area.createdknowledge.area.updatedknowledge.area.moved(parent changed)
FR-2.2: Post Questions
Priority: P0 User Story: As a learner, I want to post questions in relevant areas so that I can get expert answers. Acceptance Criteria:- Question form: title, body, tags, area selection
- Attach files (max 10MB, PDF/images)
- Mark as public or private
- Question owner can accept best answer
- Question owner can close/reopen question
- Edit history tracked
- Question URL:
/question/:id/:slug
- Post first question: +5 XP
- Question receives 5+ upvotes: +20 XP
- Question marked as “quality” by moderator: +50 XP
knowledge.question.postedknowledge.question.editedknowledge.question.closedknowledge.answer.accepted
FR-2.3: Share Insights
Priority: P0 User Story: As an expert, I want to share insights in my areas of expertise so that I can contribute to the community. Acceptance Criteria:- Insight form: title, body, related areas, tags
- Attach resources (links, files, code snippets)
- Insight types: Article, Tutorial, Case Study, Tool Review
- Rich media embedding (YouTube, Twitter, GitHub Gists)
- Collaborative editing (co-authors)
- Version history
- Insight URL:
/insight/:id/:slug
- Publish first insight: +25 XP
- Insight gets 10+ likes: +50 XP
- Insight added to 5+ user pinboards: +100 XP
knowledge.insight.publishedknowledge.insight.updatedknowledge.insight.co-author.added
FR-2.4: Start Discussions
Priority: P1 User Story: As a user, I want to start discussions on topics I’m interested in so that I can engage with the community. Acceptance Criteria:- Discussion form: question, description, poll options (optional)
- Tag-based discovery
- Threaded comments (max depth: 3 levels)
- Pin important comments
- Mark discussion as resolved
- Follow/unfollow discussions
- Discussion URL:
/discussion/:id/:slug
- Start first discussion: +10 XP
- Discussion reaches 20+ comments: +30 XP
knowledge.discussion.startedknowledge.discussion.comment.addedknowledge.discussion.resolved
FR-2.5: Share Resources
Priority: P1 User Story: As a user, I want to curate and share valuable resources so that others can benefit from my findings. Acceptance Criteria:- Resource types: Link, Document, Video, Book, Course, Tool
- Metadata: title, description, URL, author, tags, areas
- Resource preview (Open Graph metadata)
- User ratings and reviews
- Resource collections (playlists)
- Resource URL:
/resource/:id/:slug
- Share first resource: +5 XP
- Resource receives 10+ saves: +20 XP
knowledge.resource.sharedknowledge.resource.ratedknowledge.resource.saved
3. Social Interactions
FR-3.1: Like Content
Priority: P0 User Story: As a user, I want to like valuable content so that I can show appreciation and help surface quality. Acceptance Criteria:- Like/unlike any content type (question, insight, discussion, resource)
- Like count displayed prominently
- User can view their liked content history
- Content author notified of likes (configurable)
- Prevent self-liking
- First like received: +2 XP
- 10th like: +10 XP
- 100th like: +50 XP
social.content.likedsocial.content.unliked
FR-3.2: Comment on Content
Priority: P0 User Story: As a user, I want to comment on content so that I can provide feedback and engage in discussions. Acceptance Criteria:- Comment on questions, insights, discussions, resources
- Threaded replies (max depth: 3 levels)
- Rich text formatting (Markdown)
- Edit comments within 15 minutes
- Delete own comments anytime
- Report inappropriate comments
- Comment URL: Direct link with anchor
#comment-:id
- First comment: +3 XP
- Comment receives 5+ likes: +10 XP
- Comment marked as “helpful” by author: +15 XP
social.comment.addedsocial.comment.editedsocial.comment.deletedsocial.comment.reported
FR-3.3: Vote on Content
Priority: P1 User Story: As a user, I want to upvote/downvote content so that quality content rises to the top. Acceptance Criteria:- Upvote/downvote on questions, answers, insights
- Vote changes allowed within 5 minutes
- Vote score = upvotes - downvotes
- Content sorted by vote score + recency algorithm
- Downvote requires reason selection (off-topic, low quality, spam)
- Voting power based on user reputation (min 50 XP to downvote)
- Net +5 votes: +10 XP
- Net +10 votes: +25 XP
- Net +50 votes: +100 XP
social.content.upvotedsocial.content.downvotedsocial.vote.changed
FR-3.4: Follow Users and Areas
Priority: P1 User Story: As a user, I want to follow interesting users and areas so that I stay updated on relevant content. Acceptance Criteria:- Follow/unfollow users
- Follow/unfollow areas
- Followers/following counts on profile
- Notification preferences per follow (all, important, none)
- Feed aggregation of followed content
- Feed URL:
/feed
- Get 10 followers: +25 XP
- Get 100 followers: +200 XP
social.user.followedsocial.user.unfollowedsocial.area.followed
4. Gamification Features
FR-4.1: XP (Experience Points) System
Priority: P0 User Story: As a user, I want to earn XP for my contributions so that my progress is recognized and I feel motivated. XP Earning Rules:| Action | XP Reward | Daily Cap |
|---|---|---|
| Sign up | +100 | One-time |
| Complete profile | +50 | One-time |
| Create area | +10 | 100 |
| Post question | +5 | 50 |
| Answer question | +10 | 200 |
| Publish insight | +25 | 500 |
| Start discussion | +10 | 100 |
| Share resource | +5 | 50 |
| Comment | +3 | 30 |
| Receive like (author) | +2 | 100 |
| Receive upvote (author) | +5 | 200 |
| Answer accepted | +50 | 500 |
| Streak bonus (7 days) | +100 | N/A |
- Real-time XP updates via WebSocket
- XP transaction history with details
- XP leaderboard (global, area-specific, weekly)
- XP displayed on user profile and avatar
- Daily cap prevents gaming system
- XP decay for inactive users (5% per month)
gamification.xp.earnedgamification.xp.transaction.recorded
FR-4.2: Levels and Progression
Priority: P0 User Story: As a user, I want to level up as I earn XP so that I can unlock new features and show my expertise. Level Progression:| Level | XP Required | Title | Unlocks |
|---|---|---|---|
| 1 | 0 | Seedling | Basic features |
| 2 | 100 | Sprout | Can upvote |
| 3 | 250 | Sapling | Can create areas |
| 4 | 500 | Young Tree | Can post insights |
| 5 | 1000 | Growing Tree | Can downvote |
| 10 | 5000 | Mature Tree | Moderator tools |
| 20 | 20000 | Wise Tree | Advanced analytics |
| 50 | 100000 | Ancient Tree | Elite badge |
- Level displayed on profile and all content contributions
- Level-up animation and notification
- Feature gating based on level
- Level-specific profile badges
- Level progression bar
gamification.level.up
FR-4.3: Achievement System
Priority: P0 User Story: As a user, I want to unlock achievements for milestones so that I feel a sense of accomplishment. Achievement Categories: Onboarding:- “First Steps” - Complete profile (+50 XP)
- “Tree Planter” - Create first area (+50 XP)
- “Curious Mind” - Post first question (+50 XP)
- “Helpful Helper” - 10 answers submitted (+100 XP)
- “Insight Master” - 5 insights published (+200 XP)
- “Resource Curator” - 20 resources shared (+150 XP)
- “Popular” - Get 100 followers (+200 XP)
- “Influencer” - Get 1000 followers (+1000 XP)
- “Liked” - Receive 100 likes (+150 XP)
- “Upvoted” - Receive 50 upvotes (+200 XP)
- “Accepted Answer” - 5 answers accepted (+300 XP)
- “Featured Insight” - Insight featured on homepage (+500 XP)
- “Week Warrior” - 7-day streak (+100 XP)
- “Month Champion” - 30-day streak (+500 XP)
- “Year Master” - 365-day streak (+5000 XP)
- Badge display on profile (showcase 5 favorite badges)
- Achievement unlock notification (real-time)
- Achievement progress tracking
- Rare/epic/legendary badge tiers
- Achievement leaderboard
gamification.achievement.unlockedgamification.achievement.progress.updated
FR-4.4: Leaderboards
Priority: P1 User Story: As a user, I want to see how I rank against others so that I can stay motivated and compete. Leaderboard Types:- Global XP leaderboard (all-time)
- Weekly XP leaderboard (resets Monday)
- Monthly XP leaderboard
- Area-specific leaderboards
- Contribution leaderboards (questions, insights, resources)
- Real-time leaderboard updates (WebSocket)
- Top 100 rankings displayed
- User’s current rank always visible
- Leaderboard filters (time range, area, contribution type)
- Opt-out option for privacy
- Leaderboard URL:
/leaderboard/:type
gamification.leaderboard.updatedgamification.leaderboard.rank.changed
FR-4.5: Streak Tracking
Priority: P1 User Story: As a user, I want to maintain daily activity streaks so that I stay engaged and build habits. Acceptance Criteria:- Daily activity counts if user performs any XP-earning action
- Streak counter on profile and dashboard
- Streak freeze (1 free day per 7-day streak)
- Streak milestones: 7, 30, 100, 365 days
- Streak recovery window (24 hours grace period)
- Push notification reminder if streak at risk
- 7-day streak: +100 XP
- 30-day streak: +500 XP
- 100-day streak: +2000 XP
- 365-day streak: +10000 XP
gamification.streak.extendedgamification.streak.brokengamification.streak.milestone
5. Monetization (Polar Integration)
FR-5.1: Subscription Tiers
Priority: P0 User Story: As a user, I want to choose a subscription tier that fits my needs so that I can access premium features. Tier Definitions:| Feature | Free | Pro ($9/mo) | Team ($29/mo) | Enterprise (Custom) |
|---|---|---|---|---|
| Areas | 10 | Unlimited | Unlimited | Unlimited |
| Questions/month | 20 | 200 | 500 | Unlimited |
| Insights/month | 5 | 50 | 100 | Unlimited |
| File storage | 100MB | 10GB | 100GB | Unlimited |
| API calls/day | 100 | 10,000 | 100,000 | Unlimited |
| Real-time collab | ❌ | ✅ | ✅ | ✅ |
| Advanced analytics | ❌ | ✅ | ✅ | ✅ |
| Priority support | ❌ | ✅ | ✅ | ✅ (24/7) |
| Custom branding | ❌ | ❌ | ✅ | ✅ |
| SSO | ❌ | ❌ | ✅ | ✅ |
| Dedicated account manager | ❌ | ❌ | ❌ | ✅ |
- Tier displayed on user profile
- Feature gates enforce tier limits
- Quota usage displayed in dashboard
- Upgrade/downgrade flows with proration
- 14-day free trial for Pro tier
- Annual billing discount (20% off)
payment.subscription.createdpayment.subscription.upgradedpayment.subscription.downgraded
FR-5.2: Polar Checkout Integration
Priority: P0 User Story: As a user, I want to securely purchase a subscription so that I can access premium features. Acceptance Criteria:- Polar checkout session created server-side
- Redirect to Polar-hosted checkout page
- Support payment methods: Card, PayPal, Apple Pay, Google Pay
- Handle successful payment callback
- Handle failed payment callback
- Send receipt email via Polar
- Activate subscription immediately on payment success
- User clicks “Upgrade to Pro”
- Backend creates Polar checkout session
- User redirected to Polar checkout
- User completes payment
- Polar sends webhook to backend
- Backend activates subscription
- User redirected to success page
payment.checkout.initiatedpayment.checkout.completedpayment.checkout.failed
FR-5.3: Usage Metering and Quotas
Priority: P0 User Story: As a free tier user, I want to know when I’m approaching my limits so that I can decide whether to upgrade. Acceptance Criteria:- Real-time quota tracking (questions, insights, storage)
- Usage warnings at 80% and 100% of quota
- Graceful degradation (soft limit → upgrade prompt)
- Usage reset on billing cycle
- Usage analytics dashboard
- Overage handling (block or allow with fee)
- 80% usage: Banner notification “You’ve used 8/10 areas”
- 100% usage: Modal blocking action with upgrade CTA
payment.quota.warningpayment.quota.exceededpayment.quota.reset
FR-5.4: Webhook Handling (Polar Events)
Priority: P0 User Story: As the system, I want to handle Polar webhooks reliably so that subscription state stays synchronized. Webhook Events Handled:checkout.completed→ Activate subscriptionsubscription.updated→ Update tier and quotassubscription.canceled→ Downgrade to free tierinvoice.paid→ Record paymentinvoice.payment_failed→ Send dunning emailsubscription.trial_ending→ Send reminder
- Webhook signature verification (Polar secret)
- Idempotent webhook processing (event ID tracking)
- Retry failed webhooks with exponential backoff
- Webhook event log for debugging
- Alert on webhook processing failures
payment.webhook.receivedpayment.webhook.processedpayment.webhook.failed
6. Real-Time Collaboration
FR-6.1: Live Presence Tracking
Priority: P1 User Story: As a user, I want to see who else is viewing the same content so that I can collaborate in real-time. Acceptance Criteria:- Show avatars of users currently viewing content
- Max 10 avatars displayed, “+N more” for overflow
- Presence timeout after 30 seconds of inactivity
- Privacy setting to hide presence
- Presence URL: WebSocket
/ws/presence/:contentId
realtime.user.joinedrealtime.user.left
FR-6.2: Real-Time Notifications
Priority: P1 User Story: As a user, I want to receive instant notifications so that I stay updated on important activity. Notification Types:- New comment on your content
- Your answer was accepted
- You earned an achievement
- Someone followed you
- You leveled up
- Your content was featured
- Subscription expiring soon
- Real-time delivery via WebSocket
- Notification bell icon with unread count
- Notification center with history (last 30 days)
- Mark as read functionality
- Notification preferences (email, push, in-app)
- Notification grouping (e.g., “5 new likes”)
notification.sentnotification.read
FR-6.3: Collaborative Editing (Future)
Priority: P3 User Story: As a co-author, I want to edit insights collaboratively in real-time so that we can work together efficiently. Acceptance Criteria:- Operational Transform (OT) or CRDT for conflict resolution
- Show cursor positions of other editors
- Character-level locking
- Edit history with conflict markers
- Permission model for co-authors
7. Search and Discovery
FR-7.1: Global Search
Priority: P1 User Story: As a user, I want to search across all content so that I can quickly find relevant information. Acceptance Criteria:- Full-text search across areas, questions, insights, discussions, resources
- Search filters: content type, date range, user, tags, area
- Search results ranked by relevance + popularity
- Search suggestions (autocomplete)
- Search history (last 10 searches)
- Search URL:
/search?q=:query
- Title match: High weight
- Body match: Medium weight
- Tag match: Medium-high weight
- Recency boost: Recent content +10%
- Popularity boost: High vote score +20%
FR-7.2: Content Recommendations
Priority: P2 User Story: As a user, I want to discover content based on my interests so that I continue learning. Acceptance Criteria:- Recommended areas based on activity
- Recommended questions to answer (based on expertise)
- Recommended insights to read (based on follows and likes)
- “Similar content” section on detail pages
- Personalized homepage feed
- Collaborative filtering (users with similar activity)
- Content-based filtering (tags, areas)
- Trending content (velocity of engagement)
8. Content Moderation
FR-8.1: Report Content
Priority: P1 User Story: As a user, I want to report inappropriate content so that the community stays safe and respectful. Acceptance Criteria:- Report reasons: Spam, Harassment, Off-topic, Misinformation, Other
- Report detail text field (optional)
- Anonymous reporting
- Reporter notified of action taken
- Report queue for moderators
moderation.content.reportedmoderation.report.reviewed
FR-8.2: Moderator Actions
Priority: P1 User Story: As a moderator, I want tools to manage content quality so that the platform maintains high standards. Moderator Actions:- Hide content (reversible)
- Delete content (permanent)
- Warn user
- Suspend user (temporary)
- Ban user (permanent)
- Feature content (homepage, area page)
- Merge duplicate questions
- Moderator dashboard with report queue
- Bulk actions on multiple items
- Moderation log (audit trail)
- Appeal process for users
- Moderator notes on content
moderation.content.hiddenmoderation.content.deletedmoderation.user.warnedmoderation.user.suspended
9. CV/Resume Builder
FR-9.1: Generate CV from Profile
Priority: P2 User Story: As a user, I want to generate a professional CV from my TekTree profile so that I can showcase my skills. Acceptance Criteria:- CV includes: education, experience, awards, skills, endorsements
- Multiple CV templates (Classic, Modern, Creative)
- Export formats: PDF, DOCX, Markdown
- Privacy controls (hide specific sections)
- Share CV via public URL:
/cv/:userId - Track CV views
cv.generatedcv.exportedcv.viewed
10. Analytics and Insights
FR-10.1: User Analytics Dashboard
Priority: P2 User Story: As a Pro user, I want to see analytics on my content so that I understand what resonates with the community. Metrics Displayed:- Content views (per item, aggregate)
- Engagement rate (likes, comments, votes per view)
- Follower growth over time
- XP earning trends
- Top-performing content
- Audience demographics (areas of interest)
- Date range selector (7d, 30d, 90d, all time)
- Exportable reports (CSV)
- Comparison to previous period
- Analytics URL:
/analytics
Summary: MVP Feature Scope
P0 (Critical) Features for MVP:- User registration, authentication, profile management
- Create areas, post questions, share insights, start discussions
- Like, comment, vote on content
- XP system, levels, achievements
- Leaderboards (global, weekly)
- Subscription tiers with Polar integration
- Usage metering and quotas
- Real-time notifications
- Global search
- Streak tracking
- Follow users/areas
- Content recommendations
- Moderation tools
- Live presence tracking
- CV builder
- Advanced analytics
- Collaborative editing
- Custom badges
Document Status: ✅ Complete Related Documents:
ARCHITECTURE_OVERVIEW.md, GAMIFICATION_SYSTEM.md, MONETIZATION_STRATEGY.md