Git Product home page Git Product logo

angular-firebase-functions's Introduction

โšก Angular Firebase Functions

  • Angular app using Firebase tools
  • Firebase Functions used with express server to access a realtime database
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

๐Ÿ“„ Table of contents

๐Ÿ“š General info

  • Firebase project realtime database key-value pair created in Firebase Console
  • Project service account created via Firebase Project Settings then Create Service Account/Node.js (default option)then Generate new private key that adds a json file to the user's PC. The path to this access key file is referenced in the express server index.ts file
  • This is just a very simple example to demonstrate how a Firebase database function works

๐Ÿ“ท Screenshots

Screenshot

๐Ÿ“ถ Technologies

๐Ÿ’พ Setup

  • Install dependencies using npm i
  • Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
  • In a 2nd terminal, cd to /functions and run npm i then npm run serve to install backend dependencies, create build file and start up Functions emulator
  • navigate to localhost../api/databaseKey the realtime database value will be displayed
  • Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.
  • Run ng update to update Angular

๐Ÿ’ป Code Examples

  • functions index.ts function to retrieve value from Firebase realtime database for key supplied
// get value corresponding to key supplied
app.get("/database_ref", (request, response) => {
  const db = admin.database();
  const ref = db.ref("database_ref");
  ref.once("value").then((value) => {
    response.send(value);
  })
      .catch((err) => console.error(err));
});

๐Ÿ†’ Features

  • Firebase Cloud Functions can be used is a serverless framework that allows backend code to be run automatically in response to https requests and Firebase features.

๐Ÿ“‹ Status & To-Do List

  • Status: Working
  • To-Do: Add other functions and database key-values

๐Ÿ‘ Inspiration

๐Ÿ“ License

  • This project is licensed under the terms of the MIT license.

โœ‰๏ธ Contact

angular-firebase-functions's People

Contributors

andrewjbateman avatar

Stargazers

 avatar

Watchers

 avatar  avatar  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.