drminnaar/noteworx-cli-couchbase
A basic note application that uses a CLI (Command Line Interface) frontend to capture and manage notes, and couchbase as a data store
NoteWorx README
A basic note application that uses a CLI (Command Line Interface) frontend to capture and manage notes, and Couchbase Server as a data store.
Features
- Add a note
- Remove a note
- Find notes by:
- id
- title
- tag
- List all notes
- Tag a note
- Update note
High Level Design
Developed With
- Node.js - Javascript runtime
- yargs - Helps build CLI tools
- Couchbase Server - Document database to store data
- Docker - Used to host MongoDB instance (Not manadatory. See other options below)
Related Projects
-
A basic note application that uses a CLI (Command Line Interface) frontend to capture and manage notes, and a file system to store notes
-
A basic note application that uses a CLI (Command Line Interface) frontend to capture and manage notes, and mongodb to store notes
-
A basic note application that uses a CLI (Command Line Interface) frontend to capture and manage notes, Mongoose ODM to manage MongoDB interaction, and mongodb to store notes
-
A basic note application that uses a CLI (Command Line Interface) frontend to capture and manage notes, an express note management API built using Express, and Mongodb to store notes
-
A basic note application that uses an Express frontend to capture and manage notes, and mongodb to store notes
-
A basic note application that uses React frontend to capture and manage notes, an api written in ExpressJS, and mongodb to store notes
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Prerequisites
The following software is required to be installed on your system:
-
NodeJS
The following version of Node and Npm are required:
- Node 8.x
- Npm 3.x
Type the following commands in the terminal to verify your node and npm versions
node -v npm -v
-
Couchbase Server
Couchbase Server 5.x is required
Type the following address into your browser to verify that Couchbase Server is running on your local machine
http://localhost:8091
See alternative Couchbase Server hosting options below
Couchbase Server Setup
One of the 3 options below is recommended to get up and running with MongoDB:
- Install and host locally
- Install and host in container
- Host in the cloud
Install And Host Locally
Visit the Couchbase Developer Portal for instructions on installing Couchbase Server on your OS.
Install And Host In Container
To host couchbase in a Docker container, type the following in your terminal:
docker run -d --name cb-dev -p 8091-8094:8091-8094 -p 11210:11210 couchbaseNext, open http://localhost:8091 in your browser
For more information, see Couchbase Server Docker Hub and Couchbase Containers
Host In The Cloud
Couchbase is available via the following cloud hosting providers:
Prepare Couchbase Server For NoteWorx
Once you have a Couchbase Server running, please visit these instructions on creating a Bucket. You will need to create a Bucket called 'noteworx' using all the default settings.
Once you have created the 'noteworx' Bucket, open the Query window and type the following command into the query editor:
CREATE PRIMARY INDEX `id-index` ON `noteworx` USING GSI;At this point you have completed all that is required on the Couchbase Server for the application to work.
Install
Follow the following steps to get development environment running.
-
Clone 'noteworx-cli-couchbase' repository from GitHub
git clone https://github.com/drminnaar/noteworx-cli-couchbase.git
or using ssh
git clone git@github.com:drminnaar/noteworx-cli-couchbase.git
-
Install node modules
cd noteworx-cli-couchbase npm install
Run ESlint
-
Lint project using ESLint
npm run lint
-
Lint project using ESLint, and autofix
npm run lint:fix
Run
-
Run start
This will run
node app --helpand show a list of CLI commands that can be used to manage notesnpm start
-
Get help
node app --help node app add --help node app remove --help node app find --help node app list --help node app tag --help node app update --help
-
Add a note
node app add -t "Programming homework for weekend" -c "Read 'The Art of Computer Programming, Volume 1" --tags "programming, homework" node app add -t "Programming homework for today" -c "Read 'Computer Science Illuminated" --tags 'homework'
-
Remove a note
node app remove --id "{NOTE_ID_GOES_HERE}"
-
Find notes
-
Find notes by title
node app find -t "homework"
-
Find notes by id
node app find --id "{NOTE_ID_GOES_HERE}"
-
Find notes by tag
node app find --tag "programming"
-
-
List all notes
node app list
-
Tag a note
node app tag --id "{NOTE_ID_GOES_HERE}" --tag "{TAG_NAME_GOES_HERE}"
-
Update a note
node app update --id "{NOTE_ID_GOES_HERE}" -t "Programming homework for weekend" -c "Read 'Computer Science Illuminated Pages 200-500" --tags "homework, compsci"
Versioning
I use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
- Douglas Minnaar - Initial work - drminnaar