Skip to main content

Prerequisites

Before you begin, ensure you have the following installed:
  • Bun (latest version)
  • A code editor (VS Code, Cursor, etc.)
  • Git

Installation

1

Clone the repository

Clone the project to your local machine:
git clone <repository-url>
cd shopify-rss-feed-gchat
2

Install dependencies

Install all required packages using Bun:
bun install
This will install the following dependencies:
  • hono - Fast web framework for routing
  • rss-parser - RSS feed parsing library
  • @types/bun - TypeScript types for Bun
3

Set up environment variables

Create a .env file in the root directory:
touch .env
Add your Google Chat webhook URL:
.env
WEBHOOK_URL=https://chat.googleapis.com/v1/spaces/YOUR_SPACE_ID/messages?key=YOUR_KEY
Bun automatically loads .env files, so no additional configuration is needed.

Project Structure

The project follows a simple, modular structure:
shopify-rss-feed-gchat/
├── server.ts              # Main Hono server with routing
├── rss-handler.ts         # RSS feed processing logic
├── package.json           # Project dependencies and scripts
├── tsconfig.json          # TypeScript configuration
├── vercel.json            # Vercel deployment config with cron
├── .env                   # Environment variables (not in repo)
└── README.md              # Project documentation

Key Files

The main application server using Hono framework:
  • Defines routes for healthcheck and RSS feed processing
  • Exports the app for Vercel deployment
  • Located at: server.ts:1
Core RSS feed processing logic:
  • Fetches Shopify changelog RSS feed
  • Filters new items since last check
  • Formats and sends messages to Google Chat
  • Located at: rss-handler.ts:1
Deployment configuration:
  • Defines cron job to run daily at midnight UTC
  • Triggers /get-rss-feed endpoint
  • Located at: vercel.json:1

Running the Development Server

Start the development server with hot reloading:
bun run dev
This command runs bun run --hot server.ts, which:
  • Starts the Hono server
  • Enables hot module reloading (automatically restarts on file changes)
  • Makes the API available at http://localhost:3000
The --hot flag enables Bun’s built-in hot reloading, so you don’t need nodemon or similar tools.

Available Endpoints

Once the server is running, you can access:

Healthcheck

GET http://localhost:3000/healthcheck
Returns “Running!” to verify the server is up.

RSS Feed Handler

GET http://localhost:3000/get-rss-feed
Processes the Shopify RSS feed and sends updates to Google Chat.

Development Workflow

1

Start the dev server

bun run dev
2

Make changes to the code

Edit files in your code editor. The server will automatically reload when you save changes.
3

Test your changes

Use curl, Postman, or your browser to test the endpoints.See the Testing Guide for detailed testing instructions.

TypeScript Configuration

The project uses strict TypeScript settings for better code quality:
  • Target: ESNext (latest JavaScript features)
  • Module: Preserve (for Bun’s bundler)
  • Strict mode: Enabled
  • JSX: react-jsx (if needed for future UI components)
Bun has built-in TypeScript support, so no separate compilation step is needed.

Troubleshooting

If port 3000 is already in use, Bun will automatically try the next available port. Check the console output for the actual port number.
Make sure you’ve created a .env file with a valid WEBHOOK_URL. The application will throw an error if this is missing when trying to send messages.
Run bun install again to ensure all dependencies are properly installed.

Next Steps

Build docs developers (and LLMs) love