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.

148 lines
3.9 KiB

6 years ago
6 years ago
  1. # NodeJSBlog
  2. This is a personal blog where I write about everything from projects to tutorials on sophisticated machine learning algorithms.
  3. If you want to stay up to date with new posts, subscribe to my [RSS feed](https://jrtechs.net/rss).
  4. This project is a custom express application that uses pandoc to render latex/markdown files as HTML pages.
  5. This site has its very own admin portal to manage posts and downloads.
  6. ![Posts Page](docs/postsPage.png)
  7. ## Dependencies
  8. - mysql
  9. - node + npm
  10. - pandoc
  11. - nxinx (for https)
  12. ## Running
  13. Installing the node-dependencies is as easy as running the npn install command:
  14. ```
  15. npm install
  16. ```
  17. All configurations are currentl found in the config.json file.
  18. In this file you specify things like port, sql connection, etc.
  19. There is a provided bash script that will run the application
  20. ```
  21. chmod +x run.sh
  22. ./run.sh
  23. ```
  24. For 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)
  25. proxy to expose the node application running on port 8000 to port 80. This proxy is necessary
  26. because you can't run a node application as port 80 unless you are root, which would be a
  27. security vulnerability.
  28. ## Legal
  29. **Unless otherwise stated**, everything in this repository can be
  30. assumed to fall under these two licenses depending on what type of file it is.
  31. #### Code, scripts
  32. All code, scripts, or other technical / programmatic items in this repo are
  33. assumed fall under the [Mozilla Public License 2.0](https://www.mozilla.org/en-US/MPL/)
  34. unless otherwise stated.
  35. #### Guides, articles, posts, misc. content
  36. ![Creative Commons Attribution-ShareAlike 4.0 International License](https://i.creativecommons.org/l/by-sa/4.0/88x31.png)
  37. All guides, scripts, posts, or otherwise non-programmatic content in this
  38. repo is assumed to fall under
  39. the [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/)
  40. unless otherwise stated.
  41. ## Node Dependencies
  42. ```bash
  43. - express
  44. - express-session
  45. - mysql
  46. - sanitizer
  47. - promise
  48. - highlight
  49. - crypto
  50. - remarkable
  51. - markdown
  52. - highlight.js
  53. - compression
  54. - memory-cache --save
  55. - request
  56. - nodemailer
  57. - nodemailer-smtp-transport
  58. - whiskers
  59. - node-pandoc
  60. ```
  61. ## Color scheme
  62. The color scheme has been changing a lot recently.
  63. [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)
  64. current:
  65. top 2C3E50
  66. secondary 498FBE
  67. highlight:00F0E1, 88BAFF
  68. ## Image Optimization
  69. Stuff for automated image compression
  70. ```
  71. apt-get install jpegoptim
  72. apt-get install optipng
  73. ./optimizeImages.sh
  74. ```
  75. ## NGINX Configuration
  76. ```
  77. #jrtechs.net.conf
  78. server
  79. {
  80. listen 80;
  81. server_name www.jrtechs.net jrtechs.net;
  82. # redirect http requests to https
  83. return 301 https://jrtechs.net$request_uri;
  84. }
  85. server
  86. {
  87. listen 443 ssl http2;
  88. server_name jrtechs.net;
  89. ssl_certificate /etc/letsencrypt/live/jrtechs.net/cert.pem;
  90. ssl_certificate_key /etc/letsencrypt/live/jrtechs.net/privkey.pem;
  91. location / {
  92. proxy_pass http://localhost:8000;
  93. proxy_http_version 1.1;
  94. proxy_set_header Upgrade $http_upgrade;
  95. proxy_set_header Connection 'upgrade';
  96. proxy_set_header Host $host;
  97. proxy_cache_bypass $http_upgrade;
  98. }
  99. }
  100. ```
  101. ## Projects Sites
  102. 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.
  103. I simply want the project site to be accessible under https://jrtechs.net/project_name.
  104. ### State Diagram of Plan
  105. ![diagram](docs/projectsSites.svg)