Skip to content

BuildForSDGCohort2/oneqr-homepage

Repository files navigation

OneQR — Digital Vehicle Compliance (MVP)

This project is a 48-hour MVP implementation for the OneQR Bootcamp. It links a Next.js frontend with a Google Sheets database (via Apps Script) and Supabase Storage.

🚀 Quick Setup (10-Step Demo Guide)

  1. Apps Script Setup:

    • Open your Google Sheet (Vehicles, Settings).
    • Go to Extensions > Apps Script.
    • Copy content from apps-script/Code.gs in this project.
    • Deploy > New Deployment > Web App > Anyone can access.
    • Copy the Web App URL.
  2. Environment Variables:

    • Create .env.local in the root folder.
    • Add the following (fill in your keys):
    APPS_SCRIPT_WEBHOOK_URL=https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec
    SUPABASE_URL=https://your-project.supabase.co
    SUPABASE_KEY=your-anon-key
    SUPABASE_BUCKET=oneqr-uploads
    JWT_SECRET=supersecretdemo
    # GENKIT_API_KEY= (Optional, mocked for MVP)
  3. Install & Run:

    • (If you haven't already installed dependencies) npm install
    • npm run dev
  4. Garage Login:

    • Go to http://localhost:3000/garage-portal/login.
    • Use Demo Creds: makuti-autospares / test123.
  5. View Dashboard:

    • You should see customers filtered for "makuti-autospares".
    • (Ensure your Google Sheet has a row with Garage Name "makuti-autospares").
  6. Add Customer:

    • Click + Add Customer.
    • Fill details (e.g., Plate KCD 999X).
    • Submit & Verify the row appears in your Google Sheet immediately.
  7. Upload Document:

    • On the dashboard, click Upload Doc for a customer.
    • Select any image/PDF.
    • Watch for the success toast: "Upload Successful! Parsed Expiry...".
    • Verify the Google Sheet updates the Expiry columns (simulated dates for MVP).
  8. Driver View:

    • Go to http://localhost:3000/v/KCD999X (use the plate you added).
    • Verify the status page shows the correct Green/Red status.
  9. SMS Automation:

    • Check your Apps Script logs (View > Executions) to see if sendSms was triggered by the daily trigger (if you ran it manually).
  10. Troubleshooting:

    • CORS Error? Ensure your Apps Script deployments are set to "Anyone" and you are using doGet/doPost with ContentService.
    • No Data? Check console.log in your terminal for [AppsScript] errors.

📂 Project Structure

  • /app/garage-portal: Secure dashboard for garage owners.
  • /app/v/[plate]: Public landing page for drivers/police.
  • /app/api: Backend routes (Login, Upload, Bridge to Google Sheets).
  • /lib: Helpers for Auth, Supabase, and Apps Script.
  • /apps-script: Source code for the Google Apps Script backend.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors