This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and typescript-eslint
in your project.
-
To allow travelers to upload images (e.g., damage photos) with incident reports, you must:
- Upload the image to Firebase Storage from the form.
- Save the download URL in Firestore (not the file object).
-
Firebase Storage Rules:
- On the Spark (free) plan, you cannot set custom storage rules. You must upgrade to Blaze (pay-as-you-go) to allow authenticated users to upload files:
service firebase.storage { match /b/{bucket}/o { match /{allPaths=**} { allow read, write: if request.auth != null; } } }
- After upgrading, set these rules in the Firebase Console → Storage → Rules and click Publish.
- On the Spark (free) plan, you cannot set custom storage rules. You must upgrade to Blaze (pay-as-you-go) to allow authenticated users to upload files:
-
If you see CORS or permission errors when uploading, check your Storage rules and plan.
-
The incident report form will upload the image and save the URL in Firestore automatically if rules and plan are correct.