This project is an interactive and feature-rich blogging website developed using modern web technologies. It allows users to create, edit, and delete blogs, comment on posts, and view trending blogs. Additionally, users can sign in using Google OAuth for easy authentication, upload images via Cloudinary, and manage their blogs through a personalized dashboard.
The aim of this project is to provide users with an interactive platform to share their thoughts, experiences, and ideas through blogs. The website includes features like trending blogs, recent blogs, a user management dashboard, and Google OAuth-based authentication for easy sign-in.
Frontend:
Backend:
Database:
Authentication:
Image Hosting:
Clone the repository:
git clone https://github.com/your-username/blogging-website.git
Navigate to the project directory:
cd MERN_BLOG
Install dependencies:
cd server
npm install
cd ..
cd client
npm install
Set up environment variables:
Create a .env
file in the server directory and add the following:
GOOGLE_CLIENT_ID=<your-google-client-id>
GOOGLE_CLIENT_SECRET=<your-google-client-secret>
URL=<your-server-url>
CLIENT_URL=<your-client-url>
DB=<your-database-connection-string>
CLOUD_NAME=<your-cloudinary-cloud-name>
CLOUDINARY_KEY=<your-cloudinary-api-key>
CLOUDINARY_SECRET=<your-cloudinary-api-secret>
Start the backend server:
nodemon index.js
Set up environment variables:
Create a .env
file in the client directory and add the following:
VITE_REACT_APP_SERVER_URL=<your-server-url>
VITE_REACT_APP_CLIENT_URL=<your-client-url>
Start the client side(frontend):
npm run dev
POST /auth/google
: Google OAuth login.POST /success
: Create a new blog.GET /sucess
: Fetches all blogPOST /success/like
: Used to add like to a post.POST /success/comments
: Add a comment to a blog.GET /trending
: Fetch trending blogs based on the likes.GET /new
: Fetch recently created blogs.POST /edit
: Edit a blog.POST /del
: Delete a blog.POST /success/check
: Check whether a user has liked a post or not.POST /blog
: Fetches a particular blogGET /dashboard
: Fetches current user dataGET /likePost
: Fetches the post liked by current user.GET /logout
: Logout current userContributions are welcome! To contribute:
git checkout -b feature/your-feature
).git commit -m 'Add your feature'
).git push origin feature/your-feature
).