This is a Start-Up kit for a Firebase web project, which uses Vue3 and firebase 9.
- Node.js version 14 or later.
- Git clone this repository
- Run "yarn global add firebase-tools" to install firebase tools.
- Run "yarn install" once to get necessary node modules.
- Run "yarn install" once in the functions directory as well.
- Open the firebase console (from https://firebase.google.com) and add a project
- From the dashboard of this project, add an app and choose "web" (</>).
- From the setting of this app, choose "Config" (in Firebase SDK snippet)
- Copy the config file, and paste into src/config/project.ts file.
- Replace the word "fir-vue-startup-kit" in .firebaserc file with your Firebase project name.
- Open the firebase console, and create a Cloud Firestore (make it "secure" for now).
- Enable Firebase Hosting on the firebase console.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:8080 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Builds the app for production to the dist
folder.
It correctly bundles Vue in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
Build and deploy the app to the Firebase cloud. Now only deploy web assets to hosting.
Run Prettier, rewrite code as code formatting.
to Run browser automated test with puppeteer and @chainsafe/dappeteer. for login with wallet, Metamask chrome-extension will be needed, and puppeteer doesn't support headless mode with chrome-extension(https://github.com/puppeteer/puppeteer/blob/main/website/versioned_docs/version-16.1.0/index.md#working-with-chrome-extensions).
** So we can use this test command for local, but cannot use for CI.
- run
yarn serve
on /functions/ (this will run firebase-emulator on local, to test with same-condition ) - edit src/config/project.ts
emulator: false => true
- run
yarn serve
on /(top directory). (this will serve nouns-map web with localhost:8080) - run you can run
yarn test
on /.
you can re-try, re-test step 4 only.(On 1st time to test it fails randomly,because firebase emulator took much time to preplare backend,, so please retry yarn test
again, on that case.)
- Create and download the new service account's JSON key
- Add that JSON key as a secret in your GitHub repository. JSON key is FIREBASE_SERVICE_ACCOUNT_FIR_VUE_STARTUP_KIT.
- Add firebase project id as a secret in your GitHub repository. JSON key is FIREBASE_PROJECT.
More detail: see, https://github.com/marketplace/actions/deploy-to-firebase-hosting
This is the sample site I deployed.