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.

117 lines
3.6 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 to expose the node application running on port 8000 to port 80. This proxy is necessary
  8. because you can't run a node application as port 80 unless you are root, which would be a
  9. security vulnerability.
  10. ## Legal
  11. **Unless otherwise stated**, everything in this repository can be
  12. assumed to fall under these two licenses depending on what type of file it is.
  13. #### Code, scripts
  14. All code, scripts, or other technical / programmatic items in this repo are
  15. assumed fall under the [Mozilla Public License 2.0](https://www.mozilla.org/en-US/MPL/)
  16. unless otherwise stated.
  17. #### Guides, articles, posts, misc. content
  18. ![Creative Commons Attribution-ShareAlike 4.0 International License](https://i.creativecommons.org/l/by-sa/4.0/88x31.png)
  19. All guides, scripts, posts, or otherwise non-programmatic content in this
  20. repo is assumed to fall under
  21. the [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/)
  22. unless otherwise stated.
  23. ## Node Dependencies
  24. ```bash
  25. npm install express
  26. npm install express-session
  27. npm install mysql
  28. npm install sanitizer
  29. npm install promise
  30. npm install highlight
  31. npm install crypto
  32. npm install remarkable
  33. npm install markdown
  34. npm install highlight.js
  35. npm install compression
  36. npm install memory-cache --save
  37. npm install request
  38. npm install nodemailer
  39. npm install nodemailer-smtp-transport
  40. npm install whiskers
  41. npm install node-pandoc
  42. ```
  43. ## Color scheme
  44. The color scheme has been changing a lot recently.
  45. [Adobe Color Wheel](https://color.adobe.com/create/color-wheel/?copy=true&base=2&rule=Custom&selected=4&name=Copy%20of%20Site&mode=cmyk&rgbvalues=0.17254901960784313,0.24313725490196078,0.3137254901960784,0.28627450980392155,0.5607843137254902,0.7450980392156863,0.5329137283008958,0.7301501780381741,1,0.8235294117647058,0.7529411764705882,1,0.042420144797897574,0,0.17000000000000004&swatchOrder=0,1,2,3,4)
  46. current:
  47. top 2C3E50
  48. secondary 498FBE
  49. highlight:00F0E1, 88BAFF
  50. ## Image Optimization
  51. Stuff for automated image compression
  52. ```
  53. apt-get install jpegoptim
  54. apt-get install optipng
  55. ./optimizeImages.sh
  56. ```
  57. ## NGINX Configuration
  58. ```
  59. #jrtechs.net.conf
  60. server
  61. {
  62. listen 80;
  63. server_name www.jrtechs.net jrtechs.net;
  64. # redirect http requests to https
  65. return 301 https://jrtechs.net$request_uri;
  66. }
  67. server
  68. {
  69. listen 443 ssl http2;
  70. server_name jrtechs.net;
  71. ssl_certificate /etc/letsencrypt/live/jrtechs.net/cert.pem;
  72. ssl_certificate_key /etc/letsencrypt/live/jrtechs.net/privkey.pem;
  73. location / {
  74. proxy_pass http://localhost:8000;
  75. proxy_http_version 1.1;
  76. proxy_set_header Upgrade $http_upgrade;
  77. proxy_set_header Connection 'upgrade';
  78. proxy_set_header Host $host;
  79. proxy_cache_bypass $http_upgrade;
  80. }
  81. }
  82. ```
  83. ## Projects Sites
  84. As I develop more projects I would like an easy way to add and host them on my website without having to create another sub-domain and generate more ssl certs.
  85. I simply want the project site to be accessible under https://jrtechs.net/project_name.
  86. ### State Diagram of Plan
  87. ![diagram](docs/projectsSites.svg)