Documentation · Blog · Community
This demo is Next.js blog back-office featuring some AI workflows helping with grammar fixes, generating Table of Contents or Tweets, built with Inngest, Supabase and OpenAI.
Get started by cloning this repo and following the below setup instructions or directly deploy this template on Vercel.
To run this demo locally, you'll need the following:
- First, clone the repository and navigate the
examples/
folder:
git clone
cd examples/nextjs-blog-cms
- Then, install the dependencies:
npm i
# or
yarn
# or
pnpm --ignore-workspace i
- Finally, copy your local
.env.example
as.env.local
and fill yourOPENAI_API_KEY
.
This project needs a database to store the blog posts and workflows.
Follow the below steps to get a database up and running with Supabase:
- Go to your Supabase Dashboard and create a new project
- While your database is being created, update your
.env.local
and fill theNEXT_PUBLIC_SUPABASE_URL
andNEXT_PUBLIC_SUPABASE_ANON_KEY
- Open the SQL Editor from the left side navigation, and copy the content of the
examples/nextjs-blog-cms/supabase/schema.sql
file - Still in the SQL Editor, create a new snippet and do the same with the
examples/nextjs-blog-cms/supabase/seed.sql
file - Navigate to the Table Editor, you should see two tables:
blog_posts
andworkflows
You are all set, your database is ready to be used!
First, start the Next.js application:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the application. See our Demo Tour section to trigger your first workflow.
Finally, start the Inngest Dev Server by running the following command:
npx inngest-cli@latest dev
Open http://localhost:8288 with your browser to explore the Inngest Dev Server.
To run this demo locally, you'll need the following:
Use the below button to deploy this template to Vercel:
Once deployed, make sure to configure your OPENAI_API_KEY
environment variable.
Navigate to the Inngest Vercel Integration page and follow the instructions to link your Vercel application with Inngest.
This project needs a database to store the blog posts and workflows.
Follow the below steps to get a database up and running with Supabase:
- Go to your Supabase Dashboard and create a new project
- While your database is being created, update your Vercel project environment variables:
NEXT_PUBLIC_SUPABASE_URL
andNEXT_PUBLIC_SUPABASE_ANON_KEY
- Open the SQL Editor from the left side navigation, and copy the content of the
examples/nextjs-blog-cms/supabase/schema.sql
file - Still in the SQL Editor, create a new snippet and do the same with the
examples/nextjs-blog-cms/supabase/seed.sql
file - Navigate to the Table Editor, you should see two tables:
blog_posts
andworkflows
You are all set, your database is ready to be used!
This template is shipped with a Database seed containing three blog posts (two drafts) and two workflows.
Here are some suggestions of steps to follow as a tour of this demo:
- Navigate to the automation tab
- Click "Configure" on the "When a blog post is moved to review" automation
- Hover the "blog-post.updated" node to click on the "+" icon
- Select "Add a Table of Contents" on the right side panel
- Add another step from "Add a Table of Contents" by using the "+" icon and select "Perform a grammar review"
- Finally, add a "Apply changes after approval" as a final step
- Click on "Save changes" at the top right
We now have an active automation that will trigger when a blog post moves to review.
Let's trigger our automation:
- Navigate to the blog posts page
- Click on "Send to review" on the draft blog post
- Navigate to your Inngest Dev Server or Inngest Platform and go over the "Runs" tab
- You can now see your automation running live, step by step, to finally pause
- Return to the demo app, the blog post should have the "Needs approval" status. Click on "Review" and compare the Original blog post with the AI revision using the tabs.
- At the bottom, click on the "Approve suggestions & Publish" button
- Back on the Runs page of the Inngest Dev Server or Inngest Platform, you see the workflow in a completed state.
- Going back to the demo application, on the "blog posts" tab, the blog post should be flagged as "Published"