Skip to content

Repository files navigation

📝 Blog Platform with Passport Authentication

A full stack blog application built with Node.js, Express, MongoDB and Passport.js authentication.


🚀 Live Demo

🔗 Live Website https://your-live-link.com



✨ Features

✔ User Registration ✔ Secure Login Authentication ✔ Passport.js Local Strategy ✔ Create Blog Posts ✔ Edit Blog Posts ✔ Delete Blog Posts ✔ Session Based Authentication ✔ Protected Routes ✔ User Profile Management


🧰 Tech Stack

Frontend

HTML5 CSS3 Bootstrap EJS

Backend

Node.js Express.js

Database

MongoDB Mongoose

Authentication

Passport.js Express Session


📂 Project Structure

PR--BLOG-PROJECT-passport
│
├── config
│   ├── db.js
│   └── dotenv.js
│
├── controllers
│
├── middleware
│   └── passport.js
│
├── models
│   ├── user.model.js
│   └── blog.model.js
│
├── routes
│   └── index.js
│
├── views
│   ├── pages
│   └── partials
│
├── public
│   ├── css
│   └── images
│
├── app.js
└── package.json

⚙️ Installation

1️⃣ Clone Repository

git clone https://github.com/Dev-Mjarir08/PR--BLOG-PROJECT-passport.git

2️⃣ Go to Project Folder

cd PR--BLOG-PROJECT-passport

3️⃣ Install Dependencies

npm install

4️⃣ Create Environment File

Create .env file in root directory.

PORT=3000
MONGODB_URL=your_mongodb_connection_string
SESSION_SECRET=your_secret_key

5️⃣ Run the Server

npm start

or

nodemon app.js

🔐 Authentication System

This project uses Passport.js Local Strategy for authentication.

Authentication includes:

  • Secure password hashing
  • Login session
  • Protected routes
  • Authentication middleware

🌍 Deployment

You can deploy this project on:

Render Railway Vercel DigitalOcean


🤝 Contributing

Contributions are welcome.

Steps to contribute:

  1. Fork the repository
  2. Create new branch
git checkout -b feature-name
  1. Commit changes
git commit -m "Added new feature"
  1. Push branch
git push origin feature-name
  1. Create Pull Request

👨‍💻 Author

Jarir Multani

GitHub https://github.com/Dev-Mjarir08


📄 License

This project is licensed under the MIT License


⭐ Support

If you like this project:

⭐ Star the repository 🍴 Fork the project 💡 Share with others

Releases

Packages

Contributors

Languages