Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ BlogVerse

A Full Stack Blogging Platform Built with Next.js 14

Next.js React MongoDB Tailwind CSS License: MIT

A modern, feature-rich blogging platform with a clean reader experience and a powerful admin panel.

Live Demo Β· Report Bug Β· Request Feature


πŸ“Œ Table of Contents


🌟 Overview

BlogVerse is a full-stack blogging application that provides a seamless reading experience for users and a powerful admin dashboard for content management. Built with the latest version of Next.js, it leverages both server-side rendering and API routes to deliver a fast, SEO-friendly blogging experience.

Whether you're publishing your thoughts, managing a newsletter, or building a content-driven site β€” BlogVerse has you covered.


πŸš€ Features

πŸ‘€ For Readers

  • πŸ“° Browse all published blog posts on the homepage
  • πŸ” Filter blogs by category
  • πŸ“– Read full blog detail pages with rich content
  • πŸ“§ Subscribe to the newsletter with email

πŸ› οΈ For Admins

Feature Description
✍️ Add Blog Create new posts with image upload
πŸ—‘οΈ Delete Blog Remove posts and associated images
πŸ“‹ Blog List View and manage all published blogs
πŸ“¬ Subscriptions View and delete subscriber emails

πŸ› οΈ Tech Stack

Technology Version Purpose
Next.js 14 Fullstack Framework (Frontend + API)
React.js 18 Component-based UI
MongoDB Latest NoSQL Database
Mongoose Latest ODM / Schema Modeling
Tailwind CSS 3 Utility-first Styling
Axios Latest HTTP Client
React Toastify Latest Toast Notifications

πŸ“‚ Project Structure

project-root/
β”‚
β”œβ”€β”€ πŸ“ app/
β”‚   β”œβ”€β”€ πŸ“ api/
β”‚   β”‚   β”œβ”€β”€ πŸ“ blogs/
β”‚   β”‚   β”‚   └── route.js          # Blog CRUD endpoints
β”‚   β”‚   └── πŸ“ email/
β”‚   β”‚       └── route.js          # Email subscription endpoints
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“ admin/
β”‚   β”‚   β”œβ”€β”€ πŸ“ addProduct/
β”‚   β”‚   β”‚   └── page.jsx          # Add new blog (admin)
β”‚   β”‚   β”œβ”€β”€ πŸ“ blogList/
β”‚   β”‚   β”‚   └── page.jsx          # Manage all blogs (admin)
β”‚   β”‚   └── πŸ“ subscriptions/
β”‚   β”‚       └── page.jsx          # View subscribers (admin)
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“ blogs/
β”‚   β”‚   └── πŸ“ [id]/
β”‚   β”‚       └── page.jsx          # Dynamic blog detail page
β”‚   β”‚
β”‚   β”œβ”€β”€ layout.js                 # Root layout
β”‚   └── page.jsx                  # Homepage
β”‚
β”œβ”€β”€ πŸ“ Components/
β”‚   β”œβ”€β”€ πŸ“ AdminComponents/
β”‚   β”‚   β”œβ”€β”€ BlogTableItem.jsx     # Blog row in admin table
β”‚   β”‚   └── SubsTableItem.jsx     # Subscriber row in admin table
β”‚   β”‚
β”‚   β”œβ”€β”€ BlogItem.jsx              # Blog card component
β”‚   β”œβ”€β”€ BlogList.jsx              # Blog grid/list component
β”‚   β”œβ”€β”€ Footer.jsx                # Site footer
β”‚   └── Header.jsx                # Site header & navigation
β”‚
β”œβ”€β”€ πŸ“ lib/
β”‚   β”œβ”€β”€ πŸ“ config/
β”‚   β”‚   └── db.js                 # MongoDB connection
β”‚   └── πŸ“ models/
β”‚       β”œβ”€β”€ BlogModel.js          # Blog Mongoose schema
β”‚       └── EmailModel.js         # Email Mongoose schema
β”‚
β”œβ”€β”€ πŸ“ public/                    # Static assets & uploaded images
β”œβ”€β”€ .env                          # Environment variables
β”œβ”€β”€ package.json
└── README.md

πŸ”„ Application Flow

1. πŸ“° Fetch & Display All Blogs

User Opens Homepage
       β”‚
       β–Ό
BlogList Component Mounts
       β”‚
       β–Ό
Axios GET β†’ /api/blogs
       β”‚
       β–Ό
