Jumat, 09 Januari 2026

Login Apps Script

 













Bustkan prompt untuk Build a Advance Google Sheets CRUD Web App with Real-Time Data

PROMPT UTAMA (SIAP COPY–PASTE)

Build an Advanced Google Sheets CRUD Web App with Real-Time Data

Act as a senior full-stack developer specialized in Google Apps Script, SPA architecture, and Google Sheets as a database.

🎯 Objective

Build a production-ready Advanced CRUD Web App using:

  • Google Apps Script (Web App)

  • Google Sheets as a real-time database

  • Single Page Application (SPA)


🧩 Backend (Google Apps Script – code.gs)

  1. Use Google Sheets as the primary database.

  2. Implement a REST-like API Router using doGet(e) and doPost(e):

    • list → Read all data

    • get → Read single record by ID

    • create → Insert new record

    • update → Update record

    • delete → Delete record

  3. Automatically initialize sheet structure if the sheet does not exist:

    • Columns: id, timestamp, nama, kategori, deskripsi, status

  4. Generate UUID for primary key.

  5. Return all responses in JSON format only.

  6. Enable CORS-safe access for frontend fetch.

  7. Optimize performance with:

    • Batch read/write

    • Minimal Spreadsheet calls


🧩 Frontend (index.html)

  1. Build a Single Page Application (SPA) using:

    • Vanilla JavaScript (no framework)

    • Fetch API

  2. UI Requirements:

    • Responsive layout

    • Modern dashboard UI (Tailwind CSS or Bootstrap 5)

    • Hero section

    • Data table with:

      • Live reload (real-time refresh after CRUD)

      • Search & filter

      • Pagination

    • Modal form for:

      • Add data

      • Edit data

      • Delete confirmation

  3. Form validation (client-side).

  4. Show loading state & error handling.


🔄 Real-Time Behavior

  • After Create / Update / Delete:

    • Automatically refresh UI without page reload

  • Use:

    • google.script.run OR

    • fetch() to Web App endpoint


🧱 Architecture

  • Clean separation:

    • SheetService → Data access layer

    • ApiController → Routing layer

    • UIController → Frontend logic

  • Commented code and scalable structure.


📦 Deliverables

  1. code.gs (complete backend)

  2. index.html (complete frontend SPA)

  3. Step-by-step deployment instructions:

    • Deploy as Web App

    • Access permission setup

  4. Clear explanation of:

    • Data flow

    • CRUD lifecycle

    • Real-time update mechanism


⭐ Bonus (Optional but Preferred)

  • Toast notifications

  • Soft delete support

  • Role-based access (admin/viewer)

  • Export data to CSV

Output the final solution with clean, professional, and well-structured code.


 

Tidak ada komentar:

Posting Komentar

Login Apps Script

  https://www.youtube.com/watch?v=Uxal8eSVc7s https://www.youtube.com/watch?v=8gmzU3LoTpY&list=PLzONZ57BD6XnKeZmJ33eAwDLdafNVrvaV&in...