This is the api for a note-taking react-application.
- BenriNote is a note management application, that is currently in alpha.
- In its current build...
- A user can select from a list of Publications and add them to their Dashboard.
- BenriNote creates a set of blank notes after the user adds the Publication to their Dashboard.
- BenriNote creates an individual note for each Section of a given Publication in order to avoid 'spaghetti notes™'.
- From the Dashboard, the user can...
- Read and take notes on a Publication.
- Remove a Publication from their Dashboard.
- Doing so will DELETE all of their notes associated with said Publication.
- View/Edit all of their notes for each Publication.
- A user can select from a list of Publications and add them to their Dashboard.
- Primary Features include:
- Organizing notes through direct correlation with the source material ( Publications ).
- Organizing a user's list of Publications by date-added.
- Allowing a user to take notes as they read, all on the same screen.
- Saving notes to the database periodically (onBlur)
- Saving a backup of the last edited note in local storage, in case the onBlur method fails to save the note to the database for whatever reason.
- In its current build...
After registration and login, the user can:
- Browse from a list of available Publications
- Read any of their Publications
- Publications are divided into Sections
- Take Notes on individual Sections
- Each Section has an associated section of Notes
- Notes are generated in the database when a User adds a Publication to their Dashboard
- Notes are saved to the database through an onBlur event
- As a failsafe, the User's last-edited Note is saved in Local Memory
- When either the Publication or Compiled Notes are about to be mounted,
- The application will check for any unsaved note, saving it to the database if found
- View their Notes, grouped by Publication
- Username: dunder
- Password: password
Complete the following steps to start a new project (NEW-PROJECT-NAME):
- Clone this repository to your local machine
git clone https://github.com/levipaulk/benrinote-api.git NEW-PROJECTS-NAME
cd
into the cloned repository- Make a fresh start of the git history for this project with
rm -rf .git && git init
- Install the node dependencies
npm install
- Move the example Environment file to
.env
that will be ignored by git and read by the express servermv example.env .env
- Edit the contents of the
package.json
to use NEW-PROJECT-NAME instead of"name": "benrinote-api",
Start the application npm start
Start nodemon for the application npm run dev
Run the tests npm test
Automatically re-run test npm t -- --watch
When your new project is ready for deployment, add a new Heroku application with heroku create
. This will make a new git remote called "heroku" and you can then npm run deploy
which will push to this remote's master branch.
- Install dependencies:
npm install
- Create development and test databases:
createdb benrinote
,createdb benrinotetest
- Create database user:
createuser <username>
- Grant privileges to new user in psql:
GRANT ALL PRIVILEGES ON DATABASE benrinote TO <username>
GRANT ALL PRIVILEGES ON DATABASE benrinotetest TO <username>
- Prepare environment file:
cp example.env .env
- Replace values in .env with your custom values if necessary.
- Bootstrap development database:
MIGRATION_DB_NAME=benrinote npm run migrate
- To revert:
MIGRATION_DB_NAME=benrinote npm run migrate -- 0
- To revert:
- Bootstrap test database:
MIGRATION_DB_NAME=benrinotetest npm run migrate
- To revert:
MIGRATION_DB_NAME=benrinotetest npm run migrate -- 0
- To revert:
-
Add dummy data to main database
- In command line
psql -U <username> -d benrinote -f ./path-to-benrinote-api/seeds/seed.benrinote_tables.sql
- From inside the database:
\i ./path-to-benrinote-api/seeds/seed.benrinote_tables.sql
- In command line
-
Remove data from main database
- In command line
psql -U <username> -d benrinote -f ./path-to-benrinote-api/seeds/trunc.benrinote_tables.sql
- From inside the database:
\i ./path-to-benrinote-api/seeds/trunc.benrinote_tables.sql
- In command line
- For tests involving time to run properly, your Postgres database must be configured to run in the UTC timezone.
- Locate the postgresql.conf file for your Postgres installation. +OS X, Homebrew: /usr/local/var/postgres/postgresql.conf
- Uncomment the timezone line and set it to UTC as follows:
datestyle = 'iso, mdy'
#intervalstyle = 'postgres'
timezone = 'UTC'
#timezone_abbreviations = 'Default' # Select the set of available time zone
-
This is a Express project, built using Nodejs
-
Node Modules used for this project:
- bcryptjs
- cors
- dotenv
- express
- helmet
- jsonwebtoken
- knex
- morgan
- pg
- treeize
- winston
- xss
- chai
- mocha
- nodemon
- postgrator-cli
- supertest
- "What does 'benrinote' mean?"
- benri, a.k.a. べんり or 便利, roughly translates to 'convenient'
- benri is more-or-less pronounced as 'ben-ree'