This is a basic blog website built using Node.js and Express.js. It allows users to read, create, update and delete blog posts.
- Node.js (version 14 or above)
- MongoDB (version 4 or above)
- Clone the repository using
git clone https://github.com/your-username/node-express-blog.git
- Install dependencies using
npm install
- Create a
.env
file in the root directory and add the following environment variables:
MONGODB_URI=<your-mongodb-uri>
SESSION_SECRET=<your-session-secret>
- Run the application using
npm start
- Access the application at
http://localhost:3000
- Create a new blog post
- Read existing blog posts
- Update existing blog posts
- Delete existing blog posts
- User authentication using sessions
- Flash messages for successful or failed actions
- Responsive design using Bootstrap 5
controllers/
- Contains controller functions for handling requests and responsesmodels/
- Contains Mongoose models for interacting with the databaseroutes/
- Contains route definitions for the applicationviews/
- Contains the EJS templates for rendering HTML pagespublic/
- Contains static assets such as CSS and JavaScript filesapp.js
- The main entry point for the application
Contributions are welcome! Please create a new branch and submit a pull request for any changes.
This project is licensed under the MIT License.