Before reading this documents, you should be acknowledged that the deployment process should only be done by people that have sufficient knowledge in the Information and Communication Technology. Stupidly deploying this program in an unproper way can results in breaking your computer or even more. You are also told that the author of this deployment guide cannot be hold liable for any contents in this guide and the corresponding app as well, use it at your own risk!
If you find difficulties in deploying this application or you want to view the working demo, feel free to contact me via email [email protected]. My github username is michaellee8.
- You will proably need
sudo
access oradmistrator
access to perform the below actions. - Running the app server requires internet connection that can at least connect to the npm repo and google firebase, and the server have to be accessible from internet with proper internet setting like firewalls so that the firebase auth server have the ability to communicate with it. The access rules should at least allows traffic at port
8080
for server communication with firebase. If you want to access the client app outside the server device, you should also allow port3000
- Setting up firebase for usage of this app requires your credit card information, but the amount of usage for testing purpose will not exceed the free usage limits. If you use this app in a non-testing scale, it may exceed the free usage limits and you might be charged.
- To protect yourself from bills, do not publically announce usage of this app.
- After your testing, you should delete the Firebase project to make sure that no accidentical charges will be applied.
- Running some of the commands need admin access, you will need to run a cmd terminal as a adminstrator if you are using Windows, or append
sudo
before your command if you are using Linux, e.g.sudo npm xxx
- Navigate to https://console.firebase.google.com/?pli=1
- Create a project with name
michaellee8-sba-revisioner
, you may want to record the project id for later identification. - In the lower-bottom corner, click UPGRADE and select BLAZE plan. Perform all the instructions as required by google including registering your credit card
- Make sure you have enough disk space in your computer before you do anything. Empty space of about 10GBs can be enough.
- Install the "Current" version of nodejs at https://nodejs.org/en/, which will have both
npm
andnodejs
installed into your computer. - Install the newest version of MySQL from https://dev.mysql.com/downloads/mysql/, your root account should have password
ggg-revisioner
. - In your command-line interface (CLI), run
npm --global install firebase-tools
to install the firebase toolkit provided by google. npm install -g serve
to install the program for serving webpage.
- Start the terminal and navigate to the provided folder called
revisioner-sba
. cd revisioner-graphql
to change to current working directory to the server project.npm install
to install the required dependencies.- Navigate to your Firebase project setup previously, which should be named
michaellee8-sba-revisioner
in the Firebase Project Console. - Next to the
Overview
located at the top-right corner of the screen, there is a "gear" button, click it to go to the setting page. - Go to the "Service Accounts" tab and then click "Firebase Admin SDK".
- Click "Generate New Private Key" and then click "Generate Key".
- Move the downloaded file to
/path/to/project/michaellee8-sba-revisioner/revisioner-graphql/src
, it should be namedserviceAccountKey.json
. Replace it if it already exists. - In line 8 of
/path/to/project/michaellee8-sba-revisioner/revisioner-graphql/src/firebaseAuth.js
, changehttps://revisioner-3c321.firebaseio.com
into thedatabaseURL
in the "Admin SDK configuration snippet". npm run initDb
to initiate the SQL database.npm start
to start the server.- Navigate to
IP-OR-URL.OF.SERVER:8080/graphql
and check out thegraphiql
editor. It should shows up if the program is functioning correctly.
cd ../revisioner
to navigate to/path/to/project/michaellee8-sba-revisioner/revisioner
firebase login --no-localhost
to login into firebase.firebase use YOUR-FIREBASE-PROJECT-NAME
to link your project with firebase.firebase init functions
to configure the fucntions. Do not override or replace any current content. Choose the project you created in 1.2 if you are asked.- Change
https://michaellee8-nuclide-server.appspot.com/graphql
in line 3 of/path/to/project/michaellee8-sba-revisioner/revisioner/functions/index.js
intohttps://IP-OR-URL.OF.SERVER:8080/graphql
, which is similar to the one in 3.12. firebase deploy --only functions
to deploy the functions.
- Make sure your current working directory is
/path/to/project/michaellee8-sba-revisioner/revisioner
. - Navigate to your Firebase project setup previously, which should be named
michaellee8-sba-revisioner
in the Firebase Project Console. - In the "Overview" page, Click "Add Firebase to your webapp".
- Copy the part of code snipet of e.g.
{apiKey:"xxx",authDomain:"xxx",xxx:xxx,messagingSenderId:"xxx"}
to your clipboard. - Replace
{apiKey: "xxx", authDomain: "xxx", databaseURL: "xxx", projectId: "xxx", storageBucket: "xxx", messagingSenderId: "xxx"}
/path/to/project/michaellee8-sba-revisioner/revisioner/src/base.js
, which should be located in line 3 to 10. npm build
to build the client webapp.- Wait until it the terminal says the program is compiled (transpliled if you need a more formal term) .
- If you are deploying with in the current computer and have access to
localhost
, fireup the browser and go tolocalhost:3000
, otherwise go toIP-OR-URL.OF.SERVER:3000
- Navigate to your Firebase project setup previously, which should be named
michaellee8-sba-revisioner
in the Firebase Project Console. - Next to the
Overview
located at the top-right corner of the screen, there is a "gear" button, click it to go to the setting page. - Click the "General" Tab.
- Scroll to the bottom of page.
- Do what as told to delete the project to stop being charged.