This project is a blog website where users can log in, view published blogs, and add new blogs.
- User Authentication: Users can log in to access the blog features.
- View Blogs: Users can view all published blogs.
- Add Blog: Logged-in users can add new blogs.
- Validation: Input data is validated using Zod.
- Frontend: JavaScript, TypeScript
- Backend: Node.js, TypeScript, Hono (for Cloudflare Workers)
- Database: Aiven for PostgreSQL
- ORM: Prisma for connection pooling
- Validation: Zod
The project is organized into three main folders:
- backend: Contains the server-side code.
- frontend: Contains the client-side code.
- common: Contains shared utilities and validation schemas using Zod.
-
Clone the repository:
git clone https://github.com/Kartikhub/BlogHub.git cd BlogHub -
Install dependencies:
npm install
-
Set up the database:
Ensure you have Aiven for PostgreSQL set up and update the connection string in the environment variables.
-
Run migrations:
npx prisma migrate dev --name init_schema npx prisma generate --no-engine npm install @prisma/extension-accelerate
-
Start the backend server in development mode:
cd backend npm run dev -
Start development mode for frontend:
cd frontend npm run dev
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature-branch). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.