Code Monkey home page Code Monkey logo

epic-tech-blog-mvc's Introduction

The Epic Tech Blog

License

Description

For this project, I built a CMS-style blog site using the Model-View-Controller (MVC) paradigm as well as technologies such as express-handlebars, dotenv, bcrypt, express-session, and connect-session-sequelize. The Tech Blog allows a developer to publish blog posts and add comments to other developers' posts. making it easier to exchange and discuss new ideas and opinions about the tech industry. Developers can create an account on the site and make posts and comments, view posts created by them on their dashboard, and edit and delete posts. Building the blog site helped me to understand the importance of the separation of concerns and the usefulness of authenticating users and protecting api routes.

Visit the links section for the link to the deployed application on Heroku.

Table of Contents

Installation

To install this application on your local machine:

  • Clone the application's repository and place it into a local directory on your computer.
  • Ensure that your computer has node.js installed. To check the current version installed, type:
    node -v
  • Ensure that MySQL is installed on your computer.
  • Open a command-line interface (VS Code, Git Bash, etc.) and navigate to the directory containing the application's server.js.
  • In the command-line, download the application's dependencies by typing:
    npm install
  • Create an .env file in the root directory and input the following into the file while using your own username and password:
    DB_NAME='tech_blog_db'
    DB_USER='your_username'
    DB_PASSWORD='your_password'
  • Type the following command into the terminal to start the MySQL Shell. When prompted, input your password for the MySQL Shell to connect to the database.
    mysql -u root -p 
  • While in the MySQL Shell, create the database by typing:
    source db/schema.sql
  • To exit the MySQL Shell, type:
    quit
  • To seed data into the database, type:
    npm run seed

Usage

  • To start the server, type the following command:
npm start
  • While the server is running, open a web browser and navigate to http://localhost:3001/
  • On the homepage, existing blog posts will be displayed. To view a blog post's comments, click on a blog post's title.
  • To create posts and add comments to other posts, click on the login link. Existing users can log into the site using their username and password. New users can switch to the sign-up form to create their account.
  • A user's dashboard allows them to create a new post, view the posts they have created, and edit and delete any of their existing posts.
  • Users that are logged in are able to add comments to other blog posts by clicking on the post's title and filling out the comment form.
  • To log out of the site, click the logout button on the navigation bar at the top.

Screenshots

The following images demonstrate the application's appearance and functionality:

Screenshot of homepage

Screenshot of login form

Screenshot of post form

Screenshot of comment form

Technologies Used

  • express
  • express-handlebars
  • MySQL2
  • Sequelize
  • dotenv
  • bcrypt
  • express-session
  • connect-session-sequelize
  • Bootstrap 5
  • Google Fonts

Credits

Links

License

This application is covered under the MIT License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.