How nitish-kumar777/helth-tracker works
Habit Tracker is a full-stack productivity app: users register and authenticate, define habits, record daily progress, then review streaks, accuracy, calendar views, analytics, and badges. Account settings support email/password changes, verification, recovery, and avatar uploads. The dashboard is the main user-facing layer; API routes own authentication, habit operations, statistics, badges, and settings, with Prisma-backed persistence and optional email and Cloudinary services. UI-to-API wiring is not shown in the excerpts, so those documented feature links cite the README; unsampled route details are represented at their exact tree paths.
Main entry points: settings Profile & settings · [...nextauth]/route.js Credentials & sessions · create-acc/route.js Account workflows · stats/route.js Streaks & statistics
Components 30
Identity & Account
- Sign-in & recovery
app/login/page.js - Registration
app/register/page.jsx - Reset password
app/reset-password/page.jsx - Credentials & sessions
app/api/auth/[...nextauth]/route.js - Account workflows
app/api/auth/create-acc/route.js - Profile & settings
app/api/settings
Habit Tracking
- Habit definitions
app/api/habits/new/route.js - Daily log operations
app/api/habits/log/route.js
Progress & Insights
- Streaks & statistics
app/api/stats/route.js - Badge awards
app/api/badges/route.js
Dashboard UI
- Account settings UI
app/dashboard/settings/page.jsx - Habit management
app/dashboard/habits - Daily habit logging
app/dashboard/habits/log/page.jsx - Dashboard overview
app/dashboard/page.jsx - Calendar heatmap
app/dashboard/components/Calendar.jsx - Calendar page
app/dashboard/calendar/page.jsx - Analytics & reports
app/dashboard/analytics/page.jsx - Insights
app/dashboard/insights/page.jsx - Dashboard shell
app/dashboard/layout.jsx - Dashboard header
app/dashboard/components/Header.jsx - Dashboard navigation
app/dashboard/components/Sidebar.jsx
Shared Services
- Session provider
app/SessionProvider/provider.js - User context
context/UserContext.jsx - Prisma client
lib/prisma.js - Transactional email
lib/email.js - Avatar upload client
lib/cloudinary.js
Other components
- Habit tracker
- MongoDB
- SMTP service
- Cloudinary
Connections 37
- Habit tracker → Registration: registers
README.md - Habit tracker → Sign-in & recovery: signs in
README.md - Habit tracker → Reset password: recovers account
README.md - Registration → Account workflows: creates account
README.md - Sign-in & recovery → Credentials & sessions: authenticates
README.md - Reset password → Account workflows: requests recovery
README.md - Credentials & sessions → MongoDB: reads user
app/api/auth/[...nextauth]/route.js - Account workflows → MongoDB: persists account
- Habit tracker → Habit management: manages habits
README.md - Habit management → Habit definitions: manages definitions
README.md - Habit tracker → Daily habit logging: logs habits
README.md - Daily habit logging → Daily log operations: records progress
README.md - Habit definitions → MongoDB: reads and writes
app/api/habits/new/route.js - Daily log operations → MongoDB: reads and writes
app/api/habits/log/route.js - Habit tracker → Dashboard overview: reviews progress
README.md - Dashboard overview → Streaks & statistics: shows statistics
- Habit tracker → Calendar page: views calendar
README.md - Calendar page → Calendar heatmap: renders calendar
app/dashboard/calendar/page.jsx - Habit tracker → Analytics & reports: reviews reports
README.md - Analytics & reports → Streaks & statistics: loads analytics
- Habit tracker → Insights: reviews insights
- Streaks & statistics → MongoDB: reads and persists stats
app/api/stats/route.js - Habit tracker → Badge awards: checks badges
README.md - Badge awards → MongoDB: reads and awards
app/api/badges/route.js - Dashboard shell → Dashboard header: renders
app/dashboard/layout.jsx - Dashboard shell → Dashboard navigation: renders
app/dashboard/layout.jsx - Account settings UI → Profile & settings: updates account
README.md - Profile & settings → Credentials & sessions: checks session
app/api/settings/send-code/route.js - Profile & settings → MongoDB: reads and updates
app/api/settings/change-email/route.js - Profile & settings → Transactional email: sends verification codes
app/api/settings/send-code/route.js - Transactional email → SMTP service: delivers email
lib/email.js - Profile & settings → Avatar upload client: uploads avatar
app/api/settings/upload-avatar/route.js - Avatar upload client → Cloudinary: stores image
- Profile & settings → Prisma client: uses shared client
app/api/settings/send-code/route.js - Prisma client → MongoDB: connects to
- Session provider → Credentials & sessions: provides sessions
- User context → Session provider: reads session