Giter Site home page Giter Site logo

terifash / firebase-vue3-word-helper-2 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 882 KB

Firebase word helper 2

JavaScript 4.58% TypeScript 51.22% HTML 0.65% Vue 39.16% CSS 2.81% Shell 0.28% SCSS 1.30%
bootstrap firebase tailwind typescript vue vue-router vuejs vuex-store bootstrap5 vue-bootstrap

firebase-vue3-word-helper-2's Introduction

firebase-vue3-word-helper-2

Purpose

This is a Start-Up kit for a Firebase web project, which uses Vue3 and firebase 9.

Requirements

  • Node.js version 14 or later.

Instruction

  1. Git clone this repository
  2. Run "yarn global add firebase-tools" to install firebase tools.
  3. Run "yarn install" once to get necessary node modules.
  4. Run "yarn install" once in the functions directory as well.
  5. Open the firebase console (from https://firebase.google.com) and add a project
  6. From the dashboard of this project, add an app and choose "web" (</>).
  7. From the setting of this app, choose "Config" (in Firebase SDK snippet)
  8. Copy the config file, and paste into src/config/project.ts file.
  9. Open the firebase console, and create a Cloud Firestore (make it "secure" for now).
  10. Enable Firebase Hosting on the firebase console.

Funcitons

Because Firebase Functions is very slow in the case of cold start by default setting, this startup-kit is a bit of a custom Firebase functions.

Functions side

  • Functions is invoked using a wrapper function (exportIfNeeded function in functions/src/common/exportifneeded.ts). It loads only the functions it needs.
  • Functions will start with enough memory. test function in functions/src/wrappers/tests/test.ts run with 1GB memory.
  • Functions run in a nearby region. In my case it is Japan, so it is set in the Japanese region. Please change it to suit your location.

For this reason, Functions are used in a slightly unusual way. Functions called by the client are written in src/index.ts like exportIfNeeded ("test", "tests/test", exports);

In this case, the client calls test as a function. And when the client call the test Function, the default function in functions/src/wrappers/tests/test.ts is called. See this file for more information.

Vue.js side.

  • The functions settings are in src/utils/firebase.ts. By default, it set to call europe-central2 (Kiev) region.
  • All functions put together in src/utils/functions.ts. You should add new functions in this file.

Region

The region of Functions is set in europe-central2 (Kiev). If you change the region, be sure to change both Vue.js in Functions.

i18n

  • This startup-kit supports i18n using url path.
  • You can use one Vue file in both /en/index or /ru/index or /ua/index.
  • Language files are in src/i18n/ directory.
    • en.ts or ru.ts or ua.ts are Language files.
    • The language file used for the language switching pull-down (select) is language.ts. The same file is read from en.ts or ru.ts ua.ts. Write in each language.
    • If you want to add new language, add the language to index.ts, add the {language}.ts, and add language to language.ts.
  • See also src/router/index.ts for how to switch languages with url path.
  • You can use the language switching pull-down in src/components/Languages.vue. This file needs to read route.param.lang, so don't use it in App.vue and Layout.vue. Other than that, it can be used anywhere.
  • i18n uses vue-i18n@next, so please refer to that for details on how to use it.

Available Scripts

In the project directory, you can run:

yarn run serve

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.

yarn run build

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!

firebase deploy

Deploys the app to the Firebase cloud. You need to run "yarn run build" before the deployment.

yarn run format

Run Prettier, rewrite code as code formatting.

firebase-vue3-word-helper-2's People

Contributors

isamu avatar terifash avatar yutaok avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.