A gamified habit tracker with a 32-bit pixel aesthetic β build streaks, earn XP, and evolve your companion pet as you complete daily and weekly quests.
habitSync turns habit tracking into a game. Every completed habit ("quest") earns XP, XP levels up a pixel-art companion pet, and progress is visualized through chunky, retro-styled dashboards. The goal is to make consistency feel rewarding instead of like a chore.
The project is a TypeScript monorepo with a React SPA client and an Express + Supabase (PostgreSQL) backend, sharing a common data contract for habits between the two.
- Quest log β create, complete, and delete daily/weekly habits with instant, optimistic UI updates
- XP & pet evolution β completing habits earns XP that evolves a companion pet through multiple growth stages (Tiny Pup β Puppy β Dog)
- Progress dashboard β live completion rate, total/completed quest counts, and a pixel-styled progress bar
- Authentication β email/password signup and login backed by JWT sessions stored in HTTP-only cookies
- Light/dark theme β persisted per-browser via
localStorage - 32-bit design system β custom pixel typography (Press Start 2P), chunky 4px borders, and hard drop-shadows instead of soft gradients
| Layer | Technology |
|---|---|
| Client | React 19, TypeScript, Vite 8, React Router v6 |
| Server | Node.js, Express 5, TypeScript |
| Database | PostgreSQL via Supabase |
| Auth | JWT sessions, HTTP-only cookies, cookie-parser |
| HTTP client | Axios |
| Styling | Tailwind CSS v4 + custom pixel-art CSS |
| Animation | Framer Motion, canvas-confetti |
| Tooling | ESLint, Prettier, Vitest |
habitSync/
βββ client/ # React + Vite SPA
β βββ src/
β βββ app/ # App shell, root component, router
β βββ components/ # UI components (auth, habits, layout, pet, progress)
β βββ features/ # Feature-scoped API clients & types (auth, habits, pet)
β βββ hooks/ # Shared React hooks (e.g. theme)
β βββ pages/ # Route-level pages (Dashboard, Login, Signup, 404)
β βββ styles/ # Global styles, theme tokens, pixel-art CSS
βββ server/ # Express API
β βββ authentication/ # Signup/login/session controllers, JWT + middleware
β βββ controllers/ # Habit CRUD controllers
β βββ routers/ # Express route definitions
β βββ types/ # Shared server-side types
β βββ server.ts # App entry point
βββ package.json # npm workspaces root (client, server, packages/*)
- Node.js 18+
- npm
- A Supabase project (PostgreSQL database + service role key)
git clone https://github.com/PTRI-20-Team-Pikachu/habitSync.git
cd habitSync
npm installCreate a server/.env file (see server/.env.example):
SUPABASE_URL=your_supabase_project_url
SUPABASE_SERVICE_ROLE_KEY=your_service_role_keyRun the client and server together from the repo root:
npm run devThis starts:
- Client β
http://localhost:5173(Vite dev server with HMR) - Server β
http://localhost:3434(Express API)
Or run each independently:
npm run dev:client # client only
npm run dev:server # server onlycd client
npm run build # type-check + production build
npm run preview # preview the production build locallyThe Express server also serves the built client from client/dist when the build is present.
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/api/users |
Create a new user account | No |
POST |
/api/session |
Log in, issue a session cookie | No |
GET |
/api/session |
Get the current session/user | Yes |
DELETE |
/api/session |
Log out | No |
GET |
/api/habits |
List the current user's habits | Yes |
GET |
/api/habits/:id |
Get a single habit | Yes |
POST |
/api/habits |
Create a habit (title, goal, frequency) |
Yes |
PATCH |
/api/habits/:id/complete |
Toggle a habit's completed state | Yes |
DELETE |
/api/habits/:id |
Delete a habit | Yes |
GET |
/health |
Health check | No |
Routes marked Auth: Yes require a valid session cookie, enforced via the requireUser middleware.
Distributed under the MIT License.
