A simple Blogging App where users can create an account, sign in/up, and create and post blogs. This project uses Hono library for HTTP routing, Cloudflare Workers for serverless execution, PostgreSQL for the database, and Prisma as the ORM with a connection pool.
- User authentication (sign in/up)
- Create, read, update, and delete (CRUD) blog posts
- View an author's complete blogs
- Secure endpoints using Cloudflare Workers
- Database connection pooling with Prisma
- Hono: A minimalistic JavaScript library for HTTP routing.
- [Cloudflare Workers]: Serverless execution environment for running server-side code.
- [PostgreSQL]
- Prisma: Modern database access toolkit with an ORM layer and connection pool.
- Node.js
- npm
- Cloudflare Workers account
- PostgreSQL database
- Prisma CLI
-
Clone the repository:
git clone https://github.com/yourusername/blogging-app.git
-
Navigate to the project directory:
cd blogging-app
-
Install dependencies:
npm install
-
Create a
.env
file in the project root with the following environment variables:DATABASE_URL="your_postgresql_database_url" SECRET_KEY="your_secret_key_for_jwt"
-
Initialize and apply database migrations with Prisma:
npx prisma migrate dev
-
Build the project:
npm run build
-
Deploy to Cloudflare Workers:
npm run deploy
To run the app locally:
npm run dev