This app builds and deploys the walton scouting app:
- firebase project hosted on google cloud
- vue3 for UI
VSCode + Volar (and disable Vetur).
The UI requires standard firebase configurations during build so they will be injected into the firebase.js file. These are made available to the build using .env files which are by convention not stored in git create one from the settings provided in firebase console for your target deployment
VITE_FIREBASE_API_KEY="your-firebase-api-key" VITE_FIREBASE_AUTH_DOMAIN="your-firebase-auth-domain" VITE_FIREBASE_PROJECT_ID="your-firebase-project-id" VITE_FIREBASE_STORAGE_BUCKET="your-firebase-storage-bucket" VITE_FIREBASE_MESSAGING_SENDER_ID="your-firebase-messaging-sender-id" VITE_FIREBASE_APP_ID="your-firebase-app-id" VITE_FIREBASE_APP_MEASURE_ID="your-firebase-app-measureid" VITE_RECAPTCHA_SITE_KEY="your-recaptcha-site-key"
The Firebase project needs to have the appropriate options enabled
- Google Analytics
- App Check -> follow instructions to setup Recaptcha and get the recaptcha site key
Pro Tip: make sure there is no space between the = and your value in the config file
See Vite Configuration Reference.
For local develoment and running with local emulators, you can copy either prod or staging as .env.local (or if all you want is local just fill in dummy values)
npm installnpm run devFirst clean the last build out
rm -rf distnpm run prodor
npm run stagingPro Tip: you can check to make sure environment variables were included in build
grep projectId dist/assets/*Requires you install the Firebase CLI
firebase deploy --project prodfirebase deploy --project stagingRun Unit Tests with Vitest
npm run test:unitLint with ESLint
npm run lint