Skip to content

electrified/notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notes - a node.js blog engine

Yet another blog engine

CircleCI

Prerequisites

  • Node.js
  • PostgreSQL
  • Docker (optional)

Installation with docker (Recommended)

  1. 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
  2. Copy docker-compose.example.yml to docker-compose.prod.yml Adjust database passwords and config as necessary
  3. Ensure latest images downloaded docker-compose pull (only if has been run before)
  4. Start the containers docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
  5. Run database migrations docker exec notes_web_1 npm run migrate
  6. Add an admin user docker exec -i notes_web_1 npm run createUser

Dumping the database

docker exec notes_database_1 pg_dump -U notes notes > db.sql

Restoring the database

docker exec -i notes_database_1 psql -U notes notes < db.sql

Querying the database

docker exec -it notes_database_1 psql -U notes notes

Installation without using Docker

  1. Clone this repo into e.g. /srv/http/notes/
  2. Install dependencies npm install --python=/usr/bin/python2
  3. Symlink systemd service file ln -s /srv/http/notes/notes.service /etc/systemd/system
  4. Install postgres and initdb `su - postgres -c "initdb --locale en_GB.UTF-8 -D '/var/lib/postgres/data'"``
  5. Create postgres database su - postgres createuser notes -P createdb -O notes notes
  6. configure connection strings in config.(development|production).json
  7. Run db migration to create schema npm run migrate
  8. Create an admin user export NODE_ENV=production npm run createUser
  9. Enable the service systemctl enable notes
  10. Start the service systemctl start notes

Running

Supported environment variables

  • DB_USER
  • DB_PASSWORD
  • DB_DATABASE
  • DB_HOST
  • ASSETS_DIR

Log into admin area /admin Create first post!

TODO

  • 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •