This is a monorepo containing a Medium-like application with a backend service and a common package for shared types and validations.
├── backend/ # Backend service using Cloudflare Workers and Prisma
├── common/ # Shared types and validation schemas
The backend service is built using:
- Cloudflare Workers for serverless deployment
- Hono.js as the web framework
- Prisma with PostgreSQL for database management
- Prisma Accelerate for enhanced database performance
A shared package (@coderinthenorth/medium-app-common) containing:
- Zod schemas for request validation
- TypeScript types for blog and user operations
- Shared utilities used across the application
- Node.js (Latest LTS version recommended)
- npm or yarn
- PostgreSQL database
-
Clone the repository
-
Install dependencies for both packages:
# Install backend dependencies
cd backend
npm install
# Install common package dependencies
cd ../common
npm install- Set up your environment variables in the backend directory
- Start the development server:
cd backend
npm run devThe backend uses Prisma with PostgreSQL. Make sure to:
- Update your database connection string in the Prisma configuration
- Run migrations when needed
The backend service can be deployed to Cloudflare Workers:
cd backend
npm run deploy- User authentication (signup/signin)
- Blog post creation and management
- Type-safe API endpoints using Zod validation
- Serverless architecture with Cloudflare Workers
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
ISC License