Function Store
  • Home
  • Getting started
    • Introduction
    • Installing a function
    • Reconfiguring a function
    • Uninstalling a function
    • FAQs
  • Reference
    • Requirements
      • Assign Roles
        • User permissions
      • Link a Billing account to your project
      • Enable the APIs
    • Projects
      • How to add a project
      • How to set up a project
    • Functions
      • Benefits
      • Use cases
      • Authentication when installing
      • Runtime configuration
      • Deploying with a ZIP file
    • Policies
      • How to add a Policy
      • How to remove a Policy
    • Authentication
      • Users
      • Roles
      • Permissions
    • Secrets
      • Creating a Secret
      • Using a Secret
      • Changing the value for a Secret
      • Deactivating a Secret
  • developers
    • Overview
    • Getting Started
    • Set up
    • Workspaces
      • Create a workspace
      • Workspace boilerplate
      • Node engines
    • Writing Functions
      • Function Anatomy
      • Configuration file
      • Function Triggers
      • Environment Variables
        • Type "text"
        • Type "number"
        • Type "email"
        • Type "url"
        • Type "json"
        • Type "boolean"
        • Type "select"
        • Type "multiselect"
        • Type "firestoreDocumentPath"
        • Type "firestoreCollectionPath"
        • Type "color"
      • Documentation
    • Push/Update your functions in the cloud
    • Continuous Integration
    • Publish functions in the Marketplace
    • Emulators
      • Initialize emulators in your workspace
      • Environment variables
      • Starting emulators
      • Testing your functions in the emulator
      • Importing existing data into local emulators
        • Exporting data from Cloud Firestore to local emulator
        • Exporting user accounts from Firebase to local emulator
    • Visual Studio Code Extension
      • Installing the extension
      • Extension UI
      • Functions list
      • Creating and editing functions
      • Emulators
      • Extension settings
      • Troubleshooting
        • "Command not found" error when executing a command
  • Billing
    • Understanding Billing
  • Security
    • Security
  • Resources
    • Events and Triggers
    • Best Practices
      • How to log events in functions?
    • Document your Functions
    • Editorial guidelines
    • Our Processes
      • Use Cases Analysis
  • Use cases
    • Custom Stripe Checkout
Powered by GitBook
On this page
  • Purpose
  • Scope
  • Procedures

Was this helpful?

  1. Resources
  2. Our Processes

Use Cases Analysis

How to convert valid use cases into ready-to-implement Cloud Functions.

PreviousOur ProcessesNextCustom Stripe Checkout

Last updated 3 years ago

Was this helpful?

Purpose

The purpose of this document is to create a simple and scalable process that allows us to convert valid uses cases into ready-to-implement Cloud Functions.

Scope

This procedure applies to any team of architects that obtains a use case and wants to implement it using reusable Cloud Functions.

Procedures

1. Use Case Analysis

When we find a Use Case, the first question we ask ourselves is Is this a valid use case? To answer this question we go through analysis and discussions based on the following basic parameters:

  • Jobs: describe the things your customer are trying to get done in their work. Tasks that the customer is trying to perform and complete, the problems they are trying to solve, or the needs they are trying to satisfy.

  • Pain Points: describe anything that annoys your customer before, during, and after trying to get a job done. Also, describe risks, that is, potential bad outcomes, related to doing a bad job or doing nothing.

  • Expected Gains: describe the outcome and benefits your customers want. Some gains are required, expected or, desired by customers, and some would surprise them.

If our use case responds to at least one of the parameters above means that we have a valid use case, then we can move forward to the next step.

2. Architecture Design

As we begin the process of designing possible solutions to this problem, it's important to answer these three questions:

  • Is it possible to solve the problems using cloud functions?

  • Can we make the functions available in a reusable way?

  • How?

The outcome of this step is a set of function definitions, which translates into a list of function.config.json files. Depending on the function trigger, you may need to define the usage API for your functions.

On the function.config.json, you need to define the following values in each function:

  • Name

  • Description

  • Trigger

  • Environment Variables

Here is an example of a function.config.json file where the use case is to send a welcome email when a new customer signs up in the application:

{
    "name": "sendSignUpWelcomeEmail",
    "description": "Send a welcome email when users sign up throughout a SendGrid template.",
    "tags": [ "sendGrid", "sign up", "email"],
    "trigger": {
        "provider": "auth",
        "event": "user.create"
    },
    "env": [
        {
            "name": "SENDGRID_API_KEY",
            "description": "The API key to authenticate access to SendGrid services.",
            "required": true
        },
        {
            "name": "SENDGRID_SENDER_EMAIL",
            "description": "Email corresponding to SendGrid sender correctly verified.",
            "required": true
        },
        {
            "name": "SENDGRID_TEMPLATE_ID",
            "description": "The ID of SendGrid dynamic template that will be used to generate the welcome email.",
            "required": true
        }
    ]
}

3. Implementation

The implementation process begins with the requirements defined in the "Architecture Design" step. To be more specific in the implementation process, Go to the Next Page(WIP).