Skip to content

Latest commit

 

History

History
90 lines (61 loc) · 2.34 KB

DEPLOY-GUIDE-SERVERLESS.md

File metadata and controls

90 lines (61 loc) · 2.34 KB

Serverless Deployment Guide

Follow the 5 steps guide below to get started on Firebase!

Also do let us know how we can help make this better 😺

Step 0 - Clone Me

	$ git clone https://github.com/uilicious/inboxkitten.git

Step 1a - Setup Firebase

  1. Go to Firebase and click on Get Started.
  2. Sign in with your favorite Google account.
  3. Click on Add Project and create your own firebase inboxkitten project.
  4. Remember the project ID

On your local machine where your InboxKitten is located at,

	# Go to the root folder of InboxKitten
	$ cd <the place where you clone your inboxkitten>
	
	# Ensure that firebase CLI tool is installed
	$ npm install -g firebase-tools
	
	# Login to your firebase account
	$ firebase login
	
	# Set your firebase project
	$ firebase use --add <project name that you remembered>

OR

Step 1b - Setup Cloudflare Workers

  1. Go to Cloudflare and signup with a domain.
  2. Setup cloudflare worker and get an API key

Step 2 - Configuration

In the root directory of Inboxkitten, run the following command

	$ ./config.sh

During the run time of ./config.sh, there are three environment variables that is being used to set the configuration for your configuration files.

  1. MAILGUN_EMAIL_DOMAIN - any custom domain that you owned or the default domain in Mailgun
  2. WEBSITE_DOMAIN - any custom domain that you owned. If you use your default firebase url, it will be <Your project>.firebaseapp.com
  3. MAILGUN_API_KEY - retrieve the api key from your Mailgun account

configuration


Step 3 - Build the package

	$ ./build.sh

./build.sh will package the three components to be ready for deployment.


Step 4 - Deployment

For API deployment on Firebase:

	# Run the deployment script
	$ ./deploy/firebase/deploy.sh 

For API deployment on Cloudflare:

	# Run the deployment script
	$ ./deploy/cloudflare/deploy.sh