Skip to content
NaingzwehtutPublic

About

πŸ”₯ Habit tracker with streaks, calendar history, progress charts and user accounts. React + Flask + PostgreSQL.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”₯ Streakr β€” Habit Tracker

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


Features

  • 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

Project Structure

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

Local Development

1. Clone the repo

git clone https://github.com/YOUR_USERNAME/streakr.git
cd streakr

2. Set up the database (Supabase)

  1. Go to supabase.com β†’ New project
  2. After creation, go to Settings β†’ Database
  3. Copy the Connection string (URI) β€” it looks like: postgresql://postgres:[PASSWORD]@db.xxxx.supabase.co:5432/postgres

3. Run the backend

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_KEY

Generate a secure JWT secret:

python -c "import secrets; print(secrets.token_hex(32))"

Start the server:

flask run
# Running on http://localhost:5000

4. Run the frontend

cd ../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

Deployment

Deploy backend to Render (free)

  1. Push your code to GitHub
  2. Go to render.com β†’ New β†’ Web Service
  3. Connect your GitHub repo, select the backend folder as root
  4. Set:
    • Build command: pip install -r requirements.txt
    • Start command: gunicorn app:app
  5. Add environment variables:
    Key Value
    DATABASE_URL Your Supabase connection string
    JWT_SECRET_KEY Your generated secret
    FRONTEND_URL https://your-app.vercel.app (fill after Vercel deploy)
  6. Deploy β€” note your Render URL e.g. https://streakr-api.onrender.com

Deploy frontend to Vercel (free)

  1. Go to vercel.com β†’ New Project β†’ import your GitHub repo
  2. Set Root Directory to frontend
  3. Add environment variable:
    Key Value
    VITE_API_URL https://streakr-api.onrender.com
  4. Deploy
  5. Go back to Render β†’ update FRONTEND_URL to your Vercel URL

API Endpoints

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

Built With

About

πŸ”₯ Habit tracker with streaks, calendar history, progress charts and user accounts. React + Flask + PostgreSQL.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages