Skip to content
GarvSaxenaPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Full Stack Blog Application

A complete, full-stack blogging platform built with Node.js, Express, and MongoDB. This application allows users to create accounts, log securely into the system, publish blog posts with cover images, and interact with other users' posts through comments.

Features

  • User Authentication: Secure sign up and login using JSON Web Tokens (JWT) stored in HTTP-only cookies.
  • Blog Publishing: Authenticated users can create, read, and manage blog posts.
  • Image Uploads: Seamless cover image uploading for blog posts managed by Multer.
  • Commenting System: Users can leave public comments on any blog post.
  • Dynamic Views: Server-side rendering using EJS templating engine.
  • Responsive Design: Styled using Bootstrap for a clean and mobile-friendly user interface.

Tech Stack

  • Backend: Node.js, Express.js
  • Database: MongoDB, Mongoose
  • Authentication: jsonwebtoken (JWT), cookie-parser
  • File Storage: Multer
  • Frontend: EJS, Bootstrap

Installation and Setup

  1. Clone the repository

    git clone <your-repository-url>
    cd blog-app
  2. Install dependencies Ensure you have Node.js installed, then run:

    npm install
  3. Environment Variables Create a .env file in the root directory and add your MongoDB connection string and a secret key for JWT:

    MONGO_URL="mongodb://127.0.0.1:27017/blogApp"
    PORT=8000
    

    (Note: Ensure you do not commit your .env file to version control. It should be listed in your .gitignore)

  4. Start the Server To run the application in production mode:

    npm start

    To run the application in development mode (with auto-reloading):

    npm run dev
  5. Access the Application Open your browser and navigate to http://localhost:8000

Application Structure

  • /models - Mongoose database schemas (User, Blog, Comment)
  • /routes - Express route handlers for different endpoints
  • /controllers - Core business logic for the application
  • /views - EJS templates for frontend rendering
  • /public - Static assets (uploaded images, CSS files)
  • /services - Helper services (like JWT generation and validation)
  • /middlewares - Custom Express middlewares for authentication checks

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages