Skip to content

sharmavikas4/MERN_BLOG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

61 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

MERN Blog

An interactive and feature-rich blogging website developed using modern web technologies. This project allows users to create, edit, and delete blogs, comment on posts, and view trending blogs. Users can sign in using Google OAuth for easy authentication, upload images via Cloudinary, and manage their blogs through a personalized dashboard.

πŸš€Featured In

Event Logo Event Name Event Description
GSSoC 24 GirlScript Summer of Code 2024 GirlScript Summer of Code is a three-month-long Open Source Program conducted every summer by GirlScript Foundation. It is an initiative to bring more beginners to Open-Source Software Development.

Table of Contents

  1. Project Overview
  2. Features
  3. Statistics
  4. Technologies Used
  5. Installation
  6. Usage
  7. API Endpoints
  8. Contributing
  9. Pull Request Review Criteria
  10. Code of Conduct
  11. Contributors
  12. Stargazers
  13. Forkers
  14. License

Project Overview

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.

Key Objectives:

  • 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.

Features

  • 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.

Statistics πŸ“Š

🌟 Stars 🍴 Forks πŸ› Issues πŸ”” Open PRs πŸ”• Closed PRs πŸ›  Languages 🌐 Contributors
Stars Forks Issues Open Pull Requests Closed Pull Requests GitHub language count GitHub contributors

Technologies Used

Frontend:

  • React.js
  • Vite.js
  • Material UI (for styling)

Backend:

  • Node.js
  • Express.js

Database:

  • MongoDB

Authentication:

  • Passport.js
  • Google OAuth

Image Hosting:

  • Cloudinary

Installation

  1. Clone the repository:

    git clone https://github.com/sharmavikas4/MERN_BLOG.git
  2. Navigate to the project directory:

    cd MERN_BLOG
  3. Install dependencies:

    • For the server:
      cd server
      npm install
    • For the client:
      cd ../client
      npm install
  4. Set up environment variables:

    • Create a .env file in the server directory and add:
      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>
      
  5. Start the backend server:

    nodemon index.js
  6. Set up environment variables for the client:

    • Create a .env file in the client directory and add:
      VITE_REACT_APP_SERVER_URL=<your-server-url>
      VITE_REACT_APP_CLIENT_URL=<your-client-url>
      
  7. Start the client side (frontend):

    npm run dev

Usage

  1. Visit the website and sign in using your Google account.
  2. Create, edit, or delete blogs from your dashboard.
  3. Explore trending or recent blogs on their respective pages.
  4. Comment on blogs to engage with the community.

API Endpoints

Method Endpoint Description
POST /auth/google Google OAuth login
POST /success Create a new blog
GET /success Fetch all blogs
POST /success/like Add like to a post
POST /success/comments Add a comment to a blog
GET /trending Fetch trending blogs based on likes
GET /new Fetch recently created blogs
POST /edit Edit a blog
POST /del Delete a blog
GET /dashboard Fetch current user data
GET /likePost Fetch posts liked by current user
GET /logout Logout current user

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new feature branch:
    git checkout -b feature/your-feature
  3. Commit your changes:
    git commit -m 'Add your feature'
  4. Push to the branch:
    git push origin feature/your-feature
  5. Open a pull request.

Pull Request Review Criteria 🧲

  1. Please fill out the PR template properly when creating a pull request.
  2. Assign yourself to the issue you’re working on to help us track progress.
  3. Never commit to the main branch.
  4. Your work must be original and adhere to the project's coding standards.
  5. Comment your code where necessary for clarity.
  6. Always ensure all tests pass before pushing your changes by running:
npm run test

Code of Conduct πŸ˜‡

We strive to create a welcoming and inclusive environment for all contributors and users. By participating in this project, you agree to abide by our Code of Conduct.

Our Standards

  1. Respect: Treat everyone with respect, regardless of their background or opinions.
  2. Inclusivity: Encourage and support diverse perspectives and contributions.
  3. Collaboration: Be open to constructive feedback and collaboration.
  4. Professionalism: Maintain professionalism in all interactions, online and offline.

Contributors

A heartfelt thank you to the following individuals for their valuable contributions to this project! Your support and dedication are greatly appreciated:

Stargazers 🌟

Stars
Total Stars: Stars Count

Forkers 🍴

Forks
Total Forks: Forks Count

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors