Skip to content

Adityuhh11/Web-Dev-Blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

65 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Personal Blog Platform

A modern, full-stack blog application built with Node.js, Express, MongoDB, and EJS. This platform allows users to create, read, update, and delete blog posts, along with user authentication and authorization features.

πŸš€ Features

  • User Authentication

    • Secure user registration and login
    • JWT-based authentication
    • Password hashing with bcrypt
    • Protected routes
  • Blog Management

    • Create, read, update, and delete blog posts
    • Rich text editing capabilities
    • Responsive design for all devices
    • Categorization and tagging system
  • User Experience

    • Clean and intuitive interface
    • Real-time form validation
    • Responsive navigation
    • Error handling and user feedback

πŸ›  Tech Stack

  • Frontend:

    • EJS (Embedded JavaScript templates)
    • CSS3 for styling
    • JavaScript (ES6+)
    • Responsive design
  • Backend:

    • Node.js
    • Express.js
    • MongoDB with Mongoose ODM
  • Authentication:

    • JSON Web Tokens (JWT)
    • bcrypt for password hashing
    • Cookie-based sessions
  • Development Tools:

    • Nodemon for development server
    • Dotenv for environment variables
    • CORS for cross-origin requests

πŸš€ Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn
  • MongoDB (local or Atlas)

Installation

  1. Clone the repository

    git clone [your-repository-url]
    cd Blog-Project
  2. Install dependencies

    npm install
  3. Set up environment variables Create a .env file in the root directory with the following variables:

    PORT=3000
    MONGODB_URI=your_mongodb_connection_string
    JWT_SECRET=your_jwt_secret_key
    CORS_ORIGIN=http://localhost:3000
    
  4. Start the development server

    npm run dev
  5. Open in browser Visit http://localhost:3000 in your web browser

πŸ“‚ Project Structure

Blog-Project/
β”œβ”€β”€ public/              # Static files (CSS, JS, images)
β”‚   β”œβ”€β”€ styles/          # CSS files
β”‚   └── js/              # Client-side JavaScript
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ controllers/     # Request handlers
β”‚   β”œβ”€β”€ db/              # Database connection
β”‚   β”œβ”€β”€ middleware/      # Custom middleware
β”‚   β”œβ”€β”€ models/          # Database models
β”‚   β”œβ”€β”€ routes/          # Route definitions
β”‚   └── utils/           # Utility functions
β”œβ”€β”€ views/               # EJS templates
β”‚   β”œβ”€β”€ partials/        # Reusable components
β”‚   └── pages/           # Main page templates
β”œβ”€β”€ .env                 # Environment variables
β”œβ”€β”€ app.js               # Express app configuration
β”œβ”€β”€ index.js             # Application entry point
└── package.json         # Project dependencies and scripts

πŸ”§ Available Scripts

  • npm run dev - Start the development server with nodemon
  • npm start - Start the production server

πŸ‘¨β€πŸ’» Author

  • Aditya Sai Prem - [Your GitHub Profile]

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published