<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vince Fulco (It / It's)</title>
    <description>The latest articles on DEV Community by Vince Fulco (It / It's) (@vince_hirefunnel_co).</description>
    <link>https://dev.to/vince_hirefunnel_co</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F163983%2Ff98f2533-bebb-4be6-918e-1d23c6dd7e98.jpeg</url>
      <title>DEV Community: Vince Fulco (It / It's)</title>
      <link>https://dev.to/vince_hirefunnel_co</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vince_hirefunnel_co"/>
    <language>en</language>
    <item>
      <title>weaviate</title>
      <dc:creator>Vince Fulco (It / It's)</dc:creator>
      <pubDate>Sun, 15 Dec 2024 14:32:23 +0000</pubDate>
      <link>https://dev.to/vince_hirefunnel_co/weaviate-2d6g</link>
      <guid>https://dev.to/vince_hirefunnel_co/weaviate-2d6g</guid>
      <description></description>
      <category>emptystring</category>
    </item>
    <item>
      <title>duckdb</title>
      <dc:creator>Vince Fulco (It / It's)</dc:creator>
      <pubDate>Sun, 24 Nov 2024 09:14:40 +0000</pubDate>
      <link>https://dev.to/vince_hirefunnel_co/duckdb-341p</link>
      <guid>https://dev.to/vince_hirefunnel_co/duckdb-341p</guid>
      <description></description>
      <category>data</category>
    </item>
    <item>
      <title>DBOS-Cloud: Minimal Effort Change Data Capture (CDC) Tool</title>
      <dc:creator>Vince Fulco (It / It's)</dc:creator>
      <pubDate>Sun, 28 Jul 2024 08:01:13 +0000</pubDate>
      <link>https://dev.to/vince_hirefunnel_co/dbos-cloud-minimal-effort-change-data-capture-cdc-tool-4c0d</link>
      <guid>https://dev.to/vince_hirefunnel_co/dbos-cloud-minimal-effort-change-data-capture-cdc-tool-4c0d</guid>
      <description>&lt;p&gt;This is a simple &lt;a href="https://docs.dbos.dev/" rel="noopener noreferrer"&gt;DBOS&lt;/a&gt; example focusing on remote deployment to &lt;a href="https://www.dbos.dev/dbos-cloud" rel="noopener noreferrer"&gt;DBOS Cloud&lt;/a&gt;, their hosted solution with a generous free tier for devs.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/weisisheng/supabase-cdc-to-dbos-public" rel="noopener noreferrer"&gt;github repo&lt;/a&gt; sets up: 1) a workflow with an http api endpoint that receives events from Supabase when an INSERT is made to a table, 2) the same workflow archives the event payload to a DBOS hosted Postgres table, and 3) additional endpoints as utilities to view and delete all events while in development.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Make sure you have node.js 21.x&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sign up for DBOS Cloud (&lt;a href="https://www.dbos.dev/dbos-cloud" rel="noopener noreferrer"&gt;https://www.dbos.dev/dbos-cloud&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Have a Supabase account and a table you are inserting in to.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Clone the repository and navigate to the project directory&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install the dependencies&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;em&gt;Be sure not to commit / hard code your secrets to a public repo! This setup is meant for local development and direct deployment to the dbos-cloud service.&lt;/em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To deploy to DBOS-cloud, login with this, "&lt;strong&gt;&lt;em&gt;npx dbos-cloud login&lt;/em&gt;&lt;/strong&gt;" and follow the instructions to match the uuid given in the console to the one in the browser, then standard login user/password applies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Next provision a d'base instance: "&lt;strong&gt;&lt;em&gt;npx dbos-cloud db provision database-instance-name -U database-username&lt;/em&gt;&lt;/strong&gt;"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Register your app with the d'base instance: "&lt;strong&gt;&lt;em&gt;npx dbos-cloud app register -d database-instance-name&lt;/em&gt;&lt;/strong&gt;"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To use secrets in DBOS, add your variables in the cli like this:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;export PGPASSWORD=put-the-password-you-created-when-you-setup-the-remote-database-here&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These will be picked up at build time and inserted into the dbos-config.yaml fields: ${PGPASSWORD}.&lt;/p&gt;

&lt;p&gt;You will notice on line #56 of operations.ts, there is a @PostApi decorator which sets up a url with a randomly generated endpoint. This will be the receiver of events from Supabase. I created the randomly generated endpoint to protect the api (sometimes called protection by obfuscation). &lt;/p&gt;

&lt;p&gt;&lt;em&gt;**Note: this is not a recommended method! It was done as a quick and dirty dev hack. For real production use, you will want to use DBOS' &lt;a href="https://docs.dbos.dev/tutorials/authentication-authorization." rel="noopener noreferrer"&gt;authentication / authorization features&lt;/a&gt; *&lt;/em&gt;*&lt;/p&gt;

&lt;p&gt;Take the base url that DBOS returned when the deploy finished and add the randomly generated endpoint you create (instructions are in the code).&lt;/p&gt;

&lt;p&gt;It should look something like this: &lt;a href="https://foo-bar-dbos.cloud.dbos.dev/OBstAqG6qOv7cWXCqgg" rel="noopener noreferrer"&gt;https://foo-bar-dbos.cloud.dbos.dev/OBstAqG6qOv7cWXCqgg&lt;/a&gt;. You'll use this in the next step.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Supabase settings
&lt;/h2&gt;

&lt;p&gt;On the Supabase side, set up the trigger to publish changes externally by: 1) choosing the project you want to use, then on the left hand side menu go to "Database" --&amp;gt; "Webhooks".  2) create a new webhook, give it a name, choose the table to watch, and the events (in our case insert, but update and delete are also available).  Make sure the http request method is set to POST, then enter the URL created by DBOS-Cloud plus the randomly generated stub.  Hit "Create Webhook".&lt;/p&gt;

&lt;p&gt;Staying in the Supabase console, go to the "Table Editor", choose your table, and add a new row with the required inputs.&lt;/p&gt;

&lt;p&gt;Almost immediately, you should be able to query in Insomnia / Postman or curl given your specific DBOS supplied url, &lt;a href="https://foo-bar-dbos.cloud.dbos.dev/getEventData" rel="noopener noreferrer"&gt;https://foo-bar-dbos.cloud.dbos.dev/getEventData&lt;/a&gt;, and see the event.  &lt;/p&gt;

&lt;p&gt;For reference, here is the format of a sample event body sent to DBOS-Cloud:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{

    "type": "INSERT",

    "table": "fooData",

    "record": {

        "id": "tempId-e71m1dtxan6b5c0dqxkbhoez",

        "email": "joe@company.com",

        "lastName": "Blow",

        "firstName": "Joe",

        "created_at": "2024-07-25T06:03:10.792595+00:00",

        "updated_at": "2024-07-25T06:03:10.792595"

},

    "schema": "public",

    "old_record": null

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Record fields will vary based on how your table is structured. For simplicity purposes, in this example, I archive the JSON object in total vs. parsing the records further.&lt;/p&gt;




&lt;h2&gt;
  
  
  Reference Docs (From Official Repo)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;To add more functionality to this application, modify &lt;code&gt;src/operations.ts&lt;/code&gt;, then rebuild and redeploy it.&lt;/li&gt;
&lt;li&gt;For a detailed tutorial, check out our &lt;a href="https://docs.dbos.dev/getting-started/quickstart-programming" rel="noopener noreferrer"&gt;programming quickstart&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;To learn how to deploy your application to DBOS Cloud, visit our &lt;a href="https://docs.dbos.dev/getting-started/quickstart-cloud/" rel="noopener noreferrer"&gt;cloud quickstart&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;To learn more about DBOS, take a look at &lt;a href="https://docs.dbos.dev/" rel="noopener noreferrer"&gt;our documentation&lt;/a&gt; or our &lt;a href="https://github.com/dbos-inc/dbos-transact" rel="noopener noreferrer"&gt;source code&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Resources to learn more --
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/dbos-inc/awesome-dbos" rel="noopener noreferrer"&gt;Awesome-dbos&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first &lt;a href="https://dev.to/vince_hirefunnel_co/dbos-cloud-simple-and-robust-workflow-orchestration-cn4"&gt;article&lt;/a&gt; in this series uses cron and &lt;a href="https://postmarkapp.com/" rel="noopener noreferrer"&gt;Postmark&lt;/a&gt; email service provider.&lt;/p&gt;

&lt;p&gt;The second &lt;a href="https://dev.to/vince_hirefunnel_co/dbos-cloud-fast-and-free-automatic-data-aggregator-2gdd"&gt;article&lt;/a&gt; in this series aggregates and archives data from &lt;a href="//www.supabase.com"&gt;Supabase&lt;/a&gt; tables.&lt;/p&gt;

</description>
      <category>dbos</category>
      <category>workflows</category>
      <category>postgres</category>
      <category>orchestration</category>
    </item>
    <item>
      <title>DBOS-Cloud: Fast and Free Automatic Data Aggregator</title>
      <dc:creator>Vince Fulco (It / It's)</dc:creator>
      <pubDate>Sat, 20 Jul 2024 03:03:09 +0000</pubDate>
      <link>https://dev.to/vince_hirefunnel_co/dbos-cloud-fast-and-free-automatic-data-aggregator-2gdd</link>
      <guid>https://dev.to/vince_hirefunnel_co/dbos-cloud-fast-and-free-automatic-data-aggregator-2gdd</guid>
      <description>&lt;p&gt;This is a simple &lt;a href="https://docs.dbos.dev/" rel="noopener noreferrer"&gt;DBOS&lt;/a&gt; app example focusing on remote deployment to &lt;a href="https://www.dbos.dev/dbos-cloud" rel="noopener noreferrer"&gt;DBOS Cloud&lt;/a&gt;, their hosted solution with a generous free tier for devs.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/weisisheng/aggdata-supabase-public" rel="noopener noreferrer"&gt;github repo&lt;/a&gt; sets up a cron job which: 1) performs a "SELECT COUNT" on a Supabase Postgres database table and 2) an "INSERT" to a second table.  Consider it a starter for a poor man's data lake aggregating data in the receiving table. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note: This is not the fastest, most compact and recommended way to create this workflow. DBOS-Cloud has terrific in-app full Postgres database functionality.  Check out the &lt;a href="https://docs.dbos.dev/tutorials/transaction-tutorial" rel="noopener noreferrer"&gt;transactions&lt;/a&gt; section for more. I built the script this way since I had pre-existing data stored on &lt;a href="https://supabase.com/" rel="noopener noreferrer"&gt;Supabase&lt;/a&gt;.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Make sure you have Node.js 21.x&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sign up for DBOS Cloud (&lt;a href="https://www.dbos.dev/dbos-cloud" rel="noopener noreferrer"&gt;https://www.dbos.dev/dbos-cloud&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Have a Supabase account and get your project url (&lt;a href="https://foobar.supabase.co/rest/v1" rel="noopener noreferrer"&gt;https://foobar.supabase.co/rest/v1&lt;/a&gt;) and project API anon key. Check out the Supabase &lt;a href="https://supabase.com/docs/guides/api/creating-routes#api-url-and-keys" rel="noopener noreferrer"&gt;docs&lt;/a&gt; to get them. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make sure to have two tables set up, the first can have any data in it as we will be counting rows, and the second table should have the columns "id", "count", and "created_at". &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;Clone this repository and navigate to the project directory&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Install the dependencies&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To deploy to DBOS-cloud, login with this, "&lt;strong&gt;&lt;em&gt;npx dbos-cloud login&lt;/em&gt;&lt;/strong&gt;" and follow the instructions to match the uuid given in the console to the one in the browser, then standard login user/password applies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Next provision a d'base instance: "&lt;strong&gt;&lt;em&gt;npx dbos-cloud db provision database-instance-name -U database-username&lt;/em&gt;&lt;/strong&gt;"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Register your app with the d'base instance: "&lt;strong&gt;&lt;em&gt;npx dbos-cloud app register -d database-instance-name&lt;/em&gt;&lt;/strong&gt;"&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Secrets Handling
&lt;/h2&gt;

&lt;p&gt;To use secrets in DBOS, add your variables in the cli like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;export PGPASSWORD=password-when-you-setup-the-remote-database-here&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;export SUPABASE_URL=&lt;a href="https://foobar.supabase.co" rel="noopener noreferrer"&gt;https://foobar.supabase.co&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;export SUPABASE_ANON_KEY=long-foo-bar-key &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;export SOURCE_TABLE=source-table-name &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;export DESTINATION_TABLE=destination-table-name &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These will be picked up at build time and inserted into the dbos-config.yaml fields: ${PGPASSWORD}, ${SUPABASE_URL}, ${SUPABASE_ANON_KEY}, ${SOURCE_TABLE},  ${DESTINATION_TABLE} respectively. Don't use quotation marks wrapping the values. The PGPASSWORD is for the basic user (not admin) Postgres service, which won't be used here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Be sure not to commit / hard code your secrets to a public repo! This setup is locally developed and directly deployed to the dbos-cloud service.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Get ready to deploy!
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;And finally deploy your app: "&lt;strong&gt;&lt;em&gt;npx dbos-cloud app deploy&lt;/em&gt;&lt;/strong&gt;"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After 5 minutes, assuming you have data in your source table, check your destination table for entries.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you are not getting expected results:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Login to the monitoring &lt;a href="https://docs.dbos.dev/cloud-tutorials/monitoring-dashboard" rel="noopener noreferrer"&gt;dashboard&lt;/a&gt; using this "&lt;strong&gt;&lt;em&gt;npx dbos-cloud dashboard url&lt;/em&gt;&lt;/strong&gt;"and check the collection of logs. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To delete the app online,&lt;code&gt;npx dbos-cloud app delete [application-name] --dropdb&lt;/code&gt;. Remove the '--dropdb' parameter if you want to retain the database table.  If you don't delete it, the cron script will continue to run. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are so many more benefits to mention re: workflow orchestration, observability, debugging, monitoring and overall speed, security, and costs which can be explored further here: &lt;a href="https://docs.dbos.dev/" rel="noopener noreferrer"&gt;https://docs.dbos.dev/&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Reference Docs (From Official Repo)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;To add more functionality to this application, modify &lt;code&gt;src/operations.ts&lt;/code&gt;, then rebuild and redeploy it.&lt;/li&gt;
&lt;li&gt;For a detailed tutorial, check out our &lt;a href="https://docs.dbos.dev/getting-started/quickstart-programming" rel="noopener noreferrer"&gt;programming quickstart&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;To learn how to deploy your application to DBOS Cloud, visit our &lt;a href="https://docs.dbos.dev/getting-started/quickstart-cloud/" rel="noopener noreferrer"&gt;cloud quickstart&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;To learn more about DBOS, take a look at &lt;a href="https://docs.dbos.dev/" rel="noopener noreferrer"&gt;our documentation&lt;/a&gt; or our &lt;a href="https://github.com/dbos-inc/dbos-transact" rel="noopener noreferrer"&gt;source code&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Resources to learn more --
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://github.com/dbos-inc/awesome-dbos" rel="noopener noreferrer"&gt;Awesome-dbos&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first &lt;a href="https://dev.to/vince_hirefunnel_co/dbos-cloud-simple-and-robust-workflow-orchestration-cn4"&gt;article&lt;/a&gt; in this series using cron and &lt;a href="https://postmarkapp.com/" rel="noopener noreferrer"&gt;Postmark&lt;/a&gt; email service provider.&lt;/p&gt;

</description>
      <category>dbos</category>
      <category>workflows</category>
      <category>postgres</category>
      <category>orchestration</category>
    </item>
    <item>
      <title>DBOS-Cloud: Fast and Free Automatic Supabase Table Copier</title>
      <dc:creator>Vince Fulco (It / It's)</dc:creator>
      <pubDate>Sat, 20 Jul 2024 02:52:49 +0000</pubDate>
      <link>https://dev.to/vince_hirefunnel_co/dbos-cloud-fast-and-free-automatic-supabase-table-copier-2d65</link>
      <guid>https://dev.to/vince_hirefunnel_co/dbos-cloud-fast-and-free-automatic-supabase-table-copier-2d65</guid>
      <description>&lt;p&gt;This is a simple &lt;a href="https://docs.dbos.dev/" rel="noopener noreferrer"&gt;DBOS&lt;/a&gt; app example focusing on remote deployment to &lt;a href="https://www.dbos.dev/dbos-cloud" rel="noopener noreferrer"&gt;DBOS Cloud&lt;/a&gt;, their hosted solution with a generous free tier for devs.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/weisisheng/aggdata-supabase-public" rel="noopener noreferrer"&gt;github repo&lt;/a&gt; sets up a cron job which: 1) performs a "SELECT COUNT" on a Supabase Postgres database table and 2) an "INSERT" to a second table.  Consider it a starter for a poor man's data lake aggregating data in the receiving table. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note: This is not the fastest, most compact and recommended way to create this workflow. DBOS-Cloud has terrific in-app full Postgres database functionality.  Check out the &lt;a href="https://docs.dbos.dev/tutorials/transaction-tutorial" rel="noopener noreferrer"&gt;transactions&lt;/a&gt; section for more. I built the script this way since I had pre-existing data stored on &lt;a href="https://supabase.com/" rel="noopener noreferrer"&gt;Supabase&lt;/a&gt;.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Make sure you have Node.js 21.x&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sign up for DBOS Cloud (&lt;a href="https://www.dbos.dev/dbos-cloud" rel="noopener noreferrer"&gt;https://www.dbos.dev/dbos-cloud&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Have a Supabase account and get your project url (&lt;a href="https://foobar.supabase.co/rest/v1" rel="noopener noreferrer"&gt;https://foobar.supabase.co/rest/v1&lt;/a&gt;) and project API anon key. Check out the Supabase &lt;a href="https://supabase.com/docs/guides/api/creating-routes#api-url-and-keys" rel="noopener noreferrer"&gt;docs&lt;/a&gt; to get them. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make sure to have two tables set up, the first can have any data in it as we will be counting rows, and the second table should have the columns "id", "count", and "created_at". &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;Clone this repository and navigate to the project directory&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Install the dependencies&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To deploy to DBOS-cloud, login with this, "&lt;strong&gt;&lt;em&gt;npx dbos-cloud login&lt;/em&gt;&lt;/strong&gt;" and follow the instructions to match the uuid given in the console to the one in the browser, then standard login user/password applies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Next provision a d'base instance: "&lt;strong&gt;&lt;em&gt;npx dbos-cloud db provision database-instance-name -U database-username&lt;/em&gt;&lt;/strong&gt;"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Register your app with the d'base instance: "&lt;strong&gt;&lt;em&gt;npx dbos-cloud app register -d database-instance-name&lt;/em&gt;&lt;/strong&gt;"&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Secrets Handling
&lt;/h2&gt;

&lt;p&gt;To use secrets in DBOS, add your variables in the cli like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;export PGPASSWORD=password-when-you-setup-the-remote-database-here&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;export SUPABASE_URL=&lt;a href="https://foobar.supabase.co" rel="noopener noreferrer"&gt;https://foobar.supabase.co&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;export SUPABASE_ANON_KEY=long-foo-bar-key &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;export SOURCE_TABLE=source-table-name &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;export DESTINATION_TABLE=destination-table-name &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These will be picked up at build time and inserted into the dbos-config.yaml fields: ${PGPASSWORD}, ${SUPABASE_URL}, ${SUPABASE_ANON_KEY}, ${SOURCE_TABLE},  ${DESTINATION_TABLE} respectively. Don't use quotation marks wrapping the values. The PGPASSWORD is for the basic user (not admin) Postgres service, which won't be used here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Be sure not to commit / hard code your secrets to a public repo! This setup is locally developed and directly deployed to the dbos-cloud service.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Get ready to deploy!
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;And finally deploy your app: "&lt;strong&gt;&lt;em&gt;npx dbos-cloud app deploy&lt;/em&gt;&lt;/strong&gt;"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After 5 minutes, assuming you have data in your source table, check your destination table for entries.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you are not getting expected results:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Login to the monitoring &lt;a href="https://docs.dbos.dev/cloud-tutorials/monitoring-dashboard" rel="noopener noreferrer"&gt;dashboard&lt;/a&gt; using this "&lt;strong&gt;&lt;em&gt;npx dbos-cloud dashboard url&lt;/em&gt;&lt;/strong&gt;"and check the collection of logs. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To delete the app online,&lt;code&gt;npx dbos-cloud app delete [application-name] --dropdb&lt;/code&gt;. Remove the '--dropdb' parameter if you want to retain the database table.  If you don't delete it, the cron script will continue to run. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are so many more benefits to mention re: workflow orchestration, observability, debugging, monitoring and overall speed, security, and costs which can be explored further here: &lt;a href="https://docs.dbos.dev/" rel="noopener noreferrer"&gt;https://docs.dbos.dev/&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Reference Docs (From Official Repo)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;To add more functionality to this application, modify &lt;code&gt;src/operations.ts&lt;/code&gt;, then rebuild and redeploy it.&lt;/li&gt;
&lt;li&gt;For a detailed tutorial, check out our &lt;a href="https://docs.dbos.dev/getting-started/quickstart-programming" rel="noopener noreferrer"&gt;programming quickstart&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;To learn how to deploy your application to DBOS Cloud, visit our &lt;a href="https://docs.dbos.dev/getting-started/quickstart-cloud/" rel="noopener noreferrer"&gt;cloud quickstart&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;To learn more about DBOS, take a look at &lt;a href="https://docs.dbos.dev/" rel="noopener noreferrer"&gt;our documentation&lt;/a&gt; or our &lt;a href="https://github.com/dbos-inc/dbos-transact" rel="noopener noreferrer"&gt;source code&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Resources to learn more --
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://github.com/dbos-inc/awesome-dbos" rel="noopener noreferrer"&gt;Awesome-dbos&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first &lt;a href="https://dev.to/vince_hirefunnel_co/dbos-cloud-simple-and-robust-workflow-orchestration-cn4"&gt;article&lt;/a&gt; in this series using cron and &lt;a href="https://postmarkapp.com/" rel="noopener noreferrer"&gt;Postmark&lt;/a&gt; email service provider.&lt;/p&gt;

</description>
      <category>dbos</category>
      <category>workflows</category>
      <category>postgres</category>
      <category>orchestration</category>
    </item>
    <item>
      <title>DBOS-Cloud Simple and Robust Workflow Orchestration</title>
      <dc:creator>Vince Fulco (It / It's)</dc:creator>
      <pubDate>Wed, 10 Jul 2024 02:50:18 +0000</pubDate>
      <link>https://dev.to/vince_hirefunnel_co/dbos-cloud-simple-and-robust-workflow-orchestration-cn4</link>
      <guid>https://dev.to/vince_hirefunnel_co/dbos-cloud-simple-and-robust-workflow-orchestration-cn4</guid>
      <description>&lt;p&gt;This is a toy &lt;a href="https://docs.dbos.dev/" rel="noopener noreferrer"&gt;DBOS&lt;/a&gt; app example focusing on remote deployment to &lt;a href="https://www.dbos.dev/dbos-cloud" rel="noopener noreferrer"&gt;DBOS Cloud&lt;/a&gt;, their hosted solution with a generous free tier for devs.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/weisisheng/dbos-httpapi-postmark-v202407/tree/master" rel="noopener noreferrer"&gt;github repo&lt;/a&gt; sets up two simple HTTP API endpoints that: 1) sends an email using Postmark ESP when you hit &lt;code&gt;/sendemail/:friend/:content&lt;/code&gt; endpoint and 2) inserts a record into a postgres d'base instance and retrieves the records when you visit the &lt;code&gt;/emails&lt;/code&gt; endpoint.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Make sure you have node.js 21.x&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sign up for DBOS Cloud (&lt;a href="https://www.dbos.dev/dbos-cloud" rel="noopener noreferrer"&gt;https://www.dbos.dev/dbos-cloud&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Have a Postmark account, username / password from the server (&lt;a href="https://postmarkapp.com/" rel="noopener noreferrer"&gt;https://postmarkapp.com/&lt;/a&gt;), and a specific sending email address setup&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;***Since this uses nodemailer, you can easily swap out Postmark for your email service provider of choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Clone this repository and navigate to the project directory&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install the dependencies&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;em&gt;Be sure not to commit / hard code your secrets to a public repo! This setup is meant for local development and direct deployment to the dbos-cloud service.&lt;/em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;To deploy to DBOS-cloud, login with this, "&lt;strong&gt;&lt;em&gt;npx dbos-cloud login&lt;/em&gt;&lt;/strong&gt;" and follow the instructions to match the uuid given in the console to the one in the browser, then standard login user/password applies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Next provision a d'base instance: "&lt;strong&gt;&lt;em&gt;npx dbos-cloud db provision database-instance-name -U database-username&lt;/em&gt;&lt;/strong&gt;"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Register your app with the d'base instance: "&lt;strong&gt;&lt;em&gt;npx dbos-cloud app register -d database-instance-name&lt;/em&gt;&lt;/strong&gt;"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To use secrets in DBOS, add your variables in the cli like this:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;export POSTMARK_USER=api-key-from-postmark-server-here&lt;/li&gt;
&lt;li&gt;export POSTMARK_PASSWORD=api-key-from-postmark-server-here&lt;/li&gt;
&lt;li&gt;export PGPASSWORD=put-the-password-you-created-when-you-setup-the-remote-database-here&lt;/li&gt;
&lt;li&gt;export SENDER_EMAIL=&lt;a href="mailto:sender@foobar.com"&gt;sender@foobar.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;export RECIPIENT_EMAIL=&lt;a href="mailto:receiver@foobar.com"&gt;receiver@foobar.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These will be picked up at build time and inserted into the dbos-config.yaml fields: ${PGPASSWORD}, ${POSTMARK_USER}, ${POSTMARK_PASSWORD}, ${SENDER_EMAIL}, ${RECIPIENT_EMAIL} respectively.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;And finally deploy your app: "&lt;strong&gt;&lt;em&gt;npx dbos-cloud app deploy&lt;/em&gt;&lt;/strong&gt;"&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After a minute or two, you'll get back an api endpoint that looks like: &lt;code&gt;https://&amp;lt;username&amp;gt;-&amp;lt;app-name&amp;gt;.cloud.dbos.dev/&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Test the endpoint:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;First, visit &lt;code&gt;https://&amp;lt;username&amp;gt;-&amp;lt;app-name&amp;gt;.cloud.dbos.dev/sendemail/friend/content&lt;/code&gt; replacing 'friend' and 'content' with your own choices. Hitting this sends an email using Postmark and inserts a record into the d'base named 'postmark'.&lt;/p&gt;

&lt;p&gt;Then visit &lt;code&gt;https://&amp;lt;username&amp;gt;-&amp;lt;app-name&amp;gt;.cloud.dbos.dev/emails&lt;/code&gt; to retrieve the records from the d'base.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;To delete the app online,&lt;code&gt;npx dbos-cloud app delete [application-name] --dropdb&lt;/code&gt;. Remove the '--dropdb' parameter if you want to retain the database table.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Some caveats:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The endpoint is not secure&lt;/strong&gt;, and anyone can send an email if they guess the assigned endpoint. You should add some sort of authentication to the endpoint to prevent abuse.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are some instructions for that: &lt;a href="https://docs.dbos.dev/tutorials/authentication-authorization" rel="noopener noreferrer"&gt;https://docs.dbos.dev/tutorials/authentication-authorization&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When building workflows with DBOS, consider creating the respective standalone functions, then wrapping them in an Httpapi decorator / function, then wrap all that in a @workflow which will add a bunch of cool built-in features.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;-- granular observability&lt;br&gt;
-- guaranteed only once execution&lt;br&gt;
-- asynchronous execution&lt;br&gt;
-- precise management and observability of workflows&lt;/p&gt;

&lt;p&gt;There are so many more benefits to mention re: debugging, monitoring and overall speed, security, and costs which can be explored further here: &lt;a href="https://docs.dbos.dev/" rel="noopener noreferrer"&gt;https://docs.dbos.dev/&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Reference Docs (From Official Repo)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;To add more functionality to this application, modify &lt;code&gt;src/operations.ts&lt;/code&gt;, then rebuild and redeploy it.&lt;/li&gt;
&lt;li&gt;For a detailed tutorial, check out our &lt;a href="https://docs.dbos.dev/getting-started/quickstart-programming" rel="noopener noreferrer"&gt;programming quickstart&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;To learn how to deploy your application to DBOS Cloud, visit our &lt;a href="https://docs.dbos.dev/getting-started/quickstart-cloud/" rel="noopener noreferrer"&gt;cloud quickstart&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;To learn more about DBOS, take a look at &lt;a href="https://docs.dbos.dev/" rel="noopener noreferrer"&gt;our documentation&lt;/a&gt; or our &lt;a href="https://github.com/dbos-inc/dbos-transact" rel="noopener noreferrer"&gt;source code&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>dbos</category>
      <category>workflows</category>
      <category>postgres</category>
      <category>orchestration</category>
    </item>
  </channel>
</rss>
