Skip to content

shoaib-1729/Blog-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

53 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BloomVerse Logo

BloomVerse – A Comprehensive Blogging Platform

BloomVerse is a modern, full-stack blogging platform designed to empower users to create, share, and discover engaging content. It offers a rich set of features, including user authentication, blog post management, commenting, liking, saving, and more. Whether you're a seasoned blogger or just starting out, BlogSphere provides the tools and community to thrive.

πŸš€ Key Features

  • User Authentication: Secure signup, sign-in, and password reset functionality. Google Authentication is also supported. πŸ”
  • Blog Post Management: Create, edit, and delete blog posts with rich text formatting and image uploads. ✍️
  • Commenting System: Engage in discussions with other users through a nested commenting system. πŸ’¬
  • Like and Save Blogs: Show appreciation for content and save your favorite blogs for later reading. ❀️
  • User Profiles: Customizable user profiles with the ability to follow other creators. πŸ‘€
  • Tag-Based Filtering: Discover content based on specific tags. 🏷️
  • Search Functionality: Easily find blogs using keywords. πŸ”
  • Responsive Design: Enjoy a seamless experience on any device. πŸ“±πŸ’»
  • Email Verification: Ensures the authenticity of user accounts. βœ…
  • Syntax Highlighting: Code blocks in blog posts are displayed with syntax highlighting. πŸ’‘
  • User Settings: Manage account settings, including profile picture and password. βš™οΈ

πŸ› οΈ Tech Stack

  • Frontend:

    • React: A JavaScript library for building user interfaces.
    • React Router DOM: For routing and navigation within the React application.
    • Redux Toolkit: For state management.
    • React Hot Toast: For displaying toast notifications.
    • Axios: For making HTTP requests to the backend API.
    • Tailwind CSS: A utility-first CSS framework for styling.
    • Vite: A build tool that bundles the frontend code for production.
    • Shadcn UI: UI components.
    • React Syntax Highlighter: For syntax highlighting in code blocks.
  • Backend:

    • Node.js: A JavaScript runtime environment.
    • Express: A web application framework for Node.js.
    • Mongoose: An Object Data Modeling (ODM) library for MongoDB and Node.js.
    • MongoDB: A NoSQL database for storing application data.
    • JWT (JSON Web Tokens): For user authentication and authorization.
    • Bcrypt: For password hashing.
    • Cors: Middleware for enabling Cross-Origin Resource Sharing (CORS).
    • Multer: Middleware for handling file uploads.
    • Cloudinary: For image storage and retrieval.
    • Nodemailer: For sending emails (e.g., for password reset, email verification).
    • Dotenv: For managing environment variables.
  • Other:

    • Firebase: For Google Authentication.

πŸ“¦ Getting Started

Prerequisites

  • Node.js (>=16)
  • npm or yarn
  • MongoDB installed and running
  • Cloudinary account (for image storage)
  • Firebase project (for Google Authentication)

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd BlogSphere
  2. Install backend dependencies:

    cd backend
    npm install  # or yarn install
  3. Configure backend environment variables:

    • Create a .env file in the backend directory.

    • Add the following environment variables:

      PORT=5000
      DB_URI=<your-mongodb-connection-string>
      DB_NAME=<your-database-name>
      JWT_SECRET=<your-jwt-secret>
      CLOUDINARY_CLOUD_NAME=<your-cloudinary-cloud-name>
      CLOUDINARY_API_KEY=<your-cloudinary-api-key>
      CLOUDINARY_API_SECRET=<your-cloudinary-api-secret>
      EMAIL_USER=<your-email-address>
      EMAIL_PASS=<your-email-password>
      FRONTEND_URL=<your-frontend-url>
      
  4. Install frontend dependencies:

    cd ../frontend
    npm install # or yarn install
  5. Configure frontend environment variables:

    • Create a .env file in the frontend directory.

    • Add the following environment variable:

      VITE_BACKEND_URL=<your-backend-url>
      
  6. Configure Tailwind CSS:

    • Ensure tailwind.config.js is properly configured with your theme customizations.
  7. Configure Vite:

    • Ensure vite.config.js is properly configured with plugins and aliases.

Running Locally

  1. Start the backend server:

    cd backend
    npm run dev
  2. Start the frontend development server:

    cd frontend
    npm run dev

