Giter Club home page Giter Club logo

fileforge-triggerdev's Introduction

Trigger.dev (v3) + Fileforge


The easiest way to generate documents, reports, and presentations from your data! This example is free for most use cases.

Advantages of using Trigger.dev + Fileforge:

  • Stack agnostic: Trigger.dev runs your functions in a runtime compatible with Fileforge. You can trigger your functions from any language or platform, including Python, Node.js, Ruby, Go, Java, and more.
  • No infrastructure: rendering documents is a heavy task that requires a lot of resources. Trigger.dev and Fileforge take care of all the infrastructure for you.
  • Use React: even if you do not have a React stack, you can use React to generate your documents.
  • Easy to monitor: Trigger.dev provides a dashboard where you can see the status of your functions and logs.

Getting started

Create a Trigger.dev account

Head to Trigger.dev and create an account. You will also be prompted to create a project. If you already are a Trigger.dev user, you can just create a project or use an existing one.

Create a Fileforge account

Head to Fileforge and create an account. Your API key will be displayed on the dashboard.

Fileforge dashboard

Configure the repository

Start by cloning this repository:

git clone https://github.com/onedoclabs/fileforge-triggerdev.git
cd fileforge-triggerdev

Then, install the dependencies:

npm install

Configure the environment variables

You can copy and rename the .env.example file to .env:

cp .env.example .env

Then, open the .env file and fill in the TRIGGERDEV_API_KEY and FILEFORGE_API_KEY variables.

  • TRIGGERDEV_API_KEY can be found in the Trigger.dev dashboard, on the left hand side, under API Keys.
  • FILEFORGE_API_KEY can be found in the Fileforge dashboard, in the dark box at the top.

Configure the Trigger.dev project ID

You can find the project ID in the Trigger.dev dashboard, on the left hand side, under Projects.

Then, open the trigger.config.ts file and replace the triggerProjectID value with your project ID.

const triggerProjectID = "your-project-id";

Run the example

Start the Trigger dev server

This command will start the Trigger dev server. This server will respond to test requests from the Trigger.dev dashboard.

npm run dev

Then, head over to the Trigger.dev dashboard and click on the Test button. You should see the function.

Trigger.dev test

Run a test request

When clicking on the function, you can set a payload value and run the test.

Trigger.dev test run

View the logs

You can now view the logs and your generated document by using the URL logged in the console.

Trigger.dev URL result

NB: the URL in the return preview is truncated. You should use the console URL to view the full document.

View the document

You can now view the document generated by the function.

Generated document

Deploying

Set up the Fileforge environment variable

Head to your Trigger.dev dashboard and set the FILEFORGE_API_KEY environment variable (under Environment Variables) to the value of your Fileforge API key.

Deploy the function

To deploy the function, use the following command:

npm run deploy

fileforge-triggerdev's People

Contributors

titou325 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.