Skip to content

Commit 64c440e

Browse files
Cawlummclaude
andauthored
Feature/fly demo (#6)
* docs: add branch naming conventions and workflow to CONTRIBUTING - Branch prefixes: feature/, bugfix/, hotfix/, chore/, docs/, release/ - Workflow: rebase from main, push, PR - Conventional commit format with examples - Test requirements before PR Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(demo): Fly.io demo instance — combined container, rich seed data, hourly reset fly/Dockerfile: multi-stage build (node + go → nginx:alpine), single container fly/nginx.fly.conf: proxies /api/ to localhost:3000 fly/entrypoint.sh: restart loop for backend + crond for hourly reset fly/reset.sh: copies seed snapshot → live DB, kills backend (auto-restarts) fly/SETUP.md: step-by-step deploy guide fly.toml: fra region, 512MB shared VM, persistent volume at /app/data seed/demo_data.go: goroutine that waits for exercises then seeds: - PPL program (6 days: Push/Pull/Legs A+B) - 8 weeks of workouts with linear weight progression - 90 days of weight logs (~185 to 173 lbs with daily noise) - 7 days of food logs (~2400 kcal/day) Idempotent — skips if data already exists main.go: go seed.DemoData(db.DB) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs(fly): add comments to demo infra + README live demo section Documents the single-container Fly.io architecture (nginx + Go backend + crond hourly reset) inline in Dockerfile, entrypoint.sh, and reset.sh. README gets a Live Demo section with link, credentials, and a note that visitors can register their own account on the shared instance. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 883f502 commit 64c440e

10 files changed

Lines changed: 690 additions & 20 deletions

File tree

CONTRIBUTING.md

Lines changed: 77 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,98 @@
11
# Contributing to Lyftr
22

3-
Bug reports, feature requests, and pull requests are welcome. Here's how to get involved without wasting your time or mine.
3+
Bug reports, feature requests, and pull requests are welcome. Open an issue before submitting large changes.
44

5-
## Reporting bugs
5+
---
6+
7+
## Branch Naming
8+
9+
| Prefix | Use for | Example |
10+
|--------|---------|---------|
11+
| `feature/` | New functionality | `feature/csv-import` |
12+
| `bugfix/` | Non-urgent bug fixes | `bugfix/weight-unit-display` |
13+
| `hotfix/` | Urgent production fixes — branch off `main` directly | `hotfix/auth-token-expiry` |
14+
| `chore/` | Deps, tooling, CI, config — no behavior change | `chore/bump-go-1.27` |
15+
| `docs/` | Documentation only | `docs/vps-setup-guide` |
16+
| `release/` | Version bump + changelog prep | `release/v0.2.0` |
17+
18+
Lowercase, hyphen-separated, specific enough to be self-explanatory.
19+
20+
---
21+
22+
## Workflow
23+
24+
```bash
25+
# Start from an up-to-date main
26+
git checkout main && git pull --rebase
27+
git checkout -b feature/your-feature
28+
29+
# Work, commit, push
30+
git push -u origin feature/your-feature
31+
32+
# Open a PR against main
33+
```
34+
35+
Rebase against main before opening a PR if the branch has been open a while:
36+
37+
```bash
38+
git fetch origin
39+
git rebase origin/main
40+
```
41+
42+
---
43+
44+
## Commit Messages
45+
46+
Follow conventional commits:
47+
48+
```
49+
feat(scope): short description
50+
fix(scope): short description
51+
chore(scope): short description
52+
docs(scope): short description
53+
```
54+
55+
Examples:
56+
- `feat(weight): add CSV export`
57+
- `fix(auth): handle expired refresh token`
58+
- `chore(deps): bump Go to 1.27`
59+
60+
---
61+
62+
## Reporting Bugs
663

764
Use the [bug report template](.github/ISSUE_TEMPLATE/bug_report.md). Include logs. Don't skip steps to reproduce.
865

9-
## Requesting features
66+
## Requesting Features
1067

1168
Use the [feature request template](.github/ISSUE_TEMPLATE/feature_request.md). Explain the problem first, not just the solution.
1269

13-
## Submitting a pull request
70+
---
1471

15-
1. Open an issue first for anything non-trivial — alignment before code saves everyone time
16-
2. Fork the repo and create a branch: `git checkout -b feat/your-thing`
17-
3. Keep changes focused. One feature or fix per PR
18-
4. Test it locally before opening the PR
72+
## Code Standards
1973

20-
## Local development
74+
- **Backend:** `gofmt` before committing. Errors wrapped with context. No unnecessary abstractions.
75+
- **Frontend:** Follow existing patterns. No new npm dependencies without discussion.
76+
- **Tests:** Go controller tests and Playwright E2E must pass before any PR.
2177

2278
```bash
23-
# Backend (Go, runs on :3000)
24-
cd backend && go run main.go
79+
# Backend
80+
cd backend && go test ./controllers/ -timeout 30s
2581

26-
# Frontend (React + Vite, runs on :5173)
27-
cd web && npm install && npm run dev
82+
# Frontend E2E (requires backend on :3000 and frontend on :5173)
83+
cd web && npm run test:e2e
2884
```
2985

30-
See the [README](README.md) for full setup instructions.
86+
Never commit with failing tests. Fix root cause — don't skip or comment out.
87+
88+
---
3189

32-
## Code style
90+
## Pull Requests
3391

34-
- Go: standard `gofmt` formatting
35-
- TypeScript/React: existing patterns in the codebase — no new dependencies without discussion
36-
- No half-finished features. If it's not ready, keep it on a branch
92+
- One feature or fix per PR — focused diffs only
93+
- Reference the related issue if one exists
94+
- PRs without passing tests will not be merged
3795

3896
## Questions?
3997

40-
Open a [discussion](../../discussions) or an issue. Happy to help.
98+
Open a [discussion](../../discussions) or an issue.

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
> **Early beta** — actively being built. Expect rough edges and frequent updates. Issues and feedback are welcome. The software equivalent of going to the gym for the first time.
2727
28-
> 🌐 **Live demo coming soon**try it without spinning up Docker.
28+
> 🌐 **[Live demo → lyftr-demo.fly.dev](https://lyftr-demo.fly.dev)**log in with `demo@lyftr.local` / `password123`. Shared instance, resets every hour.
2929
3030
---
3131

@@ -71,6 +71,21 @@ Lyftr is for people who want a modern, mobile-first workout tracker that they fu
7171

7272
---
7373

74+
## Live Demo
75+
76+
**[lyftr-demo.fly.dev](https://lyftr-demo.fly.dev)**
77+
78+
| Field | Value |
79+
|-------|-------|
80+
| Email | `demo@lyftr.local` |
81+
| Password | `password123` |
82+
83+
Pre-loaded with 8 weeks of PPL workouts, 90 days of weight logs, and food logs so every page has data to explore. Shared instance — resets automatically every hour so any changes are wiped clean.
84+
85+
Or **register your own account** on the demo — your data persists until the next hourly reset, and nobody else can see it.
86+
87+
---
88+
7489
## Quick Start
7590

7691
> No clone. No build. No Go install required. Just Docker.

backend/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ func main() {
1515
db.Connect()
1616
seed.DemoUser(db.DB)
1717
seed.Exercises(db.DB)
18+
go seed.DemoData(db.DB)
1819

1920
if config.C.Env == "production" {
2021
gin.SetMode(gin.ReleaseMode)

0 commit comments

Comments
 (0)