Your Personal Running Intelligence Platform β Track runs, build streaks, earn badges, and compete with your community.
RunRush is a full-stack web application for everyday runners who want smart analytics and social motivation β without GPS hardware or expensive subscriptions. Log a run in seconds, get a personalized AI insight, and watch your streaks grow.
| Category | Features |
|---|---|
| Tracking | Log runs (date, distance, time, type, notes) Β· Auto pace & calorie calc Β· Personal bests (5K / 10K) |
| Analytics | 365-day activity heatmap Β· Run-type breakdown Β· Monthly & weekly stats |
| Motivation | AI run insights Β· Streak tracker Β· Badge system with confetti Β· Weekly goal progress |
| Social | Follow/unfollow runners Β· Social feed Β· Smart Discover ranking Β· All-time & weekly leaderboard |
| Communication | Weekly HTML email summary (opt-in) via Resend API Β· @mention friends in run notes |
| Offline | Log runs offline β SHA-256 verified auto-sync on reconnect |
| Settings | Dark/light mode Β· Display name Β· Weight & height Β· PIN change Β· CSV export |
| Admin | User management Β· Block/unblock Β· Role assignment Β· Activity logs Β· Admin notes |
| Layer | Technology |
|---|---|
| Frontend | Vanilla HTML5, CSS3 (glassmorphism), Vanilla JavaScript |
| Backend | Python 3 Β· Flask 3.0 |
| Database (dev) | SQLite (runs.db) |
| Database (prod) | PostgreSQL 16 |
| Auth | Flask session Β· 4-digit PIN Β· hmac.compare_digest |
Resend API (via Python urllib) |
|
| Offline Sync | localStorage + custom sync-engine.js |
| Hosting | Render (Web Service + PostgreSQL) |
| WSGI | Gunicorn |
| Table | Purpose |
|---|---|
users |
Accounts, profile, theme, role, status |
runs |
Individual run entries with computed stats |
user_stats |
Cached totals: total km, current & best streak |
badges |
Badge catalog (criteria definitions) |
user_badges |
Badges earned per user |
friends |
Directional follow relationships |
edit_history |
Field-level audit log of run edits |
activity_logs |
App-wide action audit trail |
admin_notes |
Moderator notes on users |
git clone https://github.com/your-username/runrush.git
cd runrush
python -m venv .venv
.venv\Scripts\activate # Windows
pip install -r requirements.txtpython app.pyOpen http://localhost:5000 β SQLite is used automatically, no database setup needed.
Create a .env file (see .env.example):
DATABASE_URL=sqlite:///runs.db # or a postgresql:// URL for production
ADMIN_USER_ID=1 # user ID that gets admin privileges
RESEND_API_KEY=re_... # for weekly email summaries
RESEND_FROM_EMAIL=RunRush <noreply@yourdomain.com>- Create a PostgreSQL database on Render β copy the Internal Database URL
- Create a Web Service β connect your GitHub repo
- Set environment variables:
| Key | Value |
|---|---|
DATABASE_URL |
Internal PostgreSQL URL from Render |
ADMIN_USER_ID |
1 |
FLASK_ENV |
production |
- Build command:
pip install -r requirements.txt - Start command:
gunicorn app:app
See RENDER_SETUP.md for full instructions.
set DATABASE_URL=postgresql://user:pass@host:5432/dbname
python migrate_to_pg.pyrunrush/
βββ app.py # All routes & business logic
βββ db.py # SQLite / PostgreSQL abstraction layer
βββ migrate_to_pg.py # Data migration script
βββ requirements.txt
βββ runs.db # Local SQLite database (gitignored in prod)
βββ static/
β βββ css/ # Stylesheets
β βββ js/ # sync-engine.js, offline-storage.js, etc.
βββ templates/ # Jinja2 HTML templates
β βββ index.html # Dashboard
β βββ social.html # Social feed
β βββ leaderboard.html
β βββ settings.html
β βββ login.html / register.html / onboarding.html
β βββ ...
βββ migrations/
βββ add_badges_system.py
Unique run dates fetched and sorted. Current streak walks backward from today; best streak is the longest consecutive chain in history. Recalculated from scratch on every add/delete.
Compares today's pace and distance against the user's last 30 days of runs. Returns a personalized motivational message β no external API, pure Python.
Social Score = (30-day KM Γ 2) + (30-day Run Count Γ 5) + (Current Streak Γ 10)
Surfaces the most currently active runners, not just all-time leaders.
Runs saved to localStorage offline. On reconnect, each run is sent with a SHA-256 hash of date+distance+time for server-side integrity verification. Duplicates are detected and skipped (HTTP 409).
Runs are editable within 24 hours of logging (created_at). Admins/moderators bypass the lock. All field changes are recorded in edit_history.
- Username + numeric PIN (β₯ 4 digits)
- Flask server-side session
- PIN comparison via
hmac.compare_digest()(timing-safe) - Role system:
userβmoderatorβadmin(also viaADMIN_USER_IDenv var)
Flask==3.0.0
python-dotenv==1.0.0
gunicorn
psycopg2-binary
MIT β feel free to use, modify, and distribute.
Built with β€οΈ and Python Β· RunRush Β© 2026