{"id":49606251,"url":"https://github.com/adityapandey-dev/codehabit","last_synced_at":"2026-05-04T13:07:20.403Z","repository":{"id":334179073,"uuid":"1140367863","full_name":"AdityaPandey-DEV/codeHabit","owner":"AdityaPandey-DEV","description":"CodeHabit Analytics is a full-stack platform for developers to analyze their daily habits and coding performance on LeetCode, featuring a unified dashboard, correlation engine, and deep LeetCode integration, built with Next.js and Tailwind CSS.","archived":false,"fork":false,"pushed_at":"2026-04-09T11:55:44.000Z","size":1149,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-09T13:24:50.313Z","etag":null,"topics":["analytics","correlation","full-stack","leetcode","nextjs","nodejs","postgresql","tailwindcss","typescript","web-development"],"latest_commit_sha":null,"homepage":"https://codehabit.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AdityaPandey-DEV.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-23T07:18:38.000Z","updated_at":"2026-04-09T11:56:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/AdityaPandey-DEV/codeHabit","commit_stats":null,"previous_names":["adityapandey-dev/code-habit-analytics","adityapandey-dev/codehabit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AdityaPandey-DEV/codeHabit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdityaPandey-DEV%2FcodeHabit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdityaPandey-DEV%2FcodeHabit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdityaPandey-DEV%2FcodeHabit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdityaPandey-DEV%2FcodeHabit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdityaPandey-DEV","download_url":"https://codeload.github.com/AdityaPandey-DEV/codeHabit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdityaPandey-DEV%2FcodeHabit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32608362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","correlation","full-stack","leetcode","nextjs","nodejs","postgresql","tailwindcss","typescript","web-development"],"created_at":"2026-05-04T13:07:19.423Z","updated_at":"2026-05-04T13:07:20.395Z","avatar_url":"https://github.com/AdityaPandey-DEV.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeHabit — Habit \u0026 Coding Analytics Platform\n\n**CodeHabit** (formerly CodeHabit) is a unified, serverless Next.js platform designed to be the ultimate productivity command center for developers. It helps you track your daily habits, monitor your LeetCode consistency, complete study diaries, and test your knowledge through core CS quizzes.\n\n![CodeHabit Dashboard](https://code-habit.vercel.app/opengraph-image.png)\n\n## 🌐 Live Demo\n\n**[code-habit.vercel.app](https://code-habit.vercel.app)**  \n*(Vercel URL renaming coming soon)*\n\n## ✨ Features\n\n| Module | Description |\n|--------|-------------|\n| **Dashboard** | Unified view with correlation charts, AI insights, LeetCode donut chart, and yearly heatmap |\n| **Habit Tracker** | Add / edit / delete habits, daily check-offs, streak tracking, 90-day calendar view |\n| **LeetCode Analytics** | Profile stats (Easy/Med/Hard), yearly 365-day submission heatmap, current streak |\n| **Quiz Assessment** | 10-question MCQs in Full Stack Dev, DBMS, and OS with timer and score tracking |\n| **Analytics** | 30-day habit vs. coding correlation with Pearson coefficient and AI-generated insights |\n| **Diary** | Daily journal entries, task management, and study timer |\n\n## 🏗️ Tech Stack\n\n- **Frontend**: Next.js 16 (React 19), Tailwind CSS v4, shadcn/ui, Recharts\n- **Backend**: Next.js API Routes (serverless)\n- **Database**: Vercel Postgres (PostgreSQL) via Prisma ORM\n- **Auth**: JWT (bcryptjs + jsonwebtoken)\n- **Deployment**: Vercel (single project)\n\n## 📁 Project Structure\n\n```\n├── prisma/\n│   ├── schema.prisma       # Database schema\n│   └── seed.ts             # Quiz question seeder (30 MCQs)\n├── src/\n│   ├── app/\n│   │   ├── api/            # Backend API routes (serverless)\n│   │   │   ├── auth/       # register, login, me\n│   │   │   ├── habits/     # CRUD + daily logging\n│   │   │   ├── leetcode/   # sync, stats, profile/[username]\n│   │   │   ├── quiz/       # questions, submit, results\n│   │   │   ├── analytics/  # dashboard correlation\n│   │   │   └── diary/      # entries, tasks, timer\n│   │   ├── auth/           # Login / Register page\n│   │   ├── habits/         # Habit tracker page\n│   │   ├── leetcode/       # LeetCode analytics page\n│   │   ├── quiz/           # Quiz + results pages\n│   │   ├── analytics/      # Analytics page\n│   │   ├── diary/          # Diary page\n│   │   └── page.tsx        # Dashboard\n│   ├── components/\n│   │   ├── Heatmap.tsx     # GitHub-style SVG heatmap\n│   │   ├── Sidebar.tsx     # Navigation sidebar\n│   │   └── ui/             # shadcn/ui components\n│   └── lib/\n│       ├── api.ts          # Axios client\n│       ├── auth.ts         # JWT utilities\n│       ├── prisma.ts       # Prisma singleton\n│       ├── leetcode.ts     # LeetCode GraphQL fetcher\n│       └── math.ts         # Correlation calculation\n```\n\n## 🛠️ Setup\n\n### Prerequisites\n- Node.js 18+\n- Vercel account with Postgres storage\n\n### Local Development\n\n```bash\nnpm install\n\n# Create .env.local with:\n# POSTGRES_PRISMA_URL=your_postgres_url\n# POSTGRES_URL_NON_POOLING=your_direct_url\n# JWT_SECRET=your_secret\n\nnpx prisma db push    # Create tables\nnpx prisma db seed    # Seed 30 quiz questions\nnpm run dev           # Start at localhost:3000\n```\n\n### Deploy to Vercel\n\n1. Push to GitHub\n2. Import project in Vercel\n3. Add Vercel Postgres from Storage tab\n4. Add `JWT_SECRET` environment variable\n5. Deploy — Prisma generates automatically via `postinstall`\n\n## 📝 API Endpoints\n\n| Method | Endpoint | Auth | Description |\n|--------|----------|------|-------------|\n| POST | `/api/auth/register` | ✗ | Register user |\n| POST | `/api/auth/login` | ✗ | Login |\n| GET | `/api/auth/me` | ✓ | Current user |\n| GET | `/api/habits` | ✓ | List habits with streaks |\n| POST | `/api/habits` | ✓ | Create habit |\n| PUT | `/api/habits/:id` | ✓ | Update habit |\n| DELETE | `/api/habits/:id` | ✓ | Delete habit |\n| POST | `/api/habits/:id/log` | ✓ | Log daily completion |\n| GET | `/api/leetcode/stats` | ✓ | Synced submission stats |\n| POST | `/api/leetcode/sync` | ✓ | Sync from LeetCode |\n| GET | `/api/leetcode/profile/:user` | ✓ | Profile + yearly heatmap |\n| GET | `/api/quiz/questions/:subject` | ✓ | Get 10 MCQs |\n| POST | `/api/quiz/submit` | ✓ | Submit and score quiz |\n| GET | `/api/quiz/results` | ✓ | Past results and stats |\n| GET | `/api/analytics/dashboard` | ✓ | 30-day correlation data |\n\n## 📄 License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityapandey-dev%2Fcodehabit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadityapandey-dev%2Fcodehabit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityapandey-dev%2Fcodehabit/lists"}