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.
 
 
jrtechs 0014135788 Prevented server from caching admin page and started self hosting the font file. 5 years ago
.idea Added a sitemap generator 6 years ago
admin Prevented server from caching admin page and started self hosting the font file. 5 years ago
css Prevented server from caching admin page and started self hosting the font file. 5 years ago
downloads Updated server to serve the admin pages using better async methods. 5 years ago
entries Renamed blog post to prevent collision with the part of server looking to serve java script files. 5 years ago
img Fixed small bug with hashing of images for ETag 5 years ago
includes Replaced highlight.js with some server side rendering and improved css transfer by allowing compression in header. 5 years ago
js Prevented server from caching admin page and started self hosting the font file. 5 years ago
posts Replaced highlight.js with some server side rendering and improved css transfer by allowing compression in header. 5 years ago
sidebar Updated category and sidebars pages to do stuff in a "perfect" async fashion. 5 years ago
utils Fixed the siteMap generator. 5 years ago
LICENSE Initial commit 6 years ago
README.md Leveraged both client and server side caching. 5 years ago
blogSql.svg Created export of diagram file 6 years ago
generateSitemap Started working on site map generator 6 years ago
optimizeImages.sh Optimized images to decrease website loading time. 5 years ago
package.json Leveraged both client and server side caching. 5 years ago
robots.txt added meta stuff for google 6 years ago
run Created run script 6 years ago
server.js Prevented server from caching admin page and started self hosting the font file. 5 years ago
sitemap.txt Fixed the siteMap generator. 5 years ago

README.md

NodeJSBlog

This is a project I did to recreate my word press blog using plane node js. If I were to do this again, I would use PHP. NodeJS is great, however, it was a pain to deal with all the asynchronous calls when trying to create a web page in a linear fashion.

If you want to run this project, it requires Mysql, npm, and node to be installed. For deployment I used a Nginx proxy to expose the node application running on port 8000 to port 80. This proxy is necessary because you can't run a node application as port 80 unless you are root, which would be a security vulnerability.

MYSQL Information

create database jrtechs_blog;

use jrtechs_blog;

create table users(
user_id mediumint unsigned not null AUTO_INCREMENT,
user_name varchar(60) not null,
password char(64) not null,
salt char(64) not null,
primary key(user_id)
);

create table categories(
category_id mediumint unsigned not null AUTO_INCREMENT,
name varchar(60) not null,
url varchar(60) not null,
primary key(category_id)
);

create table posts(
post_id mediumint unsigned not null AUTO_INCREMENT,
category_id mediumint unsigned not null,
picture_url varchar(100) not null,
published datetime not null,
name varchar(100) not null,
url varchar(100) not null,
primary key(post_id)
);


create table downloads(
download_id mediumint unsigned not null AUTO_INCREMENT,
file varchar(40) not null,
name varchar(40) not null,
download_count mediumint not null,
primary key(download_id)
);

create table popular_posts(
popular_post_id mediumint unsigned not null AUTO_INCREMENT,
post_id mediumint unsigned not null,
primary key(popular_post_id)
);

grant all on jrtechs_blog.* to blog_user@localhost identified by "password";

Node Dependencies

npm install express
npm install express-session
npm install mysql
npm install sanitizer
npm install promise
npm install highlight
npm install crypto
npm install remarkable
npm install markdown
npm install highlight.js

npm install memory-cache --save

Color scheme

Adobe Color Wheel

Blue:

  • Primary: #3B536B
  • Secondary: #00BEB2

Purple:

  • Primary: #513E7D
  • Secondary: #D2C0FF

Stuff for automated image compression

apt-get install jpegoptim
jpegoptim --size=500k *.jpg
apt-get install optipng
optipng *.png