This project is a simple blog website built using Node.js, Express.js, and MongoDB. It allows users to view, create, and read articles on various topics. Additionally, users can contact the website administrators through a contact form.
- View a list of articles on the home page.
- Read individual articles by clicking on them.
- Compose new articles with titles, content, images, and videos.
- Upload images and videos, or provide URLs for them.
- Contact administrators through the contact page.
-
Clone the repository:
git clone https://github.com/gauravbhaskar080/blog-post.git
-
Install dependencies:
Navigate to the project directory and run:
cd blog-post
npm install
-
Set up MongoDB:
-
Create a
.env
file in the root directory and add your MongoDB URL:MONGO_URL = 'your_mongo_db_url' PORT = 3000
-
-
Start the server:
npm start
The server will start at
http://localhost:3000
. -
Access the website:
Open a web browser and go to
http://localhost:3000
.
models/
: Contains Mongoose models for MongoDB.views/
: Contains EJS templates for rendering HTML.public/
: Holds static files like CSS, images, and JavaScript.dbConnection.js
: Establishes a connection to the MongoDB database.index.js
: The main entry point of the application....
(other files): Additional supporting files.
If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with descriptive messages.
- Push your changes to your forked repository.
- Create a pull request to the original repository.
This project is licensed under the MIT License. Feel free to use, modify, and distribute the code for your own purposes.