Personal Blog v.4
This is my personal blog hosted at karllhughes.com. Wordpress has become too cumbersome for my simple needs, so I made this NodeJS application to serve as my blog. Feel free to use it (with attribution) or learn from it.
Note: older versions of this site were maintained in another repository.
- Blog posts with type and tag archive pages.
- Simple, responsive design.
- Node 6.7+
- ExpressJS framework
- NeDB database
- Camo ODM
- Handlebars templating engine
- Marked markdown parser
- Node RSS feed generator
- Webpack Builder
- Milligram styling framework
- Simple Line Icons
- Docker and Docker-Compose
.data/*The DB content is stored here, so it is ignored in version control.
app/The controllers, routes, middleware, database connections, etc. needed for the NodeJS application. This is where the bulk of the work happens.
assets/Un-built frontend files/scripts.
bin/wwwApplication boot file. Probably don't need to change this much.
docker/Docker Compose files and shell scripts.
public/*Built frontend files/scripts.
views/*Handlebars view templates.
Don't install everything locally; containers are way cooler.
- Docker should be installed and running.
- Node v.6+ and NPM v.4+ should be installed.
npm run app:local:buildto build the Dockerfile.
npm run app:local:upto get the app running.
- The site is served at
localhost:43000and should be watching for changes to both the Node and frontend files.
Currently running containers on Hyper.sh.
Updating production code:
npm run app:prod:deploy
To get data from production, I use Hyper's CLI:
- Make snapshot
hyper snapshot create -v personalblog -f --name personal-blog-backup-1
- Create a volume
hyper volume create --snapshot personal-blog-backup-1 --name personal-blog-backup-1
- View posts in command line
hyper run --name personal-blog-backup --rm -v personal-blog-backup-1:/src/.data alpine tail -n +1 src/.data/posts.db
- View settings in command line
hyper run --name personal-blog-backup --rm -v personal-blog-backup-1:/src/.data alpine tail -n +1 src/.data/settings.db
Then I just copy the json into my local
Copyright 2017, Karl Hughes
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.