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.
- Develop a user-friendly blogging platform.
- Implement secure user authentication using Passport.js and Google OAuth.
- Integrate Cloudinary for efficient image management.
- Create a trending page to showcase the most liked blogs.
- Design a page to display recently created blogs.
- Provide a dashboard for users to manage their blogs.
- User Authentication: Secure user login and registration using Google OAuth.
- Blog Management: Users can create, edit, and delete blogs.
- Comment System: Engage in discussions by commenting on blogs.
- Trending Page: View the most popular blogs.
- Recent Blogs Page: Display newly created blogs.
- User Dashboard: Manage and track your blogs in a dedicated dashboard.
- Image Management: Upload and manage blog images with Cloudinary.
-
Frontend:
- React.js
- Vite.js
- Material UI (for styling)
-
Backend:
- Node.js
- Express.js
-
Database:
- MongoDB
-
Authentication:
- Passport.js
- Google OAuth
-
Image Hosting:
- Cloudinary
-
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
- Visit the website and sign in using your Google account.
- Create, edit, or delete blogs from your dashboard.
- Explore trending blogs or recent blogs on the respective pages.
- Comment on blogs and engage with the community.
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 user
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new feature branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -m 'Add your feature'
). - Push to the branch (
git push origin feature/your-feature
). - Open a pull request.
- We extend our heartfelt gratitude for your invaluable contribution to our project! Your efforts play a pivotal role in elevating this project to greater heights.
- Make sure you show some love by giving ⭐ to our repository.