πŸ’» Usage

  1. Open your browser and navigate to the frontend URL (usually http://localhost:5173).
  2. Sign up for a new account or sign in with an existing account.
  3. Start creating and sharing your blog posts!
  4. Explore the platform, discover new content, and engage with other users.

πŸ“‚ Project Structure

BlogSphere/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”œβ”€β”€ dbConnect.js
β”‚   β”‚   β”œβ”€β”€ cloudinaryConfig.js
β”‚   β”‚   └── dotenv.config.js
β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ blogController.js
β”‚   β”‚   └── userController.js
β”‚   β”œβ”€β”€ middlewares/
β”‚   β”‚   └── auth.js
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ blogModel.js
β”‚   β”‚   └── userModel.js
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ blogRoute.js
β”‚   β”‚   └── userRoute.js
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ generateToken.js
β”‚   β”‚   β”œβ”€β”€ multer.js
β”‚   β”‚   └── logger.js
β”‚   β”œβ”€β”€ server.js
β”‚   └── package.json
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ react-components/
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   β”œβ”€β”€ main.jsx
β”‚   β”‚   β”œβ”€β”€ index.css
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ vite.config.js
β”‚   β”œβ”€β”€ tailwind.config.js
β”‚   └── package.json
β”œβ”€β”€ .gitignore
β”œβ”€β”€ README.md
└── package.json

πŸ” Authentication & User Routes

Method Endpoint Description
POST /signup Create a new user account
POST /signin Login and receive JWT token
GET /users Fetch all users
GET /users/:username Get user by username
PATCH /users/:id Update user profile (auth required)
DELETE /users/ Delete logged-in user
GET /users/check-username/:username Check username availability
GET /verify-email/:verificationToken Verify user email
POST /google-auth Google OAuth login
PATCH /follow/:creatorId Follow/unfollow a creator
POST /users/:username/settings Update account settings
PUT /auth/reset-password/:id Reset password (auth required)
PUT /auth/forget-password Send password reset link

πŸ“ Blog Routes

Method Endpoint Description
GET /blogs Get all blogs (with filters/pagination)
GET /blogs/:id Fetch specific blog details
POST /blogs Create a blog post (auth + image upload)
PUT /blogs/:id Edit a blog post (author only)
DELETE /blogs/:id Delete a blog post (author only)
POST /blogs/like/:id Like/unlike a blog
PATCH /save-blog/:id Save/unsave a blog
GET /search-query Search blogs
GET /tag/:tagName Filter blogs by tag

πŸ’¬ Comment Routes

Method Endpoint Description
POST /blogs/comment/:id Add a comment to a blog
PUT /blogs/edit-comment/:id Edit comment
DELETE /blogs/comment/:id Delete comment
PATCH /blogs/like-comment/:id Like/unlike a comment
POST /comment/:parentCommentId/:id Reply to a comment (nested)

🧱 Scaling the Frontend–Backend Integration for Production

To ensure BloomVerse can handle real-world usage efficiently, the app’s architecture and deployment pipeline are designed with scalability, maintainability, and performance in mind.

πŸ”Ή 1. Frontend Optimization

  • Code Splitting & Lazy Loading: Reduces bundle size by loading components on demand.
  • CDN Caching: Static assets served via Vercel CDN for global fast delivery.
  • Environment-Based Config: Frontend consumes API via VITE_BACKEND_URL, supporting development, staging, and production environments.
  • Responsive UI: Built with Tailwind CSS and Shadcn UI, ensuring smooth rendering across all screen sizes and devices.

πŸ”Ή 2. Backend Scalability

  • Modular Architecture: Controllers, routes, and middleware are fully modular, allowing future conversion into microservices.
  • MongoDB Atlas: Provides automatic scaling, backups, and global distribution.
  • Load Balancing: Easily scalable horizontally using NGINX or AWS Load Balancer.
  • Media Handling: Cloudinary CDN offloads image delivery, reducing backend load.
  • Security: Implemented bcrypt for password hashing, JWT for secure authentication, and environment-based secret management.

πŸ”Ή 3. Deployment & CI/CD

  • Frontend: Deployed on Vercel with automatic caching, build optimization, and instant rollback capabilities.
  • Backend: Hosted on Render, with potential to migrate to Docker or AWS EC2 for advanced scaling.
  • Error Monitoring: Logging middleware using Winston and error tracking with Sentry ensure scalable observability.

πŸ”Ή 4. Future Scalability Plan

  • Introduce Redis caching for trending posts and session management.
  • Implement message queues (e.g., Kafka or RabbitMQ) for asynchronous tasks like email delivery and notifications.
  • CI/CD: Easy integration with GitHub Actions for automated testing and continuous deployment.
  • Containerize the app using Docker, and deploy via Kubernetes for automatic load balancing and scaling.
  • Add GraphQL API support for efficient and flexible data querying.

πŸ’‘ With this architecture, BloomVerse can scale both vertically (by increasing resources) and horizontally (by adding nodes), while maintaining high performance, security, and reliability.

πŸ“Έ Screenshots

Hero Page

Signin Page

Home Page

User Profile Page

Edit User Profile Page

Add Blog Page

🀝 Contributing

We welcome contributions to BlogSphere! If you'd like to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them with descriptive commit messages.
  4. Push your changes to your fork.
  5. Submit a pull request to the main repository.

πŸ“ License

This project is licensed under the MIT License.

πŸ’– Thanks

Thank you for checking out BloomVerse! We hope you find it useful and enjoyable.

This is written by readme.ai, your go-to platform for generating beautiful and informative README files.

About

Blog App coded using MERN Stack.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors