Awesome Open Source
Awesome Open Source


Node.js application for managing notes.

This repo serves as a playground for the following technologies:

  • Node.js
  • Express framework
  • Objection.js ORM
  • PostgresSQL
  • EventEmitter
  • Unit and Functional Testing
  • Running the app with Docker
  • Remote debugging with Chrome DevTools or Visual Studio Code using node --inspect option with latest Node.js version

Before installing make sure you have Node version >= 5.0 and NPM >= 3 and that PostgreSQL has "uuid-ossp" module installed as an extension:

  • SELECT * FROM pg_available_extensions;
  • createdb notes_development
  • createuser postgres

Instead of installing Postgres and Node on your local machine, you can use Docker!


  • New account signup using email and password or OAuth provider (Facebook)
  • Reset password feature
  • Notes CRUD pages
  • My profile page with extra option to link/unlink OAuth provider
  • Automatic updating of notes list on /notes page when anyone updates, deletes or creates new note
  • Contact form
  • Simple API examples /api/v1/users, /api/v1/notes

Quick start

# clone our repo
# --depth 1 removes all but one .git commit history
git clone --depth 1

# change directory to our repo
cd notes-app

# install the repo with npm
npm install

# run setup.js to setup initial environment in .env file
npm run setup

# create postgres db
createdb --encoding utf8 notes-development

# start the server

npm start

# or start the server in watch mode using nodemon with support for debugging

npm run watch

go to or http://localhost:3000 in your browser

Running the app with Docker

Use docker-compose up which will run two containers:

  • Node App with latest Node.js version
  • Postgres DB server
# start docker containers
docker-compose up

# after docker containers are ready, login to notesapp container and run migrations
$ docker exec -it $(docker ps | grep notesapp_notesapp | awk '{ print $1 }') bash
npm run db:migrate

# stop docker containers
docker-compose stop

REST API Example usage

# You can pretty print json responses by using pipe operator and
# the following commands: `| python -mjson.tool` or `| jq`.
# If needed, install `jq`in OSX: `brew install jq`

# All note ids are using UUIDv4

# GET a list of notes
curl \
--request GET \

# Get a single note
curl \
--request GET \

# Create a single note
curl \
--header "Content-Type: application/json" \
--request POST \
--data '{"title": "Test Title", "body": "Test note"}' \

# Update a note
curl \
--header "Content-type: application/json"
--request PUT \
--data '{"title:": "Updated title", "body": "Updated note"}' \

# Delete a note
curl \
--header "Content-type: application/json" \
--request DELETE \

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
javascript (70,403
nodejs (3,806
docker (2,921
postgresql (746
api-rest (51
socketio (36