Skip to content

7vignesh/blogpost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

BlogPost

A full-stack blog platform built with the MERN stack (MongoDB, Express, React, Node.js).

Features

  • 📝 Create, edit, and delete blog posts
  • � User authentication (JWT)
  • 👤 Users can publish their own posts
  • 🔍 Search and filter by tags/categories
  • 📱 Responsive dark theme UI
  • ⚡ Markdown support for blog content

Tech Stack

Frontend: React, Vite, Tailwind CSS
Backend: Node.js, Express, MongoDB, JWT

Getting Started

Prerequisites

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

Installation

  1. Clone the repo
git clone https://github.com/yourusername/blogpost.git
cd blogpost
  1. Install dependencies
# Backend
cd server
npm install

# Frontend
cd ../client
npm install
  1. Set up environment variables
# In /server, create .env file
cp .env.example .env
# Edit .env with your MongoDB URI and JWT secrets
  1. Seed sample data (optional)
cd server
npm run seed
  1. Run the app
# Terminal 1 - Backend
cd server
npm run dev

# Terminal 2 - Frontend
cd client
npm run dev
  1. Open http://localhost:5173

Demo Credentials

After seeding:

Project Structure

blogpost/
├── client/          # React frontend
│   └── src/
│       ├── components/
│       ├── pages/
│       ├── services/
│       └── context/
└── server/          # Express backend
    └── src/
        ├── controllers/
        ├── models/
        ├── routes/
        └── services/

API Endpoints

Method Endpoint Description
POST /api/auth/register Register user
POST /api/auth/login Login
GET /api/blogs Get all blogs
GET /api/blogs/:slug Get single blog
POST /api/blogs Create blog (auth)
PUT /api/blogs/:id Update blog (auth)
DELETE /api/blogs/:id Delete blog (auth)

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published