An open API service indexing awesome lists of open source software.

https://github.com/eyupfidan/node-blog

This project is a blog application developed using Node.js, Express, Handlebars, and MongoDB.
https://github.com/eyupfidan/node-blog

authentication express handlebars session

Last synced: 3 months ago
JSON representation

This project is a blog application developed using Node.js, Express, Handlebars, and MongoDB.

Awesome Lists containing this project

README

          



Node.js Blog Application


This application is a blog app developed using Node.js, Express, Handlebars, and MongoDB. The app allows users to add new blog posts, view and update existing posts, and also includes login and session functionality.


Installation



  1. Download or clone the project to your computer.

  2. If Node.js is not already installed, download and install it from here.

  3. Navigate to the project's root directory in your terminal or command prompt.

  4. Run the command npm install in your terminal or command prompt.

  5. Create a MongoDB account or log in to an existing one.

  6. Create a .env file and set the variables containing your MongoDB connection string and session secret key:

```bash
MONGOOSE_CONNECT_URL=
```


  1. Run the command npm start in your terminal or command prompt.


Usage


The app runs at http://localhost:3000.




  • /: Home page where you can view the blog posts.


  • /posts: List of blog posts, form to add a new post, and page to edit an existing post.


  • /users: Login page and registration page for users.


  • /users/logout: Logs out the user.


Development


The app is developed using Node.js, Express, Handlebars, and MongoDB. The main files are:




  • app.js: The main application file.


  • routes/main.js: The routers for the home page route.


  • routes/posts.js: The routers for the blog post routes.


  • routes/users.js: The routers for the user routes.


  • views/: Handlebars templates.


  • public/: Static files used to serve content.


Contributing


Before contributing, please check the issues tab and discuss any suggestions or issues related to the development of the project.



  1. Fork the repository.

  2. Create a branch: git checkout -b feature/xyz.

  3. Commit your changes: git commit -am 'Add some feature'.

  4. Push to the branch: git push origin feature/xyz.

  5. Submit a pull request.