Giter VIP home page Giter VIP logo

quiz-api's Introduction

quiz-api

This is part 1 of a two-part series covering a full-stack application example.

In this part we walk through setting up a back-end data API, using Google Cloud Functions and Cloud Firestore.

Make sure you have NodeJS installed before proceeding any further. You can check by typing in node -v at the terminal or command prompt.

Usage steps:

  1. Log into Google Firebase console
  2. Create project
  3. Database -> Cloud Firestore
  4. Add a collection called 'quiz'
  5. Add some documents in that collection

Then:

  1. npm install -g firebase-tools

  2. mkdir project-folder && cd project-folder

    • make sure you're inside the project folder before the next step
  3. firebase init

    • use the arrow keys to move up and down the list of features; we need Functions
    • select Functions with spacebar and press Enter
    • similarly, select the Firebase project name you created earlier
    • for the rest of the init prompts, take defaults, i.e. just press Enter
    • at the end should say something like Firebase initialisation complete
  4. open your functions/index.js in code editor

  5. paste in code from the file functions/index.js that you'll find in this repo

  6. firebase deploy at the terminal or command prompt

    • at the end should say something like Deploy complete
    • deploy needs to be repeated each time you change this code

Make sure that firebase commands like init and deploy are run in your project folder.

Related links and references


Join us at Mississauga Coding!

Find out about upcoming events by checking out:

Post your questions on any of these forums, attend our events, learn and share.

Happy Coding!

Mississauga Coding

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.