Personal blog written from scratch using Node.js, Bootstrap, and MySQL. https://jrtechs.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.3 KiB

6 years ago
6 years ago
  1. # NodeJSBlog
  2. This is a project I did to recreate my word press blog using plane node js. If I were to
  3. do this again, I would use PHP. NodeJS is great, however, it was a pain to deal
  4. with all the asynchronous calls when trying to create a web page in a linear fashion.
  5. If you want to run this project, it requires Mysql, npm, and node to be installed. For
  6. deployment I used a [Nginx](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04)
  7. proxy.
  8. ## Color scheme
  9. [Adobe Color Wheel](https://color.adobe.com/create/color-wheel/?copy=true&base=2&rule=Custom&selected=3&name=Copy%20of%20Site&mode=rgb&rgbvalues=0.231,0.325499999999957,0.42,0,0.7450980392156863,0.6980392156862745,0.10196078431372549,0.36470588235294116,0.38823529411764707,0.8235294117647058,0.7529411764705882,1,0.3165071770335184,0.24148325358851674,0.49&swatchOrder=0,1,2,3,4)
  10. Blue:
  11. - Primary: #3B536B
  12. - Secondary: #00BEB2
  13. Purple:
  14. - Primary: #513E7D
  15. - Secondary: #D2C0FF
  16. ## MYSQL Information
  17. ![](blogSql.svg)
  18. ```SQL
  19. create database jrtechs_blog;
  20. use jrtechs_blog;
  21. create table users(
  22. user_id mediumint unsigned not null AUTO_INCREMENT,
  23. user_name varchar(60) not null,
  24. password char(64) not null,
  25. salt char(64) not null,
  26. primary key(user_id)
  27. );
  28. create table categories(
  29. category_id mediumint unsigned not null AUTO_INCREMENT,
  30. name varchar(60) not null,
  31. url varchar(60) not null,
  32. primary key(category_id)
  33. );
  34. create table posts(
  35. post_id mediumint unsigned not null AUTO_INCREMENT,
  36. category_id mediumint unsigned not null,
  37. picture_url varchar(100) not null,
  38. published datetime not null,
  39. name varchar(100) not null,
  40. url varchar(100) not null,
  41. primary key(post_id)
  42. );
  43. // not used yet
  44. create table downloads(
  45. download_id mediumint unsigned not null AUTO_INCREMENT,
  46. url varchar(20) not null,
  47. file varchar(20) not null,
  48. primary key(download_id)
  49. );
  50. create table popular_posts(
  51. popular_post_id mediumint unsigned not null AUTO_INCREMENT,
  52. post_id mediumint unsigned not null,
  53. primary key(popular_post_id)
  54. );
  55. grant all on jrtechs_blog.* to blog_user@localhost identified by "password";
  56. ```
  57. ## Node Dependencies
  58. ```bash
  59. npm install express
  60. npm install express-session
  61. npm install mysql
  62. npm install sanitizer
  63. npm install promise
  64. npm install highlight
  65. npm install crypto
  66. npm install express-force-ssl
  67. npm install remarkable
  68. ```