A highly scalable, full-stack blogging platform engineered for the Edge. This project abandons the traditional Node.js monolithic architecture in favor of a distributed, serverless model using Cloudflare Workers, Hono, and a React SPA.
It is structured as a Monorepo to share strict TypeScript types and Zod validation schemas across the entire stack, ensuring end-to-end type safety.
The backend API runs on Cloudflare Workers (V8 Isolates), bringing cold starts down to ~5ms and executing code globally closest to the user.
Integrates Prisma Accelerate to translate database queries into HTTP requests, preventing TCP connection exhaustion at the edge while querying the PostgreSQL database.
Utilizes a common package to maintain a single source of truth for Zod schemas, instantly synchronizing validation logic between the React frontend and Hono backend.
Implements secure, edge-compatible JWT authentication without relying on centralized session stores.
- React.js (Vite)
- TypeScript
- Custom Hooks (Data Fetching & Pagination)
- Tailwind CSS
- Hono (Ultra-lightweight web framework for the Edge)
- Cloudflare Workers
- Prisma ORM (with Edge Client)
- PostgreSQL
- Zod (Schema Validation)
- TypeScript Interfaces
.
├── client/ # React SPA frontend
├── server/ # Hono API deployed to Cloudflare Workers
└── common/ # Shared Zod schemas and type definitions- Node.js (v18+)
- Wrangler CLI installed globally
npm i -g wrangler- A PostgreSQL database URL
- Prisma Accelerate API Key
Navigate to the common directory, install dependencies, and build the types so they are accessible to the client and server.
cd common
npm install
npm run buildNavigate to the server directory and configure your environment.
cd ../server
npm install# server/.dev.vars
DATABASE_URL="your_direct_postgres_url"
PRISMA_DB_URL="your_prisma_accelerate_url"
JWT_SECRET="your_super_secret_key"npx prisma migrate dev --name init
npx prisma generate --no-enginenpm run devNavigate to the client directory.
cd ../client
npm installVITE_BACKEND_URL="http://localhost:8787"npm run devTraditional ORMs fail on the edge due to the lack of the Node.js net module. Prisma Accelerate was chosen to pool connections via HTTP, trading a slight HTTP overhead for infinite horizontal scaling and connection safety.
Instead of storing "read time" in the database, it is calculated dynamically on the edge during the GET /get-all request, ensuring accuracy post-edits and saving database storage.
Implemented offset-based pagination via Prisma's skip and take to ensure minimal payload sizes and fast DOM rendering on the client side.
Rishab Raj