tia/src/lib/milestones.ts
Mannu 291eb4793b feat(g5-g6): age-aware UX + mama affiliate page
G5 — Age-Aware UX:
- useStageCheck hook: maps birth date → BabyStage (newborn/infant/sitter/crawler/toddler/walker)
- Time-of-day fast-log suggestion chip on home page (time × stage matrix)
- Milestones page: 25 WHO/AAP milestones, category filter, progress bar, inline date picker
- Milestones API: GET (merged definitions + achievements), POST (upsert), DELETE (un-mark)
- DB: milestone_achievements table with unique(child_id, milestone_key)
- Milestones 🌟 added to menu

G6 — Mama Affiliate Page:
- member_profiles, recommended_products, product_clicks tables
- /api/profile CRUD (GET/PUT), /api/profile/products (GET/POST/PATCH/DELETE)
- Public routes: /api/profile/[slug] and /api/profile/[slug]/click (IP hashed)
- /settings/profile: slug + bio editor, product list with ↑↓ reorder + click counts
- /m/[slug]: beautiful public page (gradient bg, product grid, Shop → click tracking)
- Settings page link to profile setup

DB migrations: 0014_milestones, 0015_affiliate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 00:59:17 +05:30

43 lines
4.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export interface MilestoneDef {
key: string;
label: string;
ageMonths: number;
ageRangeLabel: string;
category: "social" | "motor" | "language" | "cognitive";
emoji: string;
}
export const MILESTONES: MilestoneDef[] = [
// 12 months
{ key: "lifts_head", label: "Lifts head briefly", ageMonths: 1, ageRangeLabel: "1 month", category: "motor", emoji: "💪" },
{ key: "social_smile", label: "Social smile", ageMonths: 2, ageRangeLabel: "2 months", category: "social", emoji: "😊" },
{ key: "follows_movement", label: "Follows movement with eyes", ageMonths: 2, ageRangeLabel: "2 months", category: "cognitive",emoji: "👁️" },
// 34 months
{ key: "coos", label: "Coos and makes sounds", ageMonths: 3, ageRangeLabel: "3 months", category: "language", emoji: "🗣️" },
{ key: "recognizes_faces", label: "Recognizes familiar faces", ageMonths: 3, ageRangeLabel: "3 months", category: "social", emoji: "👨‍👩‍👧" },
{ key: "holds_head_steady", label: "Holds head steady", ageMonths: 4, ageRangeLabel: "4 months", category: "motor", emoji: "🦒" },
{ key: "laughs", label: "Laughs out loud", ageMonths: 4, ageRangeLabel: "4 months", category: "social", emoji: "😂" },
// 56 months
{ key: "reaches_objects", label: "Reaches for objects", ageMonths: 5, ageRangeLabel: "5 months", category: "cognitive",emoji: "✋" },
{ key: "rolls_over", label: "Rolls over (front to back)", ageMonths: 5, ageRangeLabel: "5 months", category: "motor", emoji: "🔄" },
{ key: "sits_with_support", label: "Sits with support", ageMonths: 6, ageRangeLabel: "6 months", category: "motor", emoji: "🧸" },
// 79 months
{ key: "sits_without_support",label: "Sits without support", ageMonths: 7, ageRangeLabel: "7 months", category: "motor", emoji: "🧘" },
{ key: "babbles", label: "Babbles (mama/dada sounds)", ageMonths: 8, ageRangeLabel: "8 months", category: "language", emoji: "👶" },
{ key: "object_permanence", label: "Understands object permanence", ageMonths: 9, ageRangeLabel: "9 months", category: "cognitive",emoji: "🎭" },
// 912 months
{ key: "crawls", label: "Crawls", ageMonths: 9, ageRangeLabel: "9 months", category: "motor", emoji: "🐛" },
{ key: "pulls_to_stand", label: "Pulls to standing", ageMonths: 10, ageRangeLabel: "10 months", category: "motor", emoji: "🏋️" },
{ key: "pincer_grasp", label: "Pincer grasp (finger + thumb)", ageMonths: 10, ageRangeLabel: "10 months", category: "motor", emoji: "🤏" },
{ key: "waves_bye", label: "Waves bye-bye", ageMonths: 10, ageRangeLabel: "10 months", category: "social", emoji: "👋" },
{ key: "first_word", label: "First real word", ageMonths: 12, ageRangeLabel: "12 months", category: "language", emoji: "💬" },
// 1218 months
{ key: "walks", label: "Walks independently", ageMonths: 12, ageRangeLabel: "12 months", category: "motor", emoji: "🚶" },
{ key: "uses_cup", label: "Drinks from cup", ageMonths: 12, ageRangeLabel: "12 months", category: "motor", emoji: "🥤" },
{ key: "points_to_things", label: "Points to show interest", ageMonths: 14, ageRangeLabel: "14 months", category: "language", emoji: "👆" },
{ key: "ten_words", label: "10+ words", ageMonths: 18, ageRangeLabel: "18 months", category: "language", emoji: "🗨️" },
// 1824 months
{ key: "runs", label: "Runs", ageMonths: 18, ageRangeLabel: "18 months", category: "motor", emoji: "🏃" },
{ key: "pretend_play", label: "Pretend play (feeds doll etc)", ageMonths: 18, ageRangeLabel: "18 months", category: "cognitive",emoji: "🎭" },
{ key: "two_word_phrases", label: "Two-word phrases", ageMonths: 24, ageRangeLabel: "24 months", category: "language", emoji: "💭" },
];