Skip to content

A CMS-style blog site that follows the MVC paradigm built with Node.js, Sequelize, Handlebars.js and Bulma.

License

Notifications You must be signed in to change notification settings

moedaaboul/tech-blog

Repository files navigation

tech-blog

License: MIT

Description

Task was to build a CMS-style blog site similar to a Wordpress site, where developers can publish their blog posts and comment on other developers’ posts. This app has been built completely from scratch and deployed to Heroku. The app follows the MVC paradigm in its architectural structure, using Handlebars.js as the templating language, Sequelize as the ORM, and the express-session npm package for authentication.

Table of Contents

Installation

​Install dependencies using:

npm install

Usage

Login to mysql using the terminal using and the follow with your password:

mysql -u root -p

The db schema will be added using the following:

source .db/schema.sql

Mock seeds have been created and will be added using the following:

npm run seed

The application will then be invoked by using the following command:

npm start

Directory Structure

.
├── assets/
├── config/
├── controllers/
│ ├── api/
| | ├── blogRoutes.js
| | ├── commentRoutes.js
| | ├── userRoutes.js
| | └── index.js
│ ├── homeRoutes.js
│ └── index.js
├── db/
├── models/
│ ├── Blog.js
│ ├── Comment.js
│ ├── User.js
│ └── index.js
├── seeds/
├── utils/
├── views/
│ ├── layouts/
│ └── partials/
├── .env
├── .gitignore
├── LICENSE
├── package.json
├── README.md
└── Server.js

Technologies Used

  • Node.js
  • Express.js
  • MySQL
  • Sequelize (ORM)
  • mysql2
  • marked and dompurify (support styling blogs with markdown)
  • dotenv
  • Heroku

Setup

  • Nodejs must be installed
  • MySQL must be installed
  • Insomnia is recommended to test routes
  • MySQL Workbench (MySQL GUI recommended but not required)
  • Text editor (VS Code recommended)

Deployment

This app has been deployed via Heroku. If you choose to deploy your own ensure that the JAWSDB variable is set at the dyno. Upon ensuring that enviroment variables have been set up in the settings tab, you can go ahead and deploy the app to Heroku.

Additionally, deployed code should not be linked to any locally stored environment variables on your local machine.

If deployment fails, try debugging using the following command using the heroku CLI:

heroku logs --tail

Then in the upper right corner of your heroku UI, click on more actions then select the option to restart all dynos. This will capture the logs as the app starts up it should allow you to get the entire stack trace

Appearance

My dashboard view of Tech Blog Single post view of Tech Blog Comments editing view of Tech Blog

Acknowledgements

Questions

Created by: @moedaaboul

Feel free to contact me via muhammad.daaboul1989@gmail.com!

License

This work is licensed under MIT.