Skip to content

ankitjhagithub21/medium-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

✍️ Medium Clone

A full-stack blogging platform inspired by Medium, where users can write, publish, and engage with stories in a clean and responsive interface.

🔗 Live Demo: medium-clone-by-ankit.vercel.app


✨ Features

  • 🔐 Authentication — Register, login, and logout securely with JWT-based sessions
  • 📝 Rich Text Editor — Create and format stories using the Jodit Editor with full rich text support
  • 📖 Story Management — Create, update, and delete your own stories effortlessly
  • 💬 Comments — Add and delete comments on any story to engage with the community
  • 👤 Profile Management — Update your profile info and avatar via Cloudinary
  • 👥 Follow / Unfollow — Follow other writers and explore their profiles
  • 🖼️ Image Uploads — Smooth media handling via Cloudinary CDN
  • 📱 Responsive Design — Fully optimized across all devices with Tailwind CSS
  • 🔔 Toast Notifications — Real-time feedback using React Hot Toast

🧩 Tech Stack

🔹 Frontend

Technology Purpose
React.js UI library and component architecture
React Router DOM Client-side routing and navigation
Tailwind CSS Utility-first responsive styling
Jodit Editor Rich text editor for story creation
React Hot Toast Toast notifications for user feedback

🔹 Backend

Technology Purpose
Node.js Server runtime
Express.js REST API framework
MongoDB NoSQL database for storing users, stories, and comments
Mongoose MongoDB ODM for schema modeling
Cloudinary Cloud-based image storage and delivery
jsonwebtoken JWT-based authentication
cookie-parser HTTP cookie parsing middleware

🗂️ Project Structure

medium-clone/
├── frontend/               # React.js client application
│   ├── src/
│   │   ├── components/     # Reusable UI components
│   │   ├── pages/          # Route-level page components
│   │   ├── context/        # Auth and global state context
│   │   └── utils/          # Helper functions
│   └── package.json
│
├── backend/                # Node.js + Express server
│   ├── routes/             # API route definitions
│   ├── controllers/        # Business logic handlers
│   ├── models/             # Mongoose schemas (User, Story, Comment)
│   ├── middleware/         # Auth middleware
│   └── package.json

🚀 Getting Started

Prerequisites

  • Node.js >= 18.x
  • MongoDB (local or Atlas)
  • Cloudinary account
  • npm or yarn

1. Clone the Repository

git clone https://github.com/ankitjhagithub21/medium-clone.git
cd medium-clone

2. Setup Backend

cd backend
npm install

Create a .env file in the backend/ directory:

PORT=5000
MONGO_URI=your_mongodb_connection_string
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
CLIENT_URL=http://localhost:5173

Start the backend server:

npm run dev

3. Setup Frontend

cd ../frontend
npm install

Create a .env file in the frontend/ directory:

VITE_API_URL=http://localhost:5000

Start the frontend dev server:

npm run dev

The app will be running at http://localhost:5173.


🔄 How It Works

  1. Register / Login — Users sign up and authenticate via JWT stored in HTTP-only cookies
  2. Create a Story — Write and format content using the Jodit rich text editor with image support
  3. Publish & Manage — Stories can be updated or deleted by their author at any time
  4. Engage — Readers can comment on stories; authors can delete comments on their posts
  5. Connect — Follow other writers, explore their profiles, and discover new content
  6. Profile — Update your name, bio, and profile picture via Cloudinary upload

🌐 Deployment

Layer Platform
Frontend Vercel
Backend Your preferred Node.js host (Render, Railway, etc.)
Database MongoDB Atlas
Images Cloudinary CDN

🤝 Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

  1. Fork the repository
  2. Create your 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

👨‍💻 Author

Ankit Kumar Jha


📄 License

This project is open source and available under the MIT License.

About

Medium clone built using mern stack.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages