Skip to content

Ashitosh0302/Blog-Applications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blog Applications

A simple Blog Application built with Node.js, Express, EJS, and MongoDB Atlas, deployed on Render. Users can view blogs, add new blogs, and manage authentication.


🚀 Features

  • User signup & signin
  • Add, view, and manage blogs
  • MongoDB Atlas as database
  • Deployed on Render
  • Responsive UI using EJS templates

🛠 Technologies Used

  • Node.js (v22.16.0)
  • Express.js
  • MongoDB Atlas (via Mongoose)
  • EJS for templating
  • dotenv for environment variables

📁 Project Structure

Blog-Application/
│
├── app.js                          # Main server file
├── package.json                    # Project dependencies and scripts
├── .env                            # Environment variables
├── .gitignore                      # Git ignore file
│
├── public/                         # Static files
│   ├── css/                        # Stylesheets
│   │   └── style.css
│   ├── js/                         # Client-side JavaScript
│   │   └── main.js
│   └── images/                     # Images
│       └── (image files)
│
├── views/                          # EJS templates
│   ├── partials/                   # Reusable components
│   │   ├── head.ejs
│   │   └── nav.ejs
│   ├── blog.ejs                    # Blog home page
│   ├── add-new.ejs                 # Add new blog page
│   ├── signup.ejs                  # Signup page
│   └── signin.ejs                  # Signin page
│
├── routes/                         # Application routes
│   └── home.js
│
└── models/                         # Database models
    └── user.js

Node PACKAGES

Path Type Description
app.js File Main application
package.json File Dependencies
public/ Folder Static files
public/css/ Folder Stylesheets
public/js/ Folder JavaScript

⚙️ Project Working

This Blog Application follows a client–server architecture using Express and MongoDB.

🔹 Application Flow

  1. The server starts using Node.js & Express.
  2. EJS is used for server-side rendering of pages.
  3. Users interact with the application through forms and pages.
  4. Requests are handled by Express routes.
  5. Data is stored and retrieved from MongoDB Atlas using Mongoose.
  6. Render hosts the application and manages environment variables.

🔹 User Authentication Flow

  1. User signs up using the signup form.
  2. User details are stored in MongoDB.
  3. User can sign in using registered credentials.
  4. After authentication, users can access blog features.

🔹 Blog Management Flow

  1. User opens the blog home page.
  2. User navigates to Add New Blog page.
  3. Blog data is submitted via a form.
  4. Server processes the request and stores blog data in MongoDB.
  5. Blogs are fetched from the database and displayed on the home page.

🔹 Database Interaction

  • Mongoose is used as an ODM.
  • Schemas define the structure of stored data.
  • MongoDB Atlas handles cloud storage and scalability.

🔹 Environment Configuration

  • Sensitive information (MongoDB URL, Port) is stored in .env.
  • Render injects environment variables during deployment.

About

A full-stack blog application implementing server-side rendering with Express and EJS, MongoDB Atlas for data persistence, and cloud deployment on Render.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors