To install: Tap Share then Add to Home Screen β
@@ -312,32 +290,20 @@ export const InstallPWA = () => {
};
```
-#### 3. Mount the Component
-Add `
` to your main layout or `App.tsx` so it appears globally.
+**3. Mount the Component**
+Add `
` to your main layout or `App.tsx`.
-#### 4. Verification & Final Touches
-1. **Run Dev Server:** Start your development server (`npm run dev`).
-2. **Test Installation:**
- * Open Chrome on Android or Desktop.
- * Open Developer Tools (F12) -> Application tab -> Manifest. Verify your manifest is loaded.
- * You should see an "Install" icon in the browser's address bar or a prompt.
-3. **Replace Icons:** Remember to replace the placeholder icon filenames (e.g., `pwa-192x192.png`, `pwa-512x512.png`, `favicon.ico`, `apple-touch-icon.png`, `masked-icon.svg`) with your actual app logos in the `public/` folder and update `vite.config.ts` accordingly.
+**4. Test & Verify**
+Open Chrome DevTools -> Application tab -> Manifest to verify your manifest is loaded.
-This approach ensures that **every user** gets a path to installation, whether it's the one-click native experience or clear instructions on how to do it manually.
+
-#### Take Action: Choose Your PWA Integration Path
+---
-You have two primary ways to integrate PWA capabilities into your project:
+
+π€ AI Push Prompt
-1. **[Manual Setup Guide](#make-your-app-installable-on-android-complete-pwa-recipe)**
- * Follow the detailed, step-by-step instructions above to implement PWA manually. This gives you full control over every line of code.
-
-2. **[Automated Prompt Push](#ai-push-prompt)**
- * Leverage AI to automate the integration. Click this to jump to a specialized prompt you can copy-paste into your coding AI agent (e.g., TRAE, Claude Code, Gemini Pro) for a hands-free setup experience.
-
-
-### π€ AI Push Prompt
-*Copy and paste this entire block into your AI Agent (Trae, Claude Code, etc.) to automate this integration:*
+*Copy and paste this entire block into your AI Agent (TRAE, Claude Code, etc.) to automate PWA integration:*
```text
# Role: PWA Transformation Architect
@@ -350,89 +316,43 @@ Your goal is to help "no-code/low-code" oriented users turn their websites into
## Phase 1: Context & Safety (MANDATORY START)
Before writing any PWA code, you must perform the following checks:
-1. **Project Analysis**: Scan `package.json` to confirm it is a Vite/React project. Scan the file structure to identify the main entry point (usually `App.tsx` or a Layout component).
-2. **Asset Verification**: Check `public/` folder. Do they have a favicon or logo? If the user has no logo/icon, propose generate one for the user.
- * *Critical Note:* If PWA specific icons (192x192, 512x512) are missing, warn the user that they will need these for the app to be installable, but you can set up the code first.
-3. **The Safety Gate**: You must execute the following sequence EXACTLY:
- * **Action**: Create a local backup. `git add . && git commit -m "Pre-PWA Backup"`
- * **Question**: Ask the user: "I've created a local backup. Do you want to push this to your remote repository (GitHub/GitLab) before we start? This ensures you can't lose your work."
- * **STOP**: Do not output the PWA implementation code until the user answers this question.
+1. **Project Analysis**: Scan `package.json` to confirm it is a Vite/React project.
+2. **Asset Verification**: Check `public/` folder for icons.
+3. **The Safety Gate**: Create a local backup with `git add . && git commit -m "Pre-PWA Backup"`.
## Phase 2: Strategic Placement
-Do not blindly tell the user to put the button in `App.tsx`.
-1. **Analyze**: Look at the user's existing UI. Do they have a Navbar? A Sidebar? A Settings page? A Footer?
-2. **Propose**: Suggest the most logical place for the "Install App" button.
- * *Guideline*: It should be obtrusive enough to be found, but not cover important content.
- * *Example*: "I see you have a Sidebar menu. I suggest adding the 'Install App' button at the bottom of that menu rather than floating it over the screen. Shall we do that?"
+Analyze the user's existing UI and suggest the most logical place for the "Install App" button.
-## Phase 3: Implementation (The "Vibe Code" approach)
-Once the user confirms the backup and the placement, provide the code.
-* **Show, Don't Just Tell**: Provide the full code blocks.
-* **Explain**: Briefly explain what each block does in simple terms (e.g., "This file tells mobile phones that your website is actually an app").
-
-### Code Standards & Templates
-
-**1. Configuration (`vite.config.ts`)**
-* Use `vite-plugin-pwa`.
-* Ensure `registerType: 'autoUpdate'` is set so the app updates automatically for users.
-
-**2. The Logic (`InstallPWA.tsx`)**
-* Use the standard `beforeinstallprompt` logic for Android/Desktop.
-* **Crucial**: Include iOS detection. iOS does not support the install prompt button. You must show a tailored message for iOS users (e.g., "Tap Share -> Add to Home Screen").
-* **Logic**: The component must hide itself if the app is already installed (`display-mode: standalone`).
-
-**3. Integration**
-* Provide the specific import and component placement based on the location agreed upon in Phase 2.
+## Phase 3: Implementation
+Provide the full code blocks with brief explanations.
## Phase 4: Verification & Education
-After providing the code:
-1. Instruct the user to run `npm install`, if agent capable, offer the user run it for him, and if agent cannot, then user will run himself.
-2. Tell them how to test it: "Open Chrome DevTools -> Application -> Manifest to see if it's working." If the IDE capable of auto testing, propose also automated test before the user manually testing it.
-3. Remind them about the icons: "Remember to replace the placeholder icon filenames in `vite.config.ts` with your actual logo files later! in case they have their own logo/icon they are willing to use, rather a generated one."
-
-# Tone Guidelines
-* **Empowering**: "Let's turn this into a mobile app."
-* **Cautious**: "Let's save your work first."
-* **Clear**: Avoid deep jargon. Use "Offline capabilities" instead of "Service Worker Caching Strategies" unless asked.
-
-# Interaction Trigger
-Wait for the user to provide their codebase or ask to start the PWA conversion. Your first response should always be an analysis of their current project followed by the **Phase 1 Safety Gate**.
+Instruct the user to run `npm install` and test via Chrome DevTools -> Application -> Manifest.
```
+
+
+---
+
### π Deploy to Vercel & Go Live Instantly

Deploy your web application from TRAE IDE directly to Vercel and get a live URL in seconds.
-**3 Simple Steps:**
+| Step | Action |
+| :---: | :--- |
+| 1 | **Click "Deploy"** in the AI Chat panel or Browser tool. |
+| 2 | **Authorize Vercel:** Click "Start Authorization" β Select "All Projects" β Click "Install". |
+| 3 | **Go Live:** Click "Redeploy" to get your live, shareable link! |
-1. **Click "Deploy":** Find the deploy button in the **AI Chat panel** or the **Browser tool**. You can also just ask the AI to "Deploy this".
-
-

-
-2. **Authorize Vercel:**
- * Click **"Start Authorization"** in the popup.
- * In Vercel, select **"All Projects"** scope.
- * Click **"Install"**.
-
-

-
-3. **Go Live:** Back in TRAE, click **"Redeploy"**. You'll get a live, shareable link instantly!
-
-### π‘οΈ Security & Privacy
-
-When using these hacks and integrations, always prioritize your security:
-
-* **Never Commit Secrets:** Do not commit `.env` files or files containing API keys (like your Z.AI key) to public repositories.
-* **Use Environment Variables:** Store sensitive keys in `.env` files and ensure they are added to your `.gitignore`.
-* **Review AI Code:** Always review the code generated by AI agents before deploying it to production.
+---
### π§ Claude Code with GLM 4.6 Power

-> *"For those who used to Claude Code, you can keep enjoy the same interface, while using the much lower cost model, here how its done.."*
+> *"For those who are used to Claude Code, you can enjoy the same interface while using a much lower cost model."*
**Step 1: Install Claude Code**
```bash
@@ -440,15 +360,14 @@ npm install -g @anthropic-ai/claude-code
```
**Step 2: Configure GLM Coding Plan**
-1. **Get API Key**: Go to the [Z.AI Open Platform](https://z.ai/subscribe?ic=R0K78RJKNW) and generate your API Key.
-2. **Auto-Configure**: Run this one-liner to set up the environment automatically:
- ```bash
- curl -O "https://cdn.bigmodel.cn/install/claude_code_zai_env.sh" && bash ./claude_code_zai_env.sh
- ```
- *(This updates `~/.claude/settings.json` to point `ANTHROPIC_BASE_URL` to Z.AI)*
+```bash
+curl -O "https://cdn.bigmodel.cn/install/claude_code_zai_env.sh" && bash ./claude_code_zai_env.sh
+```
-**Manual Configuration (Optional)**
-If you prefer to edit manually, update `~/.claude/settings.json`:
+
+Manual Configuration (Optional)
+
+Update `~/.claude/settings.json`:
```json
{
"env": {
@@ -458,14 +377,26 @@ If you prefer to edit manually, update `~/.claude/settings.json`:
}
}
```
+
**Step 3: Run**
-Navigate to your project and start coding!
```bash
cd your-project
claude
```
+---
+
+### π‘οΈ Security & Privacy
+
+| Rule | Description |
+| :--- | :--- |
+| π« **Never Commit Secrets** | Do not commit `.env` files or API keys to public repositories. |
+| π **Use Environment Variables** | Store sensitive keys in `.env` files and add them to `.gitignore`. |
+| ποΈ **Review AI Code** | Always review AI-generated code before deploying to production. |
+
+---
+
## πΉοΈ Vibe Games
@@ -478,10 +409,16 @@ Explore a collection of HTML5 mini-games developed using **Vibe Coding** techniq
---
-- [10% Discount token for Z.AI GLM Models](https://z.ai/subscribe?ic=R0K78RJKNW)
-- [TRAE.AI Integration guide with GLM 4.6 Model](https://github.com/roman-ryzenadvanced/Custom-Engineered-Agents-and-Tools-for-Vibe-Coders/blob/main/Adding_GLM_4.6_Model_to_TRAE__A_Visual_Guide__3_.pdf)
-- [TRAE.AI and SOLO Agent official page](https://www.trae.ai/s/WJtxyE)
+## π Quick Links
+
+| Resource | Link |
+| :--- | :---: |
+| ποΈ 10% Discount for Z.AI GLM Models | [Subscribe](https://z.ai/subscribe?ic=R0K78RJKNW) |
+| π TRAE.AI Integration Guide | [Download PDF](https://github.com/roman-ryzenadvanced/Custom-Engineered-Agents-and-Tools-for-Vibe-Coders/blob/main/Adding_GLM_4.6_Model_to_TRAE__A_Visual_Guide__3_.pdf) |
+| π TRAE.AI and SOLO Agent | [Official Page](https://www.trae.ai/s/WJtxyE) |
+
+---
- Made by RyzenAdvanced
+ Made with β€οΈ by RyzenAdvanced