Skip to content

Latest commit

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date

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

TechnologyPurpose
React.jsUI library and component architecture
React Router DOMClient-side routing and navigation
Tailwind CSSUtility-first responsive styling
Jodit EditorRich text editor for story creation
React Hot ToastToast notifications for user feedback

🔹 Backend

TechnologyPurpose
Node.jsServer runtime
Express.jsREST API framework
MongoDBNoSQL database for storing users, stories, and comments
MongooseMongoDB ODM for schema modeling
CloudinaryCloud-based image storage and delivery
jsonwebtokenJWT-based authentication
cookie-parserHTTP 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=5000MONGO_URI=your_mongodb_connection_stringJWT_SECRET=your_jwt_secretCLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_nameCLOUDINARY_API_KEY=your_cloudinary_api_keyCLOUDINARY_API_SECRET=your_cloudinary_api_secretCLIENT_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

LayerPlatform
FrontendVercel
BackendYour preferred Node.js host (Render, Railway, etc.)
DatabaseMongoDB Atlas
ImagesCloudinary 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

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages