Package: note0
Introduction============note0 is a command-line note taking application written for Linux. It providesa sync functionality for which your notes are stored in your Google Drive andcan be accessed and modified on other PC's where this application is installed.The application consists of a client-side and server-side. The following subsectionsprovide some more information depending on whether you need sync or not.I don't need sync-----------------If you do not wish to make use of the sync facility and are content with storingand accessing your notes locally, you do not need to consider the server-side.In this case see the subsection *client-side* under *Installation* to installthe client side.I need sync-----------If you want to make use of the sync functionality, you need to install the client-side(as you would if you didn't want sync). You would also need to have a server running.To setup your own server, instructions are availabe under the subsection *server-side*which is under *Installation*. Then, create an account with the email associated withyou Drive and a password for this account. You can now log in and start using theapplication. If you need the notes on another PC install the application there andlog in using the email and password provided during creation of note0 account.Installation============Client-side-----------To install the client-side:::$ pip install note0Now you need to set it up (one-time only, which creates a new directory in your home directory):::$ note0 -sTo start using the application:::$ note0Use the *help* command (after application has been started) to list all possible commands:::note0> helpServer-side-----------To setup your own server, you require- MySQL- npm- Node.js version 6.9.2 (the server-side wasn't tested using other versions)- To use console.developers.google.com to enable the Drive API and create anOAuth Client ID and download the JSON file consisting of the Client ID,Client Secret etc.- Downloaded copy of *server.js* and *package.json* from this project. These files can be found in the *server*directory of this project.Create a directory (the directory will be assumed to have the name *server_directory*for reference but it is not necessary to name it so) where files required to setupthe server will be present.Download the *server.js* and *package.json* file to this directory. Rename the JSON file consisting of theClient ID etc. to *client_secrets.json* and move it to this directory if not already present here.Make this directory into your working directory to install dependencies of *server.js* as follows:::$ npm installAfter you have installed MySQL, open the *server.js* file and locate the lines wherea connection to the MySQL database is created. This would be near the beginning of the scriptand would look like this:.. code:: javascriptvar connection = mysql.createConnection({user     : 'usernamehere' ,password : 'wxyz',database : 'drive'});Change the value of *user* (which is currently *usernamehere*) and *password* (which is currently *wxyz*) to your MySQL credentials.Now create a database named *drive*:.. code:: sqlmysql> CREATE DATABASE drive;In that database create two tables *users* and *sessions*:.. code:: sqlmysql> USE drive;mysql> CREATE TABLE users (email VARCHAR(256), pswd VARCHAR(256), token VARCHAR(1024), tkey VARCHAR(256), iv VARCHAR(256),tkey_key VARCHAR(256), directory_id VARCHAR(256));mysql> CREATE TABLE sessions (email VARCHAR (256), skey VARCHAR (512));Now start the server:::$ node server.jsUsage example=============::$ note0Welcome to note0Version 0.1.0Type 'help' to know moreLog in status: You are not logged innote0>  newSuccessfully created new notenote0>  openNote number: 0----------------------------------------------------------------------------------This is a samplefile used in the README of----------------------------------------------------------------------------------Which note do you want to open (note number): 0Note successfully savednote0>  deleteNote number: 0----------------------------------------------------------------------------------This is a samplefile used in the README of----------------------------------------------------------------------------------Which note do you want to delete (note number): 0Are you sure you want to delete note number 0 (y/n)?: yNote successfully deletednote0>  openYou do not have any notesnote0>  deleteYou do not have any notesnote0>  helpDocumented commands (type help <topic>):========================================change_password  delete          exit  login   new   set_editor  statuscreate_account   delete_account  help  logout  open  set_url     syncnote0>  syncSync not possible since you are not logged innote0>  help exitUse this command to exit the applicationnote0>  exit$Notes are opened in the editor that can be set using *set_editor*.How note0 works===============The client-side consists of a directory *.note0* that is created in the home directory.It stores the notes and a config file containing information regarding who is logged in,address of the server and more. The server stores information on user accounts,login sessions etc. When the server receives a request, for example to upload a note, it makes useof the Google API to upload it to the user's drive.A note0 account is required to make use of the sync functionality and if an account is createdthen notes can be stored locally and on Drive. If a note0 account is not created then notes canonly be stored locally.