Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

All Aboard: Faucet Demo Application

Example faucet web application using the AllAboard Faucet API. This example uses Firebase for the demo static webpage and demo serverless cloud functions.

last commit license standard-readme compliant app health

Screenshot

Table of Contents

Installation

Using Firebase (fastest)

Checkout the quickstart for Firebase and if you want to run the serverless functions locally checkout the Firebase local emulator.

  1. Use your Google Firebase account and create a new project in Firebase

  2. Turn on the Blaze plan, aka "Pay as You Go" in the billing section (required to make external cloud function requests)

  3. Install the Firebase CLI

  4. Login to Firebase (opens a web browser to login to Google)

$ firebase login

 ? Allow Firebase to collect anonymous CLI usage and error reporting information? No
  1. Initialize the project from inside your project directory.
$ cd /Users/YourName/projects/my-demo-faucet
$ firebase init

Choose these settings to host a static website with serverless Cloud Functions

 * You are initializing in an existing Firebase project directory
  
? Which Firebase CLI features do you want to setup for this folder?
❯ ◉ Functions: Configure and deploy Cloud Functions
❯ ◉ Hosting: Configure and deploy Firebase Hosting sites
 
? What language would you like to use to write Cloud Functions? JavaScript

? Do you want to use ESLint to catch probable bugs and enforce style? Yes

? File functions/package.json already exists. Overwrite? No

? File functions/.eslintrc.json already exists. Overwrite? No

? File functions/index.js already exists. Overwrite? No

? Do you want to install dependencies with npm now? Yes

? What do you want to use as your public directory? public

? Configure as a single-page app (rewrite all urls to /index.html)? Yes

? File public/index.html already exists. Overwrite? No
  1. Go to All Aboard and generate a new Faucet API key.

  2. Set an environment variable in Cloud Functions for the above Faucet API key

$ firebase functions:config:set allaboard.key="YOUR_FAUCET_KEY"
  1. Deploy the code and functions (takes a few minutes the first time)
$ firebase use Your-Firebase-Project-ID
$ firebase deploy

Testing Firebase Deployment

  • First, test that the website deployed by opening a web browser and navigating to the url:
https://Your-Firebase-Project-ID.firebaseapp.com/
  • Second, test your cloud function to see it returns the desired response (address, balance):
$ curl -X GET https://us-central1-Your-Firebase-Project-ID.cloudfunctions.net/status

{"address":"14U9TLN3u9ncW2YQQJCMThBoB9XNigBDvN","balance":0}

Documentation

Examples

Code Standards

  • Always use the language's best practices
  • For the serverless cloud functions we follow the ESLint rules.

Usage

  • Use this current demo to create a cloud based web application in minutes
  • Setup your own custom application using the AllAboard API

Maintainers

Satchmo - MrZ

Support the development of this project and the AllAboard team 🙏

Donate

Contributing

Feel free to dive in! Open an issue or submit PRs.

License

License

About

App demonstrating how to use the All Aboard API's faucet endpoints

Resources

License

Releases

No releases published

Packages

No packages published