How chaitanya-361/velvet-streak works
Velvet Streak is a full-stack habit-tracking app: users authenticate, create scheduled habits, record check-ins, and see streaks, XP, badges, and analytics. The React client also supports task management, profile/settings, and a focus timer; the Express API applies domain logic and persists records in MongoDB. The graph preserves the README’s major product branches. Several controllers and page implementations were not sampled, so some documented feature links are intentionally shown only at the client/API boundary.
Main entry points: App.tsx App routes · app.ts Express app · checkin.controller.ts Check-in workflow · gamification.service.ts XP and badges
Components 34
React client
- App routes
client/src/App.tsx - Auth context
client/src/context/AuthContext.tsx - API client
client/src/api/client.ts - Habit wizard
client/src/pages/HabitWizardPage.tsx - Habit dashboard
client/src/pages/HomePage.tsx - Habit detail
client/src/pages/HabitDetailPage.tsx - Task manager
client/src/pages/TodoPage.tsx - Analytics view
client/src/pages/StatsPage.tsx - Focus timer
client/src/pages/ZenModePage.tsx - Profile
client/src/pages/ProfilePage.tsx - Settings
client/src/pages/SettingsPage.tsx - Login and register
client/src/pages/LoginPage.tsx - Habit API
client/src/api/habits.ts - Task API
client/src/api/todos.ts - Stats API
client/src/api/stats.ts - Focus API
client/src/api/zen.ts
API and domain
- Express app
server/src/app.ts - Authentication
server/src/controllers/auth.controller.ts - Habit management
server/src/controllers/habit.controller.ts - Check-in workflow
server/src/controllers/checkin.controller.ts - XP and badges
server/src/services/gamification.service.ts - Date scheduling
server/src/services/dayBoundary.service.ts - Task management
server/src/controllers/todo.controller.ts - Analytics
server/src/controllers/stats.controller.ts - Focus sessions
server/src/controllers/zen.controller.ts - User settings
server/src/controllers/user.controller.ts - Request authentication
server/src/middleware/auth.ts
Persistent records
- MongoDB
server/src/config/db.ts - User records
server/src/models/User.ts - Habit records
server/src/models/Habit.ts - Check-in records
server/src/models/CheckIn.ts - Task records
server/src/models/Todo.ts - Badge records
server/src/models/Badge.ts
Other components
- User
Connections 47
- User → App routes: uses
- App routes → Auth context: checks session
client/src/App.tsx - App routes → Habit dashboard: routes to
client/src/App.tsx - App routes → Habit wizard: routes to
client/src/App.tsx - App routes → Habit detail: routes to
client/src/App.tsx - App routes → Task manager: routes to
client/src/App.tsx - App routes → Analytics view: routes to
client/src/App.tsx - App routes → Focus timer: routes to
client/src/App.tsx - App routes → Profile: routes to
client/src/App.tsx - App routes → Settings: routes to
client/src/App.tsx - App routes → Login and register: routes to
client/src/App.tsx - Auth context → API client: calls
client/src/context/AuthContext.tsx - Login and register → Auth context: authenticates via
- Habit wizard → Habit API: submits habit
- Habit dashboard → Habit API: loads habits
- Habit detail → Habit API: loads detail
- Task manager → Task API: manages tasks
- Analytics view → Stats API: loads analytics
- Focus timer → Focus API: saves and loads
client/src/pages/ZenModePage.tsx - Profile → API client: loads profile
- Settings → API client: updates preferences
- API client → Express app: HTTP requests
- Express app → Authentication: mounts auth routes
server/src/app.ts - Express app → Habit management: mounts habit routes
server/src/app.ts - Express app → Check-in workflow: mounts check-in routes
server/src/app.ts - Express app → Task management: mounts task routes
server/src/app.ts - Express app → Analytics: mounts stats routes
server/src/app.ts - Express app → Focus sessions: mounts focus routes
server/src/app.ts - Express app → User settings: mounts user routes
server/src/app.ts - Habit management → Request authentication: protected by
server/src/routes/habit.routes.ts - Authentication → User records: reads and writes
server/src/controllers/auth.controller.ts - Check-in workflow → User records: reads user
server/src/controllers/checkin.controller.ts - Check-in workflow → Habit records: reads and updates
server/src/controllers/checkin.controller.ts - Check-in workflow → Check-in records: creates and queries
server/src/controllers/checkin.controller.ts - Check-in workflow → Date scheduling: computes date
server/src/controllers/checkin.controller.ts - Check-in workflow → XP and badges: awards XP and badges
server/src/controllers/checkin.controller.ts - XP and badges → User records: updates XP
server/src/services/gamification.service.ts - XP and badges → Habit records: checks streaks
server/src/services/gamification.service.ts - XP and badges → Check-in records: counts check-ins
server/src/services/gamification.service.ts - XP and badges → Task records: counts completed
server/src/services/gamification.service.ts - XP and badges → Badge records: evaluates achievements
server/src/services/gamification.service.ts - Express app → MongoDB: connects on startup
server/src/server.ts - MongoDB → User records: persists models
- MongoDB → Habit records: persists models
- MongoDB → Check-in records: persists models
- MongoDB → Task records: persists models
- MongoDB → Badge records: persists models