Welcome to the Blogging Application! This repository contains a fully functional blogging platform where users can sign up, sign in, read blogs, and publish their own blog posts.
-
User Authentication
- Sign up with Username, email and password
- Secure signin with emain and password
-
Blog Management
- View all blogs
- Publish new blogs
-
User Experience
- Clean and intuitive UI/UX
- Responsive design for both desktop and mobile users
-
Allows new users to create an account.
-
Input fields for:
- Username
- Password
-
Validation for unique email addresses.
-
Preview:
-
Enables existing users to log in.
-
Input fields for:
- Password
-
Error handling for incorrect credentials.
-
Preview:
-
Displays a list of all published blogs.
-
Each blog includes:
- Title
- Author
- Publication date
-
Search and filter options (To be added)
-
Preview:
-
Accessible only to authenticated users.
-
Input fields for:
- Blog Title
- Blog Content
-
Publish immediately.
-
Preview:
- Frontend: Vite, React, TypeScript
- Backend: Hono.js, deployed on Cloudflare Workers
- Database: PostgreSQL (via Avian)
- ORM: Prisma (used for schema management and connection pooling with Prisma Accelerate)
Make sure you have the following installed:
- Node.js
- npm or yarn
- Clone the repository:
git clone https://github.com/ghagevaibhav/narrate.git
- Navigate to the project directory:
cd narrate
- Navigate to the specific folder to install dependencies:
- For the backend:
cd narrate/backend npm install
- For the frontend:
cd ../frontend npm install
- For the common utilities:
cd ../common npm install
- For the backend:
- Set up environment variables:
- Create a
.env
file in thebackend
folder. - Add the following:
DATABASE_URL=your-database-url JWT_SECRET=your-jwt-secret
- Update the
wrangler.toml
file in thebackend
folder to include the secrets:[vars] DATABASE_URL="your-database-url" JWT_SECRET="your-jwt-secret"
- Create a
- Push the Prisma schema to the database:
npx prisma db push
- Start the development servers:
- For the backend:
npm run dev
- For the frontend:
cd ../frontend npm run dev
- For the backend:
This application is deployed on Cloudflare Workers. To deploy:
- Install the Cloudflare Workers CLI (
wrangler
):npm install -g wrangler
- Configure the
wrangler.toml
file with your Cloudflare account details and ensure all necessary environment variables are included. - Deploy the backend:
cd narrate/backend wrangler login npx wrangler deploy
- Deploy the frontend to your preferred hosting platform.
- Visit the deployed URL or
http://localhost:<your-port>
during development to access the application.
Contributions are welcome! Follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature-name
- Make your changes and commit them:
git commit -m "Add your message here"
- Push to the branch:
git push origin feature/your-feature-name
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or issues, feel free to reach out:
- Email: [email protected]
- GitHub: Vaibhav Ghage
Happy Blogging!