A fully featured, iOS-ready Progressive Web App (PWA) for fitness tracking. Built with vanilla HTML, CSS, and JavaScript. AI coaching powered by Claude.
fitpulse/
├── index.html # Main app shell
├── style.css # All styles
├── app.js # App logic + AI integration
├── manifest.json # PWA manifest
├── sw.js # Service worker (offline cache)
├── generate_icons.py # Script to generate icons (run once)
├── icons/ # All PWA icons + iOS splash screens
│ ├── icon-192.png
│ ├── icon-512.png
│ └── ...
└── screenshots/ # Optional: app store screenshots
git init
git add .
git commit -m "Initial commit: FitPulse PWA"
git branch -M main
git remote add origin https://github.com/YOUR_USERNAME/fitpulse.git
git push -u origin main
main branch and / (root) folderhttps://YOUR_USERNAME.github.io/fitpulse/Important: Update
"start_url"and"scope"inmanifest.jsonto match your GitHub Pages path:"start_url": "/fitpulse/", "scope": "/fitpulse/"
For development (quick test only):
Open app.js and replace YOUR_API_KEY_HERE:
'x-api-key': 'sk-ant-...',
For production (recommended):
Never expose your API key in client-side code. Use a backend proxy instead.
Create a simple Cloudflare Worker proxy to keep your key secret:
// Cloudflare Worker — proxy.js
export default {
async fetch(request) {
if (request.method === 'OPTIONS') {
return new Response(null, {
headers: {
'Access-Control-Allow-Origin': 'https://YOUR_USERNAME.github.io',
'Access-Control-Allow-Methods': 'POST',
'Access-Control-Allow-Headers': 'Content-Type',
}
});
}
const body = await request.json();
const res = await fetch('https://api.anthropic.com/v1/messages', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': YOUR_SECRET_API_KEY, // Set in Cloudflare env vars
'anthropic-version': '2023-06-01',
},
body: JSON.stringify(body),
});
const data = await res.json();
return new Response(JSON.stringify(data), {
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': 'https://YOUR_USERNAME.github.io',
}
});
}
};
Then in app.js, change CLAUDE_API_URL to your Worker URL:
const CLAUDE_API_URL = 'https://your-worker.your-subdomain.workers.dev';
Icons are pre-generated in the icons/ folder. To regenerate or customize:
pip install Pillow
python3 generate_icons.py
For production, replace generated icons with your own branded artwork. Required sizes: 16, 32, 72, 96, 128, 144, 152, 180, 192, 512px.
The app automatically prompts iOS Safari users to add it to their Home Screen after 3.5 seconds. Once installed:
On Android/Chrome, the native install banner appears automatically.
| File | What to change |
|---|---|
style.css |
Colors (--accent, --bg, etc.), fonts, layout |
app.js |
AI system prompts, fitness logic, goals |
manifest.json |
App name, theme color, shortcuts |
index.html |
Demo data (workouts, meals, habits) |
icons/ |
Replace with your own branded icons |
claude-sonnet-4-20250514 for AI coachingMIT — feel free to use, modify, and ship.