Загрузка данных


Create a Habit Tracker app with smart analytics — an app that helps users build habits and shows them real, data-driven insights about how their habits connect to each other and to their wellbeing. This should feel like a premium, visual, motivating consumer product (think a mix of Apple Health, Duolingo, and Notion in polish), not a bare-bones checklist app.

=====================================================
SCREEN 0: WELCOME & PERSONAL PROFILE (first screen, before anything else)
=====================================================
A friendly, warm multi-step flow (one question per screen, animated progress dots, smooth transitions) collecting:
- Name (used to personalize greetings throughout the app)
- Age
- Gender (optional, with "prefer not to say")
- Main goal (single select: build healthier habits, be more productive, improve mental wellbeing, sleep better, get fit, general self-improvement, other)
- Biggest struggle (single select: staying consistent, lack of time, lack of motivation, forgetting, other) — used later to tailor notification tone
- Preferred wake-up time and bedtime — used for default reminder windows and later sleep-related correlations

Use the name immediately after entry (e.g. "Nice to meet you, [Name]! Let's pick your habits."). Store this in a `userProfile` object in the local database, separate from habit records, referenceable by any screen.

=====================================================
SCREEN 1: HABIT SELECTION
=====================================================
- Multi-select common habits with icons (sleep, water, exercise, reading, meditation, no sugar, journaling, screen time, etc.) plus a custom habit option with icon/color picker
- Lightly tailor which suggestions appear near the top based on the stated goal from Screen 0 (e.g. goal = "sleep better" → prioritize sleep/screen time/caffeine habits; goal = "get fit" → prioritize exercise/water/steps)
- For each chosen habit, ask: type (yes/no completion, or a number like hours/glasses/minutes), target frequency (daily, specific weekdays, X times/week), optional reminder time
- End with an animated summary "your plan" card showing the habits chosen

=====================================================
SCREEN 2: HOME / TODAY
=====================================================
- Greet the user by name and time of day (e.g. "Good morning, [Name]!")
- Today's habits as checkable cards (checkbox for yes/no, quick +/- or slider for measurable habits), each with its icon/color
- Animated streak counter per habit (flame-style), with a small snowflake icon showing streak-freeze status if used
- Circular progress ring showing today's overall completion percentage
- A dynamically generated "today's highlight" banner (e.g. "You're on a 12-day streak — your longest yet!")

