Skip to content

Kannu20/Blog-Website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


โœ๏ธ "A platform where every voice finds its audience."

A modern full-stack blogging platform that lets users read, create, and publish blog posts โ€” with complete admin control, secure authentication, and a clean REST API architecture.



๐Ÿ“Œ Table of Contents

๐Ÿ”ฝ Click to expand

โœจ Features


๐Ÿ“– Read Blogs
Browse and explore published posts through a clean, responsive interface

โœ๏ธ Create Posts
Registered users can write and draft their own blog articles

๐Ÿš€ Publish Blogs
Publish articles to make them live and visible to all readers

๐Ÿ” Auth System
Secure login โ€” only authenticated users can create or publish content

๐Ÿ›  Admin Control
Admin has full power over blog management and platform operations

๐Ÿ— System Architecture

flowchart TD
    A["๐Ÿ‘ค User / Reader"] --> B["โš›๏ธ React.js Frontend"]
    B --> C["โš™๏ธ REST API Layer\nNode.js + Express.js"]
    C --> D["๐Ÿ” Auth Middleware\nJWT Verification"]
    C --> E["๐Ÿ—„๏ธ Database\nMongoDB / SQL"]
    C --> F["๐Ÿ›ก๏ธ Admin Controller\nFull Platform Access"]
    D --> E

    style A fill:#0f172a,color:#38bdf8,stroke:#38bdf8
    style B fill:#0f172a,color:#61DAFB,stroke:#61DAFB
    style C fill:#0f172a,color:#a78bfa,stroke:#a78bfa
    style D fill:#0f172a,color:#fb923c,stroke:#fb923c
    style E fill:#0f172a,color:#34d399,stroke:#34d399
    style F fill:#0f172a,color:#f472b6,stroke:#f472b6
Loading

The React frontend handles all UI interactions. The Express backend manages routing, authentication, and data operations. Communication happens over clean REST APIs.


๐Ÿงฐ Tech Stack

๐ŸŽจ Frontend

React HTML5 CSS3 JavaScript

โš™๏ธ Backend

Node.js Express.js REST API

๐Ÿ—„๏ธ Database

MongoDB SQL

๐Ÿ”ง Tools

Git GitHub VS Code Postman


๐Ÿ” Role-Based Access Control

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฆโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘    Role      โ•‘  Permissions                                                 โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฌโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘ ๐Ÿ‘ค User      โ•‘  Read blogs ยท Create blog posts ยท Publish own blogs         โ•‘
โ•‘ ๐Ÿ›ก๏ธ Admin     โ•‘  Full access ยท Manage all blogs ยท Platform administration   โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฉโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

All protected routes require a valid JWT token. Role verification happens at the middleware level before any controller logic executes.


๐Ÿ“‚ Project Structure

blog-platform/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ frontend/                    # React.js Application
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ components/              # Reusable UI components
โ”‚   โ”‚   โ”œโ”€โ”€ Navbar.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ BlogCard.jsx
โ”‚   โ”‚   โ””โ”€โ”€ Editor.jsx
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ pages/                   # Route-level pages
โ”‚   โ”‚   โ”œโ”€โ”€ Home.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ CreateBlog.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ BlogDetail.jsx
โ”‚   โ”‚   โ””โ”€โ”€ AdminDashboard.jsx
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ services/                # API call functions
โ”‚   โ”‚   โ””โ”€โ”€ api.js
โ”‚   โ””โ”€โ”€ ๐Ÿ“ styles/                  # CSS stylesheets
โ”‚
โ””โ”€โ”€ ๐Ÿ“ backend/                     # Express.js Server
    โ”œโ”€โ”€ ๐Ÿ“ routes/                  # API route definitions
    โ”‚   โ”œโ”€โ”€ authRoutes.js
    โ”‚   โ””โ”€โ”€ blogRoutes.js
    โ”œโ”€โ”€ ๐Ÿ“ controllers/             # Business logic handlers
    โ”‚   โ”œโ”€โ”€ authController.js
    โ”‚   โ””โ”€โ”€ blogController.js
    โ”œโ”€โ”€ ๐Ÿ“ models/                  # Database schemas
    โ”‚   โ”œโ”€โ”€ User.js
    โ”‚   โ””โ”€โ”€ Blog.js
    โ””โ”€โ”€ ๐Ÿ“ middleware/              # Auth & role guard middleware
        โ””โ”€โ”€ authMiddleware.js

โš™๏ธ Installation

Prerequisites

  • Node.js v16+
  • MongoDB (local or Atlas)

1๏ธโƒฃ Clone the Repository

git clone https://github.com/yourusername/blog-platform.git
cd blog-platform

2๏ธโƒฃ Setup & Run Backend

cd backend
npm install

Create a .env file inside /backend:

PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
npm start

3๏ธโƒฃ Setup & Run Frontend

cd ../frontend
npm install
npm start

4๏ธโƒฃ Open in Browser

http://localhost:3000

โœ… Backend runs on http://localhost:5000 ยท Frontend runs on http://localhost:3000


๐Ÿš€ Future Enhancements

๐Ÿ”ฎ Roadmap
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ Rich Text Editor        โ€” Full WYSIWYG editor (TipTap / Quill.js)
โ”œโ”€โ”€ ๐Ÿ’ฌ Comment System          โ€” Threaded comments on every blog post
โ”œโ”€โ”€ โค๏ธ  Like & Bookmark         โ€” Engage with and save favourite posts
โ”œโ”€โ”€ ๐Ÿ” Blog Search             โ€” Full-text search with filters & tags
โ”œโ”€โ”€ ๐Ÿ–ผ๏ธ  Image Upload Support    โ€” Cloudinary / S3 integration for media
โ”œโ”€โ”€ ๐Ÿ”– Markdown Support        โ€” Write posts in Markdown with live preview
โ””โ”€โ”€ ๐Ÿ“ˆ SEO Optimization        โ€” Meta tags, Open Graph, sitemap generation

๐ŸŒ Real World Applications

๐ŸŒ Use Case ๐Ÿ’ก Description
Personal Blogging Platform Individuals sharing thoughts, tutorials, stories
Knowledge Sharing Portals Team wikis and internal documentation
Developer Communities Tech blogs, open-source updates, changelogs
Educational Content Portals Course notes, study guides, student submissions
Company News & Updates Internal announcements and corporate blogs

๐Ÿค Contributing

Contributions are always welcome! Here's how:

# 1. Fork this repository

# 2. Create your feature branch
git checkout -b feature/YourFeatureName

# 3. Commit your changes
git commit -m "Add: YourFeatureName"

# 4. Push to your branch
git push origin feature/YourFeatureName

# 5. Open a Pull Request ๐ŸŽ‰

๐Ÿ‘จโ€๐Ÿ’ป Author

Kanishak Todwal

Computer Science Engineer (AI)

GitHub LinkedIn Portfolio

Interested in Full Stack Development, AI Applications & Scalable Web Platforms


๐Ÿ“œ License

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


โญ Support the Project

If this project helped or inspired you:

Star Fork Share


๐Ÿ’ฌ Project Mission

"Every developer should have a place to share what they've learned. This platform is built to make that effortless."

Made with โค๏ธ by Kanishak Todwal

About

A full-stack blog platform built with React and Express.js that allows users to read, create, and publish blogs, while an admin panel provides complete control over content management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors