Skip to content

A simple blog application demonstrating CRUD (Create, Read, Update, Delete) operations using Node.js, Express, EJS, and MongoDB. It provides a basic setup for building a full-stack application with a MongoDB database, user authentication, and dynamic content rendering.

Notifications You must be signed in to change notification settings

wmsalves/blog-node-mongo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeJS, Express, EJS & MongoDB Blog - CRUD Application

finished project

This is a simple blog application that demonstrates CRUD (Create, Read, Update, Delete) operations using Node.js, Express, EJS, and MongoDB. The application allows users to create, view, edit, and delete blog posts, making it an excellent starting point for learning about full-stack development with these technologies.

Prerequisites

To set up and run this project, you need:

Setting Up the Database

  1. Create a free cluster on MongoDB Atlas by following their documentation.
  2. Obtain your connection string (e.g., mongodb+srv://<username>:<password>@clusterName.xxxxxxx.mongodb.net/blog).

Creating the .env File

Create a .env file in the root directory of the project to store your environment variables securely. Use the following template:

MONGODB_URI=mongodb+srv://<username>:<password>@clusterName.xxxxxxx.mongodb.net/blog
JWT_SECRET=MySecretBlog
  • Replace <username>, <password>, and clusterName with your MongoDB credentials.
  • JWT_SECRET is used for authentication and should be replaced with a secure value.

Installation and Running the Project

Follow these steps to install dependencies and start the server:

  1. Install project dependencies:

    npm install
  2. Start the development server:

    npm run dev

The server will start, and the application will be accessible at http://localhost:3000 by default.


About

A simple blog application demonstrating CRUD (Create, Read, Update, Delete) operations using Node.js, Express, EJS, and MongoDB. It provides a basic setup for building a full-stack application with a MongoDB database, user authentication, and dynamic content rendering.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published