Skip to content

Setting up your instance

Ted Hwang edited this page Nov 26, 2020 · 27 revisions

Setting up your instance of mipa

After obtaining a copy of mipa (best done by forking and cloning the repository if you wish to contribute), do the following to run your instance.

These instructions are current as of 2020.10.14. If you notice that something in the process has changed, please help update this documentation.

Create a project on Google Firebase

  1. Go to https://console.firebase.google.com/ (you may need to create an account first)
  2. Click Add project. Name the new project something like "mipa-your-name". Enabling Google Analytics is optional.
  3. Once the Firebase project is created, click on the </> icon to add a web app. Give the app a nickname, like "my mipa web app". Check the box to set up Firebase Hosting. Then click Register app.
  4. Ignore "Add Firebase SDK" instructions. Mipa's code already has this set up. So just click Next.
  5. Install firebase-tools per on-screen instructions.
  6. Per on-screen instructions, sign in to Google; but don't initiate your project with firebase init or deploy it yet. Just click continue to console.
  7. On the firebase console, click Authentication. Then Get started to set up sign-in methods; enable Email/Password.
  8. On the firebase console, click Cloud Firestore. Then Create database; select Start in production mode; pick a database location that makes sense for you, then enable.
  9. From the bottom of the left navigation panel, change the Spark plan to Blaze plan. (This shouldn't be needed.)

Add your project's credentials

  1. Make a copy of the .env_sample file and name it .env.
  2. Back on the Firebase Console, go to Settings > General.
  3. In the newly created .env file, add in your Firebase project's credentials from the above steps. .env is already in .gitignore so the file will not be synced back to the repository.

Modify .firebaserc

  1. Make a copy of the .firebaserc_sample file and name it .firebaserc.
  2. In the file, in the "default" property, use your project id. .firebaserc is likewise already in .gitignore and will not be synced back to the repository.

Install dependencies for Cloud Functions

cd functions
npm install
cd ..

Install dependencies for other parts of the project

For the rest of the project we use yarn instead of npm because of the more deterministic way it chooses dependencies. This helps us developers keep our dependencies identical.

If you don't have yarn installed yet, follow these instructions to install it: https://classic.yarnpkg.com/en/docs/install/

Then:

yarn install

Build the app and deploy to Firebase

This will deploy to the environment you configured in your .env file.

quasar build
firebase deploy

If all went well, mipa will be running at https://your-project-id.web.app. Register an account for yourself, and try things out!