Show HN: REPL for Your Firebase Cloud Functions
Hello HN, OP here.<p>My friend and I have built Foundry for ourselves to have a better way of developing Firebase Cloud Functions.<p>It&#x27;s a command-line tool that works like an interactive read-eval-print-loop for your cloud functions. Everything happens in real-time. It connects you to a pre-configured cloud environment and with every code change you make, it triggers your functions and sends you back the output.<p>It may sound similar to testing your functions locally with existing tools but there are a few key differences:<p>- There isn&#x27;t any configuration. Just run `$ foundry init` and then `$ foundry go` and you&#x27;re ready. A lot of people complained to us that they didn&#x27;t know how to set up a local environment to their Firebase Cloud Functions or they didn&#x27;t want to spend time on it. We made it as much straightforward as possible.<p>- With Foundry, your functions will run in an environment that is almost identical to the environment where your functions are deployed (we tried really hard to have it behave like in production). So you don&#x27;t have unexpected production bugs. You don&#x27;t have to create a separate Firebase project as your staging environment. Foundry is your staging environment.<p>- We use the Firestore emulator and we also emulate Firebase Auth users ourselves. You can use the Admin SDK as you would normally and have access to your data.  You can easily access your production data. In the config file, you specify what data you want to copy from your production Firestore and production users. We copy the data and fill the emulated Firestore and Firebase Auth. No need to maintain any custom scripts. You just write your code as you would normally. For example, you can write the following in the config file:<p><pre><code>    users:
      # Copy first 5 users from your Firebase project
      - getFromProd: 5 
      # Copy users with the specified IDs from your Firebase project
      - getFromProd: [&#x27;id-1&#x27;, &#x27;id-2&#x27;] 
    # Copy first 3 documents from production from the collection &#x27;userWorkspaces&#x27;
    # also add a custom document with id &#x27;new-user-workspace&#x27; with a new data
    # format that you want to use
    firestore:
     - collection: userWorkspaces
       docs:
         - getFromProd: 3
         - id: new-user-workspace
           data: {&quot;newDataFormat&quot;: 42}

</code></pre>
We copy the data for you. You access this data as you would normally in your Firebase functions code - with the Admin SDK<p>- You don&#x27;t have to manually trigger your functions to run them, we trigger them for you every time you make a change in your code. You just specify how you want to trigger in the config file. For example:<p><pre><code>  functions:
     - name: onUserSignUp
       type: auth
       trigger: onCreate
       createUser:
         - id: new-user-id-1
           data: {&quot;displayName&quot;: &quot;John&quot;}

</code></pre>
On each code change, this will trigger the userSignUp function in your code with a user object with id new-user-id-1 with the user&#x27;s data {&quot;displayName&quot;: &quot;John&quot;} This way, the development is very interactive because you always have a response and always know whether your code will run on production and with your production data. It all happens in real-time, it&#x27;s like a read-eval-print-loop for your functions.<p>- It&#x27;s fast. It usually takes 1-2 seconds to get the results back. That&#x27;s with the deployment time.<p>The reason we are building this is that we have always struggled to easily develop &amp; test our functions&#x2F;backend. We talked to a lot of Firebase developers and they shared our problems. People are either deploying their functions into production just to test their code and have access to their production data or they spend a lot of time configuring their local environment and creating separated Firebase projects with dummy data.<p>It&#x27;s really annoying to deploy your functions on Firebase, every time you want to check if your code is working. Just the deployment itself takes 2-5 minutes, not to speak about the needed context switches from your code editor. If you are doing this multiple times per day, you are losing a serious development time.<p>Currently, we are in beta. It&#x27;s completely free and you can use it without any registration (an anonymous user will be created for you that you can later link to your real account). We don&#x27;t store any of your data or code for a time longer than is your session. The only exception is the environment variables you can set.<p>Feel free to ask any questions and let me know if you are using Firebase Cloud Functions and would like to try it out. I&#x27;m more than happy to help you set it up in your project!<p>GitHub repo - <a href="https:&#x2F;&#x2F;github.com&#x2F;FoundryApp&#x2F;foundry-cli" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;FoundryApp&#x2F;foundry-cli</a><p>Docs - <a href="https:&#x2F;&#x2F;docs.foundryapp.co&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.foundryapp.co&#x2F;</a><p>Website - <a href="https:&#x2F;&#x2F;www.foundryapp.co&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.foundryapp.co&#x2F;</a>