Skip to content

Cyber-Interface-Lab/arai_workshop_2022

Repository files navigation

arai_workshop_2022

Preparation

Steps

1. Fork this repository

2. Clone to local

3. Move to the cloned directory and install dependent packages

npm install

4. Install firebase-tools

npm install -g firebase-tools

5. Create Firebase project

1

  • GA is not needed

2

  • Click 'Web' button

3

  • Set app nickname and Check Firebase Hosting and click 'Register App'

4

  • You don't have to follow the step 2 ~ 4. But Just copy the app config

5

(You can also see this config information in the 'project setting' menu) 6

  • In the console, choose 'Cloud Firestore' and create new database

7

8

  • TestMode would be fine

9

  • Choose your favorite region and create database.

10

6. Setup Project (Client Side)

  • Open 'firebase.js' file and rewrite the firebaseConfig

11

npm run start

12

  • You have to see that the app is correctly connected to the database by looking the Firestore console.

11_2

7. Setup Deployment

  • Open '.firebaserc' file and rewrite "arai-workshop-2022" to your firebase project ID (not project name).

13_1

  • Login via firebase-tools and authenticate your account
    • This command will open your default browser
firebase login

13_2

  • You can deploy your project by running these commands
    • If succeeded, you can see your app in the 'Hosting URL'
npm run build
firebase deploy

14

8. Deploy Automation (using Github Actions)

  • Get Tokens for CI by running this command and copy
firebase login:ci

15

  • Open Action Secrets settings in the github and add the secret called 'FIREBASE_TOKEN'

16

  • Go to Actions setting and enable github actions

15_2

  • Then the project will automatically deployed when there is a push to 'main' branch
    • You can see the yml file in '.github/workflows/main.yml'
git add .
git commit -m "test commit"
git push origin main

9. Just enjoy customizing the project!

  • The main source code is 'src/index.js' so you can customize your app by editing this file

About

arai workshop repository

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published