Skip to main content

Start Here

danger

Wake up. Hit snooze 4 times. Stare at your phone. Roll out of bed. Make coffee. Sit in traffic. Eight hours of unfulfilling work. Sit in traffic . . . again. Argue with your “significant” other. Walk the pet. Watch TV. Pass out. Repeat.

Get offended. Blame everyone but yourself. Tie your self-worth to radical ideologies. Accept everything at face value and question nothing. Expect free handouts for simply existing, no effort. Do what the authorities tell you. Go to school, get a job, retire at the ripe age of whatever it may be, no guarantees, with just the right amount of currency to survive until death.

Go through a painful experience. Find the light. Identify with it. Demonize anyone who questions that identity. Avoid the thought of any meaning, love, and consistent presence you had the potential of achieving in your life because that would require you to change.

What a life. A life I have lived multiple times, each one being shorter than the next. Many people say they enjoy this lifestyle, that they are fine living out the same day like an experimental TV drama. It seems like a peaceful existence, but one that I could never live. The thought of something more would eat me alive.

From "The Art of Focus" by Dan Koe

2025-03-19

Goals

  • turn ai-chatbot template to Cloudflare nextjs app
  • make ai-chatbot working locally

2025-03-18

info

Finally I am making a good progress. 🥳

Some of the things I have learned last couple of weeks

  • Cursor isn't a good fit for me. I will stick with Code for now. 👨🏻‍💻
  • I am bullish on Cloudflare and I am sticking with it.
  • I would love to use D1 for my database, but Neon Postgres is a good alternative.
  • Hopefully I will have something to show by the end of the month. 🤞

Goals

  • Continue working with agents
  • Trying to figure out how to integrate Agents to Next.js
  • Connect to AI Agents using WebSockets

Works Done

pnpm create hono@latest

2025-03-17

Goals

Works Done

pnpm create hono@latest

2025-03-16

Goals

  • Continue working with agents-sdk.
  • Next.js on Cloudflare Workers or Hono on Cloudflare Workers or React on Cloudflare Workers? Least painful option?
  • Read about Cloudflare Durable Objects

Works Done

git clone https://github.com/exectx/next-live-cursors-do-rpc.git 
cd next-live-cursors-do-rpc
pnpm install
pnpm dev

2025-03-15

Goals

  • Continue working with agents-sdk.
  • Next.js on Cloudflare Workers or Hono on Cloudflare Workers or React on Cloudflare Workers? Least painful option?

Works Done

2025-03-14

Goals

  • Chat AI working using Cloudflare Agents inside my app.

Works Done

pnpm add ai @ai-sdk/react @ai-sdk/openai zod

2025-03-13

info
  • Today, I will revisit Laravel

Lessons Learned

  • Do NOT complicate things by adding unnecessary features or dependencies. e.g. I won't use Drizzle ORM for now.
  • Even you won't even have to figure out how to run migration script on D1. Just run them in the console.

Goals

  • GitHub OAuth Test
  • Auth.js Credentials Test with D1 Adapter
  • Clerk for authentication

Works Done

npm create cloudflare@latest -- --template cloudflare/agents-starter
# create nextjs app on cloudflare workers
pnpm create cloudflare@latest cf-20250313 --framework=next --experimental
# create d1 database
npx wrangler d1 create cf-20250313-db
# ran migration script using drizzle studio on Cloudflare webpage
pnpm add next-auth@beta
npx auth secret

2025-03-12

info
  • Starting getting the grasp of Cloudflare Workers, D1 and Drizzle ORM.
  • Will continue to work on the SaaS AI Starterkit tomorrow.

Goal

  • I will have a running next.js application on cloud workers with authentication working using Auth.js with Dizzle orm and D1
  • Set up Cloudflare worker with D1 bind and see if I can create, add, update, and delete tables and rows.

Todo

  • Drizzle ORM
  • Auth.js
  • Cloudflare Workers

Works Done

pnpm create cloudflare@latest gxpsoftai-saas-ai-starterkit --framework=next --experimental
cd gxpsoftai-saas-ai-starterkit
cursor .
# create .cursor/rules/cloudflare.mdc and copy https://developers.cloudflare.com/workers/prompt.txt
# open up terminal window
pnpm add next-auth@beta

pnpm create cloudflare@latest gxpsoftai-test-01 --framework=next --experimental
cd gxpsoftai-test-01
pnpm add drizzle-orm
pnpm add -D drizzle-kit
pnpm create cloudflare@latest my-first-worker
cd my-first-worker
cursor .
# open up terminal window
pnpm dev
# go to http://localhost:3000 to see the website is running

# nextjs on Cloudflare Worders with Auth.js/Drizzle/D1 authentication 

2025-03-11

info

I think I had the most productive day of 2025 thanks to Dan Koe. Hopefully I can keep it going. Tomorrow, I will dig in deeper into Cloudflare Worker with D1.

Works Done

git clone https://github.com/nextjs/saas-starter my-saas-mvp
cd my-saas-mvp
cursor .
pnpm install
# Use the included setup script to create your .env file: .env info saved in "SAAS" Bitwarden
# this step can be skipped since we are copy/paste .env
pnpm db:setup
# Then, run the database migrations and seed the database with a default user and team:
# created new postgres instance with the correct port that's indicated in .env file
pnpm db:migrate
pnpm db:seed
# This will create the following user and team:
# User: test@test.com Password: admin123
pnpm dev

# Cloudflare section
pnpm add -D @opennextjs/cloudflare

# Add a Wrangler configuration file at the root level. wrangler.jsonc
{
"main": ".open-next/worker.js",
"name": "my-app",
"compatibility_date": "2024-09-23",
"compatibility_flags": [
"nodejs_compat"
],
"assets": {
"directory": ".open-next/assets",
"binding": "ASSETS"
}
}
# Update package.json insert below in "scripts" section

"build:worker": "opennextjs-cloudflare",
"dev:worker": "wrangler dev --port 8771",
"preview:worker": "npm run build:worker && npm run dev:worker",
"deploy:worker": "npm run build:worker && wrangler deploy"

# Add caching with Workers KV
npx wrangler@latest kv namespace create NEXT_CACHE_WORKERS_KV
{
"kv_namespaces": [
{
"binding": "NEXT_CACHE_WORKERS_KV",
"id": "<YOUR_NAMESPACE_ID>"
}
]
}
# Preview locally your application and create an OpenNext config file
pnpm preview:worker

# Deploy to Cloudflare Workers
pnpm deploy:worker
pnpm create cloudflare@latest gxpsoftai-test-01 --framework=next --experimental
cd gxpsoftai-test-01
pnpm add drizzle-orm
pnpm add -D drizzle-kit

Issues

  • when deployed to Cloudflare, there were some errors while logging in or going to different pages. My guess is that Stripe settings need to be reconfigured in order for the "production" site to work properly.

Next Steps

Decisions