Yet another blog engine
- Node.js
- PostgreSQL
- Docker (optional)
- Fetch docker-compose.* files from repository
wget https://raw.githubusercontent.com/electrified/notes/master/docker-compose.yml && wget https://raw.githubusercontent.com/electrified/notes/master/docker-compose.example.yml
- Copy
docker-compose.example.yml
todocker-compose.prod.yml
Adjust database passwords and config as necessary - Ensure latest images downloaded
docker-compose pull
(only if has been run before) - Start the containers
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
- Run database migrations
docker exec notes_web_1 npm run migrate
- Add an admin user
docker exec -i notes_web_1 npm run createUser
docker exec notes_database_1 pg_dump -U notes notes > db.sql
docker exec -i notes_database_1 psql -U notes notes < db.sql
docker exec -it notes_database_1 psql -U notes notes
- Clone this repo into e.g.
/srv/http/notes/
- Install dependencies
npm install --python=/usr/bin/python2
- Symlink systemd service file
ln -s /srv/http/notes/notes.service /etc/systemd/system
- Install postgres and initdb `su - postgres -c "initdb --locale en_GB.UTF-8 -D '/var/lib/postgres/data'"``
- Create postgres database
su - postgres createuser notes -P createdb -O notes notes
- configure connection strings in
config.(development|production).json
- Run db migration to create schema
npm run migrate
- Create an admin user
export NODE_ENV=production npm run createUser
- Enable the service
systemctl enable notes
- Start the service
systemctl start notes
Supported environment variables
- DB_USER
- DB_PASSWORD
- DB_DATABASE
- DB_HOST
- ASSETS_DIR
Log into admin area
/admin
Create first post!
- Improve 404 & 500 pages
- Check all promises usage, use promises instead of callbacks
- write tests
- check dependency versions
- Darker UI?
- Express error handling middleware to remove more boilerplate
- Stop using Facebook's fixed-data-tables as they are unmaintained?
- Fix window title on admin pages, make it use configured site title
- Cache invalidation when changing published status
- Fix HMR
- Fix
Warning: connect.session() MemoryStore is not designed for a production environment, as it will leak memory, and will not scale past a single process.
- Init db with GB locale
- Standardise log format output
- How to perform clean shutdown
- Make session key not hardcoded
- Don't use HMR when in production, prebuild assets