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.
- Description
- Installation
- Usage
- Directory Structure
- Technologies Used
- Setup
- Deployment
- Appearance
- Acknowledgements
- Questions
- License
Install dependencies using:
npm install
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
.
├── 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
- Node.js
- Express.js
- MySQL
- Sequelize (ORM)
- mysql2
- marked and dompurify (support styling blogs with markdown)
- dotenv
- Heroku
- 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)
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
- https://www.npmjs.com/package/bcrypt
- https://www.npmjs.com/package/connect-session-sequelize
- https://www.npmjs.com/package/dompurify
- https://www.npmjs.com/package/dotenv
- https://www.npmjs.com/package/express
- https://www.npmjs.com/package/express-handlebars
- https://www.npmjs.com/package/express-session
- https://www.npmjs.com/package/jsdom
- https://www.npmjs.com/package/marked
- https://www.npmjs.com/package/mysql2
- https://www.npmjs.com/package/nodemon
- https://www.npmjs.com/package/sequelize
Created by: @moedaaboul
Feel free to contact me via muhammad.daaboul1989@gmail.com!
This work is licensed under MIT.