A free, open-source, minimalist habit tracker. Define custom routines, track daily habits, and visualize your progress with streaks, charts, and contribution heatmaps.
Built with Next.js 16, React 19, PostgreSQL, Prisma, and Tailwind CSS v4.
- Habit CRUD — Create, edit, toggle, and delete habits with custom icons and colors
- Daily Tracking — Log completions each day with configurable rep targets
- Streak Tracking — Automatic current and longest streak calculation
- Visual Analytics
- Weekly Bar Chart — Completed vs. total habits for the last 7 days
- Contribution Heatmap — GitHub-style 90-day activity grid
- Stats Cards — Current streak, completion rate, longest streak, total days tracked
- Authentication — Email/password auth via Better Auth
- Responsive Dark Theme — Built with Tailwind CSS v4 and shadcn/ui
- JSON Routines — Define habits via JSON configuration
| Layer | Technology |
|---|---|
| Framework | Next.js 16.1.6 (App Router) |
| Frontend | React 19.2.3, Tailwind CSS v4, shadcn/ui |
| Backend | Next.js API Routes |
| Database | PostgreSQL + Prisma ORM 7.3 |
| Auth | Better Auth 1.4 (email/password) |
| Validation | Zod 4 + React Hook Form |
| Icons | Lucide React, React Icons (Font Awesome) |
| Deploy | Netlify |
- Node.js 20+
- PostgreSQL database
- npm
git clone https://github.com/your-username/habiterr.git
cd habiterr
npm installCreate a .env file in the project root:
DATABASE_URL="postgresql://user:password@localhost:5432/habiterr"
BETTER_AUTH_SECRET="your-secret-key"
BETTER_AUTH_URL="http://localhost:3000"Generate a secret:
openssl rand -hex 32npx prisma generate
npx prisma migrate devnpm run devOpen http://localhost:3000.
| Method | Endpoint | Description |
|---|---|---|
GET |
/api |
Health check |
POST |
/api/auth/[...all] |
Better Auth handler (login, signup, session) |
GET, POST, PUT, DELETE |
/api/habits |
Habit CRUD |
PATCH, DELETE |
/api/habits/[id] |
Single habit update/delete |
GET, POST, DELETE |
/api/activity |
Daily activity logs |
PATCH |
/api/activity/[id] |
Update single activity |
GET, POST |
/api/stats |
User stats (streaks, completion) |
PATCH |
/api/stats/[id] |
Update single stats record |
- User — Account management via Better Auth
- Session — Auth sessions
- Account — Auth provider accounts
- Verification — Email verification tokens
- Habit — User-defined habits (name, reps, icon, color, optional routine)
- Routine — Groups of habits with optional auto-increment settings
- Activity — Daily completion logs (completed / total per day)
- Stats — Streak and completion snapshots
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm start |
Start production server |
npm run lint |
Run ESLint |
The project includes a netlify.toml for one-click deployment to Netlify.
- Push to GitHub
- Connect repo on Netlify
- Set environment variables (
DATABASE_URL,BETTER_AUTH_SECRET,BETTER_AUTH_URL) - Deploy
This is a community-driven project. Feel free to open issues and pull requests on GitHub.
MIT