{"id":50398669,"url":"https://github.com/fabioc-aloha/ai-wallpaper-generator","last_synced_at":"2026-05-30T22:01:52.962Z","repository":{"id":339693908,"uuid":"1163021116","full_name":"fabioc-aloha/ai-wallpaper-generator","owner":"fabioc-aloha","description":"AI-powered wallpaper generator PWA optimized for iPhone 16 Pro using Azure serverless and Replicate AI","archived":false,"fork":false,"pushed_at":"2026-02-21T02:50:02.000Z","size":4074,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-21T07:28:30.100Z","etag":null,"topics":["ai","azure","azure-functions","azure-static-web-apps","ios","iphone","iphone-16-pro","progressive-web-app","pwa","replicate","serverless","sveltekit","typescript","wallpaper-generator"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabioc-aloha.png","metadata":{"files":{"readme":"README-DEV.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-21T01:22:16.000Z","updated_at":"2026-02-21T02:50:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/fabioc-aloha/ai-wallpaper-generator","commit_stats":null,"previous_names":["fabioc-aloha/ai-wallpaper-generator"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/fabioc-aloha/ai-wallpaper-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabioc-aloha%2Fai-wallpaper-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabioc-aloha%2Fai-wallpaper-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabioc-aloha%2Fai-wallpaper-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabioc-aloha%2Fai-wallpaper-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabioc-aloha","download_url":"https://codeload.github.com/fabioc-aloha/ai-wallpaper-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabioc-aloha%2Fai-wallpaper-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33711018,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","azure","azure-functions","azure-static-web-apps","ios","iphone","iphone-16-pro","progressive-web-app","pwa","replicate","serverless","sveltekit","typescript","wallpaper-generator"],"created_at":"2026-05-30T22:01:52.687Z","updated_at":"2026-05-30T22:01:52.956Z","avatar_url":"https://github.com/fabioc-aloha.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI Wallpaper Generator - Development\n\nThis is the scaffolded MVP project using **SvelteKit** (frontend) + **Azure Functions** (backend).\n\n## 📁 Project Structure\n\n```\nAlexWallpapers/\n├── frontend/              # SvelteKit PWA\n│   ├── src/\n│   │   ├── routes/        # Pages (+page.svelte)\n│   │   ├── lib/           # Shared utilities \u0026 types\n│   │   ├── stores/        # Svelte stores (wallpaper cache)\n│   │   ├── service-worker.ts  # PWA offline support\n│   │   └── app.html       # HTML template\n│   ├── static/            # Static assets (icons, favicon)\n│   ├── vite.config.ts     # Vite + PWA config\n│   └── package.json\n├── api/                   # Azure Functions\n│   ├── generate/          # POST /api/generate endpoint\n│   ├── shared/            # Key Vault \u0026 Blob Storage utilities\n│   ├── host.json          # Functions runtime config\n│   └── package.json\n├── docs/                  # Planning documentation\n├── staticwebapp.config.json  # Azure SWA config\n└── README-DEV.md          # This file\n```\n\n## 🚀 Quick Start\n\n### 1. Install Dependencies\n\n```powershell\n# Frontend\ncd frontend\nnpm install\n\n# API\ncd ../api\nnpm install\n```\n\n### 2. Configure Local Settings\n\nEdit `api/local.settings.json`:\n```json\n{\n  \"Values\": {\n    \"KEY_VAULT_NAME\": \"your-keyvault-name\",\n    \"STORAGE_ACCOUNT_NAME\": \"your-storage-account\",\n    \"STORAGE_CONTAINER_NAME\": \"wallpapers\"\n  }\n}\n```\n\n### 3. Run Development Servers\n\n**Terminal 1 - Frontend**:\n```powershell\ncd frontend\nnpm run dev\n```\nOpens at http://localhost:5173\n\n**Terminal 2 - API**:\n```powershell\ncd api\nnpm start\n```\nRuns at http://localhost:7071\n\n### 4. Test on iPhone\n\n1. Get your local IP: `ipconfig` (look for IPv4)\n2. Update `frontend/.env.development`:\n   ```\n   PUBLIC_API_URL=http://YOUR-IP:7071/api\n   ```\n3. Open iPhone Safari: `http://YOUR-IP:5173`\n4. Add to Home Screen for PWA mode\n\n## 🔧 Development Workflow\n\n### Frontend Development\n```powershell\ncd frontend\nnpm run dev          # Start dev server\nnpm run build        # Build for production\nnpm run preview      # Preview production build\nnpm run check        # Type checking\n```\n\n### API Development\n```powershell\ncd api\nnpm start            # Start Functions runtime\nnpm run build        # Compile TypeScript\nnpm run watch        # Watch mode for TS\n```\n\n## 📝 Key Features Implemented\n\n✅ **Frontend (SvelteKit)**\n- ✅ Text prompt input with validation\n- ✅ Generate button with loading state\n- ✅ Wallpaper preview \u0026 download\n- ✅ Recent wallpapers grid (last 10)\n- ✅ LocalStorage persistence\n- ✅ Offline mode detection\n- ✅ Service Worker caching\n- ✅ PWA manifest (installable)\n- ✅ iPhone-optimized UI (safe areas)\n\n✅ **Backend (Azure Functions)**\n- ✅ POST /api/generate endpoint\n- ✅ Zod request validation\n- ✅ Replicate API integration (flux-1.1-pro)\n- ✅ Key Vault secret retrieval\n- ✅ Blob Storage upload\n- ✅ Error handling \u0026 logging\n- ✅ Managed Identity support\n\n✅ **Infrastructure**\n- ✅ TypeScript throughout\n- ✅ Environment configuration\n- ✅ Static Web App routing\n- ✅ CORS \u0026 security headers\n\n## 🔐 Azure Setup Required\n\nBefore deploying, you need:\n\n1. **Azure Static Web App** (Free tier)\n2. **Azure Functions** Flex Consumption FC1\n3. **Storage Account** (Hot tier) with `wallpapers` container\n4. **Key Vault** with `REPLICATE-API-KEY` secret\n5. **Application Insights** (optional, for telemetry)\n\nSee `docs/AZURE-SETUP.md` for step-by-step instructions.\n\n## 🧪 Testing Checklist\n\n- [ ] Generate wallpaper with simple prompt\n- [ ] Download to iPhone Photos\n- [ ] Set as wallpaper (lock/home screen)\n- [ ] Test offline mode (airplane mode)\n- [ ] View cached wallpapers offline\n- [ ] Add to Home Screen (PWA install)\n- [ ] Test with long prompts (500 chars)\n- [ ] Test error handling (network failure)\n- [ ] Check iPhone safe area rendering\n- [ ] Verify HTTPS in production\n\n## 📊 Cost Tracking\n\n**MVP Target**: $1.02/month for 200 wallpapers\n\nCurrent setup:\n- Static Web Apps: **Free tier** ✅\n- Functions FC1: ~$0.08/month (200 executions)\n- Blob Storage: ~$0.02/month (10 wallpapers)\n- Key Vault: ~$0.02/month (secret storage)\n- Replicate: ~$0.90/month (200 × 20s × $0.000225/s)\n\n**Total**: ~$1.02/month\n\nMonitor in Azure Portal → Cost Management.\n\n## 🐛 Troubleshooting\n\n**Frontend won't start**:\n```powershell\nrm -r node_modules, package-lock.json\nnpm install\n```\n\n**API 500 errors**:\n- Check `api/local.settings.json` has correct values\n- Verify Azure resources exist (Key Vault, Storage)\n- Check API key is in Key Vault as `REPLICATE-API-KEY`\n- Review Function logs: `http://localhost:7071/admin/functions/generate`\n\n**PWA not installing**:\n- Must use HTTPS (production only)\n- Check manifest at `/manifest.webmanifest`\n- Verify service worker registered (DevTools → Application)\n\n**iPhone connection issues**:\n- Ensure same WiFi network\n- Use IP address, not `localhost`\n- Check Windows Firewall allows port 5173 \u0026 7071\n\n## 📚 Next Steps\n\n1. ✅ **Week 1**: Complete Azure infrastructure setup\n2. ⏳ **Week 2**: Deploy to Azure Static Web Apps\n3. ⏳ **Week 3**: Test on iPhone, polish UI\n4. ⏳ **Week 4**: Add style templates (optional)\n\nSee `docs/DEVELOPMENT-GUIDE.md` for detailed weekly plan.\n\n## 🎯 MVP Scope\n\nThis scaffold includes **only** Phase 1 MVP features:\n- Generate wallpaper from text prompt\n- Download to Photos\n- Last 10 wallpapers cached\n- Offline viewing\n- PWA installable\n\n**Not included** (Phase 2/3):\n- User authentication\n- Payment system\n- Style templates\n- Generation history database\n- Push notifications\n\nKeep it simple, ship fast! 🚀\n\n---\n\n**Ready to start?** Run `npm install` in both `frontend/` and `api/`, then see Quick Start above.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabioc-aloha%2Fai-wallpaper-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabioc-aloha%2Fai-wallpaper-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabioc-aloha%2Fai-wallpaper-generator/lists"}