# 📅 Track Every Day https://trackevery.day/ A simple, privacy-focused habit tracking web app. Track anything, every day. ## ✨ Features - **Token-based authentication** - No email or password required - **Privacy-first** - Your data is tied to a unique token - **Simple interface** - Click to log, see stats instantly - **Habit types** - Track positive, neutral, or negative habits - **Real-time statistics** - See averages, streaks, and time since last log - **Cross-device sync** - Use your token to access data anywhere ## 🚀 Getting Started ### Prerequisites - Node.js 18+ - PostgreSQL database (local or hosted) - pnpm (or npm/yarn) ### Setup 1. Clone the repository: ```bash git clone https://git.schulze.network/schulze/trackevery-day.git cd trackevery-day ``` 2. Install dependencies: ```bash pnpm install ``` 3. Set up environment variables: ```bash # Create a .env.local file with: POSTGRES_URL="your-postgres-connection-string" ``` 4. Set up the database: ```bash # Generate migrations pnpm db:generate # Push schema to database pnpm db:push # Or run migrations pnpm db:migrate ``` 5. Run the development server: ```bash pnpm dev ``` Open [http://localhost:3000](http://localhost:3000) to start tracking! ## 🏗️ Tech Stack - **Next.js 15** - React framework with App Router - **Drizzle ORM** - Type-safe database queries - **PostgreSQL** - Database (works with Vercel Postgres, Neon, Supabase, etc.) - **React Query** - Data fetching and caching - **Tailwind CSS** - Styling - **TypeScript** - Type safety ## 📱 How It Works 1. **First Visit**: A unique token is generated (e.g., `happy-blue-cat-1234`) 2. **Save Your Token**: This is your key to access your data 3. **Track Habits**: Click habit cards to log executions 4. **View Stats**: See real-time statistics and progress 5. **Access Anywhere**: Use your token to login from any device ## 🔒 Privacy - No personal information required - No email or password needed - Your token is your only identifier - Data is only accessible with your token ## 📝 Database Schema ```sql -- Users table users ( id SERIAL PRIMARY KEY, token TEXT UNIQUE NOT NULL, created_at TIMESTAMP DEFAULT NOW() ) -- Habits table habits ( id SERIAL PRIMARY KEY, user_id INTEGER REFERENCES users(id), name TEXT NOT NULL, type TEXT CHECK (type IN ('positive', 'neutral', 'negative')), is_archived BOOLEAN DEFAULT FALSE, created_at TIMESTAMP DEFAULT NOW() ) -- Habit logs table habit_logs ( id SERIAL PRIMARY KEY, habit_id INTEGER REFERENCES habits(id), logged_at TIMESTAMP DEFAULT NOW(), note TEXT ) ``` ## 🛠️ Development ```bash # Run development server pnpm dev # Type checking pnpm check # Database management pnpm db:studio # Open Drizzle Studio pnpm db:generate # Generate migrations pnpm db:push # Push schema changes ``` ## 📄 License GPL-3.0 License - see LICENSE file for details