/bookmark

Application to create and track reading lists for users. Uses MVC - Node, Express, Sequelize and Handlebars.

Primary LanguageJavaScript

bookmarks-title

bookmark

Application to create and track reading lists for users.

Purpose

Allows the avid reader to find books and add them to a personal reading list, tracking completion status and category. Demonstrates use of Sequelize, Handlebars, Express, and more.

Getting Started

You should be able to download the files via the github pages link below and run locally on your computer:

https://github.com/emswann/bookmark.git.

The application has also been published on Heroku:

https://bookmark-gt.herokuapp.com/.

Local Installation

.env setup

When locally hosted, Bookmarks requires a .env file to contain MYSQL database information, and an API key for Google Books. Include the following information as environment variables:

MYSQLDB_URL=mysql://<username>:<password>@localhost:<port>/<database>
PORT=<port>
GBOOKS_API_KEY=<google books api key>

Database setup

You may use the Sequelize Command Line Interface to establish a MYSQL database and populate it with the included migrations and seeds. Refer to the Sequelize documentation for more information, but the basic procedure is as follows:

$ sequelize db:create
$ sequelize db:migrate
$ sequelize db:seed:all

You may also include some test seeds with an additional CLI line:

$ sequelize db:seed:all --seeders-path "seeders/test"

This procedure will create database_db.

Usage

Upon logging in with a freshly created account, the user will have an empty "reading list" and the opportunity to search for books via the Google API. Books may then be added to the reading list.

add-to-list

The book will have "completion status" and "category" fields available to them once in the reading list.

reading-list-book

Click on the current status or category to change it. The reading list may then be filtered by status or category.

tag-changing

When a book is assigned "Deleted" status, it is removed from all list views unless the user specifically chooses to view "Deleted" books only. In this view, "Deleted" books are also granted a "Trash" button, which will remove the book from the reading list completely. (It may be found again in the "book search" area if desired.)

trash-button

Built With

  • Google Books API - Google API containing all book content for application.
  • Bootstrap - Front-end HTML, CSS, javascript framework for creating responsive web applications.
  • JavaScript - Programming language.
  • jQuery - Javascript library.
  • node.js - Server side programming language.
  • express - Web application framework used for server side routing.
  • express-handlebars - Middleware template engine used to render HTML templates.
  • EJS - Middleware template engine used to render HTML templates.
  • @datafire/google_books - Middleware providing interface to Google Books API.
  • mySql - node.js driver for mySql.
  • Sequelize - Promised based ORM for Node.js.
  • Passport - Express-compatible authentication middleware for Node.js.
  • Chai - BDD / TDD assertion library for Node.js.
  • Mocha - BDD / TDD test framework for Node.js.
  • Nightmare - High-level browser automation test library.
  • express-session - Simple session middleware for Express.
  • passport-local - Local username and password authentication strategy for Passport.
  • bcrypt-nodejs - Native JS bcrypt library for Node.js.
  • connect-flash - Flash message middleware for Connect.
  • chai-http - Extends Chai Assertion library with tests for http apis.
  • body-parser - Middleware parser used for incoming request bodies.
  • dotenv - Loads environment variables from .env file.
  • path - Path module for Node.js.

Credits

  • Matt Haddock
  • Denton Kerr
  • Elaina Swann