Skip to main content

Cloud Engineer Setup Guide

Welcome to the Cloud Engineer Setup Guide for m00m world! This guide will help you configure your cloud development environment, set up necessary tools, and get you ready to contribute to our cloud infrastructure.

Prerequisites

  • Git: Ensure you have Git installed on your machine. You can download it from git-scm.com.
    • We recommend using Git 2.39 or higher.
    • 🍎 Mac users can use brew install git to install Git via Homebrew.
  • Docker: Install Docker Desktop from docker.com to manage containerized applications.
  • Node.js: Install Node.js from nodejs.org for running JavaScript applications.
    • We recommend using Node Version Manager
  • WebStorm: Download and install WebStorm for cloud development.
  • Firebase CLI: Install the Firebase CLI by running npm install -g firebase-tools in your terminal.

Step 1: Clone the Cloud Project Repository

  1. Open a terminal or command prompt.
  2. Ensure you have Git installed and configured. You can check by running git --version.
  3. Ensure you have proper SSH credentials set up for GitHub on your machine. Follow GitHub's guide if needed.
  4. Navigate to the directory where you want to clone the repository, e.g., ~/m00m/.
> git clone git@github.com:m00m-world/m00m-functions.git CloudFunctions
> cd CloudFunctions
> npm install
  1. This will clone the Cloud Functions repository and install the necessary dependencies.
  2. Open the cloned project in WebStorm.

Step 2: Configure Firebase

  1. Open the terminal (WebStorm or System).
  2. Run firebase login to authenticate with your Google account.

Test Changes Locally

  1. To test your changes locally, run:
> firebase emulators:start
  1. This will start the Firebase emulators for functions, Firestore, and other services you have configured.
  2. You can test your functions by making HTTP requests to the local emulator endpoints.
  3. Make sure to check the logs in the terminal for any errors or output from your functions.
  4. You can also use tools like Postman or cURL to test your HTTP functions locally.
  5. If you need to test Firestore interactions, you can use the Firebase Emulator UI by navigating to http://localhost:4000 in your web browser.
  6. Make sure to test all your functions thoroughly before deploying them to production.

Deploy

To deploy your changes, run the following from the root CloudFunctions directory

Development Production

> ./deploys/development.sh --target {ApiWrapper.js Child Key}
warning

It is important to only deploy a small segment key at a time, as deploying the entire codebase can lead to issues with the Firebase environment. Always test your changes locally before deploying to production.

Production Deployment

> ./deploys/production.sh --target {ApiWrapper.js Child Key}

Additional Resources