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.
-
Apps Script Setup:
- Open your Google Sheet (Vehicles, Settings).
- Go to Extensions > Apps Script.
- Copy content from
apps-script/Code.gsin this project. - Deploy > New Deployment > Web App > Anyone can access.
- Copy the Web App URL.
-
Environment Variables:
- Create
.env.localin 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)
- Create
-
Install & Run:
- (If you haven't already installed dependencies)
npm install npm run dev
- (If you haven't already installed dependencies)
-
Garage Login:
- Go to
http://localhost:3000/garage-portal/login. - Use Demo Creds:
makuti-autospares/test123.
- Go to
-
View Dashboard:
- You should see customers filtered for "makuti-autospares".
- (Ensure your Google Sheet has a row with Garage Name "makuti-autospares").
-
Add Customer:
- Click + Add Customer.
- Fill details (e.g., Plate
KCD 999X). - Submit & Verify the row appears in your Google Sheet immediately.
-
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).
-
Driver View:
- Go to
http://localhost:3000/v/KCD999X(use the plate you added). - Verify the status page shows the correct Green/Red status.
- Go to
-
SMS Automation:
- Check your Apps Script logs (
View > Executions) to see ifsendSmswas triggered by the daily trigger (if you ran it manually).
- Check your Apps Script logs (
-
Troubleshooting:
- CORS Error? Ensure your Apps Script deployments are set to "Anyone" and you are using
doGet/doPostwithContentService. - No Data? Check
console.login your terminal for[AppsScript]errors.
- CORS Error? Ensure your Apps Script deployments are set to "Anyone" and you are using
- /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.