=====================================================
SCREEN 3: CALENDAR / HISTORY
=====================================================
- Monthly calendar, heatmap-style color coding by daily completion percentage (like GitHub's contribution graph)
- Tapping a day expands to show which habits were done/missed, with icons
- Ability to edit past days retroactively

=====================================================
SCREEN 4: ANALYTICS (core complex feature — real statistics, not static/fake insights)
=====================================================
- Animated line/bar charts of completion rate per habit over time (weekly/monthly), using a proper charting library
- Calculate real correlations from the user's own logged data (compare Habit A's completion rate on days Habit B was/wasn't completed; only surface an insight if the difference is meaningful AND there are at least 14 days of data)
- Present insights as visually distinct "insight cards" (icon + short headline + small supporting chart), e.g.:
  - "Sleep boosts your exercise — you complete 'Exercise' 35% more often after 7+ hours of sleep"
  - "Weekend dip — completion drops from 78% (weekdays) to 45% (weekends)"
  - "Your longest streak: [habit], 23 days"
- Reference the user's name/goal in insight text to make it feel personal (e.g. "[Name], since your goal is better sleep — here's how your bedtime affects next-day habits")
- A "Weekly Report" card: overall completion %, best day, weakest habit, one key correlation insight — styled like a clean shareable infographic, exportable as an image
- Friendly empty-state illustration + message when there isn't enough data yet ("Log 6 more days to unlock your first insight")

=====================================================
SCREEN 5: HABIT DETAIL VIEW
=====================================================
- Full calendar history for that habit, current/longest streak with visual flame/trophy indicator, completion rate over 7/30/90 days as a chart, habit-specific insights
- A short "Did you know" card with a research-style note on habit formation, written in the app's own original words (not copied from any source)

=====================================================
ETHICAL ENGAGEMENT FEATURES (increase daily usage through genuine value, never anxiety or dark patterns)
=====================================================

**Streak Freeze**: `freezesAvailable` field per user, starts at 2, resets to 2 on the 1st of each month. If a day is missed and a freeze is available, auto-apply it, keep the streak intact, and show a calm banner: "We used a streak freeze to protect your [Habit] streak. X left this month." If no freeze available, reset the streak using neutral copy only (see below). Show freeze count near the streak counter (snowflake icon) and a simple freeze-usage log.

**Milestone Celebrations**: thresholds at 7, 14, 30, 50, 100, 200, 365 days. On hit, show a full-screen animated celebration (confetti + badge graphic via Lottie or Reanimated, not a static popup) with warm copy (e.g. "30 days strong! You've built real momentum with [Habit]."). Save every earned badge permanently to a "Badge Collection" screen with the date earned — badges are never removed, even if the streak later resets.

**Smart, Personalized Notifications**: store the timestamp of every log; after 7+ entries for a habit, calculate the user's typical logging time and schedule reminders around it instead of a generic fixed time. Adapt notification tone using the "biggest struggle" answer from Screen 0 (struggle = "forgetting" → practical reminders like "Quick reminder: log your habit"; struggle = "lack of motivation" → progress framing like "You're doing great — X day streak!"). Use a rotating pool of neutral/positive notification copy. Explicitly forbidden: countdown/urgency language, loss-framing ("don't lose your streak!"), shame language, repeated same-day nagging. Settings > Notifications must let the user toggle reminders per habit or disable all with one switch, no dark patterns.

**Neutral, Non-Punitive Streak Loss**: on reset, never use dramatic/punitive language — only neutral/encouraging copy (e.g. "Your streak reset — every day is a fresh start." / "Streak restarted. Your best streak (X days) is still saved below."). Always show best-ever streak alongside current streak. No red warning colors, no sad icons, no blocking popups on loss.

**Transparent, Easy Controls**: Settings must clearly expose (not bury) options to pause a habit, delete a habit, export personal data, and delete the account. Deletion requires only a single clear confirmation step, no guilt-trip messaging, no retention offers.

**Weekly Reflection**: once a week (user-configurable day), an optional/skippable card: "How do you feel about your week?" with 5 emoji-style mood options and an optional short note. Never mandatory, never blocks usage. Store history and show it as a simple timeline in Analytics.

=====================================================
VISUAL DESIGN REQUIREMENTS
=====================================================
- Distinctive, cohesive color palette and design system (not default framework colors) — soft gradients, one accent color per habit category
- Icon + optional color tag for every habit (use a rich icon library)
- Smooth animations: satisfying check-off animation, animated streak counter, celebration animations for milestones
- Card-based layouts, soft shadows/rounded corners, generous spacing, clear typography hierarchy
- Light mode and dark mode toggle
- Friendly illustrations for empty states (no habits yet, not enough data yet)

=====================================================
TECHNICAL REQUIREMENTS
=====================================================
- Cross-platform mobile app (iOS and Android) — I will run and test it on my own phone via Expo Go during development
- Proper charting library capable of styled, animated charts
- Rich icon library for habit categories
- Local, offline-first database with a clean schema (userProfile, habits, logs, streaks/freezes, badges, reflections) structured so it could later sync to a backend
- Language setting to switch interface language (at minimum English and Russian), all UI text stored in translation files, not hardcoded
- Prioritize a cohesive, premium visual identity over generic default component styling — this should look like a real polished consumer app, not a prototype

=====================================================
BUILD ORDER
=====================================================
First describe the full app architecture (screens, data model, correlation/insights algorithm, charting/icon libraries, local storage approach). Then build step by step, starting with the simplest working skeleton: Screen 0 (Personal Profile) → Screen 1 (Habit Selection) → Screen 2 (Today), fully styled per the visual requirements above, not bare-bones. After that we will add the Calendar, then the Analytics/Insights engine, then the ethical engagement features, then the shareable Weekly Report — one step at a time, confirming each works before moving to the next.