A full-stack habit tracking app with streaks, calendar history, progress charts, and user authentication.
Stack: React + Vite Β· Python Flask Β· PostgreSQL (Supabase) Β· Deployed on Vercel + Render
- Sign up / login with JWT authentication
- Create, edit, delete daily habits (emoji + color)
- Mark habits complete each day with one click
- Streak counter that increases on consecutive days, resets when missed
- 7-day dot trail per habit on the Today view
- 30-day calendar with color-coded completion rate
- Stats dashboard with weekly bar chart and per-habit streak chart
- Dark / light mode toggle
- Mobile-friendly responsive UI
streakr/
βββ backend/ # Flask API
β βββ app.py
β βββ models.py
β βββ extensions.py
β βββ routes/
β β βββ auth.py
β β βββ habits.py
β β βββ completions.py
β βββ requirements.txt
β βββ render.yaml
βββ frontend/ # React + Vite
βββ src/
β βββ api.js
β βββ App.jsx
β βββ main.jsx
β βββ index.css
β βββ context/
β βββ hooks/
β βββ pages/
β βββ components/
βββ package.json
βββ vite.config.js
βββ vercel.json
git clone https://github.com/YOUR_USERNAME/streakr.git
cd streakr- Go to supabase.com β New project
- After creation, go to Settings β Database
- Copy the Connection string (URI) β it looks like:
postgresql://postgres:[PASSWORD]@db.xxxx.supabase.co:5432/postgres
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env β paste your Supabase DATABASE_URL and set a JWT_SECRET_KEYGenerate a secure JWT secret:
python -c "import secrets; print(secrets.token_hex(32))"Start the server:
flask run
# Running on http://localhost:5000cd ../frontend
npm install
cp .env.example .env
# .env already has VITE_API_URL=http://localhost:5000 for local dev
npm run dev
# Running on http://localhost:5173- Push your code to GitHub
- Go to render.com β New β Web Service
- Connect your GitHub repo, select the
backendfolder as root - Set:
- Build command:
pip install -r requirements.txt - Start command:
gunicorn app:app
- Build command:
- Add environment variables:
Key Value DATABASE_URLYour Supabase connection string JWT_SECRET_KEYYour generated secret FRONTEND_URLhttps://your-app.vercel.app(fill after Vercel deploy) - Deploy β note your Render URL e.g.
https://streakr-api.onrender.com
- Go to vercel.com β New Project β import your GitHub repo
- Set Root Directory to
frontend - Add environment variable:
Key Value VITE_API_URLhttps://streakr-api.onrender.com - Deploy
- Go back to Render β update
FRONTEND_URLto your Vercel URL
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /api/auth/register |
β | Create account |
| POST | /api/auth/login |
β | Sign in |
| GET | /api/auth/me |
β | Get current user |
| GET | /api/habits/ |
β | List habits with streaks |
| POST | /api/habits/ |
β | Create habit |
| PUT | /api/habits/:id |
β | Update habit |
| DELETE | /api/habits/:id |
β | Soft-delete habit |
| GET | /api/completions/?days=30 |
β | Get completions |
| POST | /api/completions/toggle |
β | Toggle completion |
| GET | /api/health |
β | Health check |
- Flask β Python web framework
- SQLAlchemy β ORM
- Flask-JWT-Extended β JWT auth
- React β UI library
- Vite β Build tool
- Chart.js β Charts
- Supabase β Managed PostgreSQL
- Render β Backend hosting
- Vercel β Frontend hosting