API Queries MongoDB
       β”‚
       β–Ό
JSON Response Returned
       β”‚
       β–Ό
Blogs Rendered on UI

2. πŸ“– Read a Single Blog

User Clicks Blog Card
       β”‚
       β–Ό
Navigate to /blogs/[id]
       β”‚
       β–Ό
Axios GET β†’ /api/blogs?id=blogId
       β”‚
       β–Ό
MongoDB Finds Document
       β”‚
       β–Ό
Blog Detail Page Rendered

3. ✍️ Admin β€” Add a Blog

Admin Fills Blog Form
       β”‚
       β–Ό
Image + Form Data Submitted
       β”‚
       β–Ό
POST β†’ /api/blogs
       β”‚
       β–Ό
Image Saved to /public
       β”‚
       β–Ό
Blog Document Stored in MongoDB
       β”‚
       β–Ό
βœ… Success Toast Displayed

4. πŸ—‘οΈ Admin β€” Delete a Blog

Admin Clicks Delete
       β”‚
       β–Ό
DELETE β†’ /api/blogs?id=id
       β”‚
       β–Ό
Blog Removed from MongoDB
       β”‚
       β–Ό
Associated Image Deleted from /public
       β”‚
       β–Ό
UI Refreshed Automatically

5. πŸ“§ Email Subscription

User Enters Email Address
       β”‚
       β–Ό
POST β†’ /api/email
       β”‚
       β–Ό
Email Stored in MongoDB
       β”‚
       β–Ό
βœ… Success Toast Displayed

🌐 API Reference

Blogs

Method Endpoint Description Body / Params
GET /api/blogs Fetch all blogs β€”
GET /api/blogs?id={id} Fetch single blog id query param
POST /api/blogs Create a new blog FormData with image
DELETE /api/blogs?id={id} Delete a blog id query param

Email Subscriptions

Method Endpoint Description Body / Params
POST /api/email Add subscriber email { email }
GET /api/email Get all subscribers β€”
DELETE /api/email?id={id} Remove a subscriber id query param

πŸ“Έ Screens

Page Description
🏠 Homepage Blog grid with category filters
πŸ“„ Blog Detail Full article view
βž• Admin β€” Add Blog Form to publish new posts with image
πŸ“‹ Admin β€” Blog List Table of all posts with delete actions
πŸ“¬ Admin β€” Subscriptions Table of all subscriber emails

🏁 Getting Started

Prerequisites

Make sure you have the following installed:

Installation

1. Clone the repository

git clone https://github.com/your-username/blogverse.git
cd blogverse

2. Install dependencies

npm install
# or
yarn install

3. Set up environment variables

Create a .env file in the root directory:

MONGO_URI=your_mongodb_connection_string

4. Run the development server

npm run dev
# or
yarn dev

5. Open in browser

Navigate to http://localhost:3000

Build for Production

npm run build
npm start

βš™οΈ Environment Variables

Variable Description Required
MONGO_URI MongoDB connection string (Atlas or local) βœ… Yes

πŸ’‘ Tip: For local development, you can use MongoDB Atlas Free Tier or a local MongoDB instance.


πŸ—ΊοΈ Future Roadmap

Here's what's planned for upcoming releases:

  • πŸ” Authentication β€” Secure admin login with NextAuth.js
  • πŸ“ Rich Text Editor β€” WYSIWYG editor (e.g., TipTap or Quill) for content creation
  • πŸ”Ž Search Functionality β€” Full-text search across blog titles and content
  • πŸŒ™ Dark Mode β€” System-aware and toggle-able theme
  • πŸ“ƒ Pagination β€” Paginate blog listings for better performance
  • πŸ’¬ Comments System β€” Allow readers to engage with posts
  • ❀️ Blog Likes β€” Like/upvote system for blogs
  • 🏷️ Tags β€” Tag-based filtering in addition to categories
  • πŸ—ΊοΈ Sitemap & SEO β€” Auto-generated sitemap and Open Graph meta tags
  • πŸ“Š Analytics Dashboard β€” Track page views and popular posts

πŸ‘©β€πŸ’» Author

Riya Bansal

GitHub LinkedIn

Built with ❀️ using Next.js 14


πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


⭐ If you found this project helpful, please give it a star! ⭐

About

Blog App using Next JS & MongoDB and a modern, feature-rich blogging platform with a clean reader experience and a powerful admin panel.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages