Skip to content

hephzaron/Hello-Books

Repository files navigation

Build Status Code Climate Test Coverage Coverage Status Issue Count

Hello-Books

Hello-Books is an E-Library application that helps manage the inflow and outflow of books, tracks and monitors users to ensure book is returned as at when due. It also send notifications to users for books borrrowed that are over-due to be reteurned.

Table of Contents

Installation and setup

Pre-requisites

Ensure the underlisted are installed on your PC before running this application

  • Latest version of Nodejs - comes with a Node Package Manager

  • Postgresql database

Installing

  1. Download or clone this branch at https://github.com/hephzaron/Hello-Books.git"
  2. Navigate to working directory and install dependencies:
npm install 
  1. Install sequelize-cli, Create Postgresql database, Navigate to server directory and run migrations:
npm install -g seqeulize-cli
cd server
sequelize db:migrate
  1. Create a .env file in the root directory of the application. Use a different database for your testing and development. Example of the content of a .env file looks like this
PRIVATE_KEY=myprivatekey
TEST_DATABASE_URL=postgres://127.0.0.1:5432/hello-books-test
  1. Start the server:
npm run start:dev

The server listens on port '5432' which can be changed by setting environment variable 'PORT'

Visit http://localhost:5432/api to access the api endpoint.

Authentication

  • It uses JSON Web Token (JWT) for user authentication.
  • Token is generated on user login
  • Token is perpetually verified to check the state of the user if logged in or not.
  • Admin role and ordinary users are assigned on login for subsequent access to authorised routes.
  • It also supports user-authorisation depending on user role(admn or non admin)

API Documentation

Ensure Ruby is installed on your PC then run gem install bundler in your terminal

  • cd slate from the root directory
  • Install Slate dependencies by running npm slate:install
  • To deploy generated files into your application run npm run slate:build
  • To start slate run npm run slate:start

Testing

  • To test run npm test or npm run test

License

This project is authored by Daramola Tobi (hephzaron@gmail.com) and is licensed for your use, modification and distribution under the MIT license. MIT © hephzaron

Author

Daramola Tobi (hephzaron@gmail.com)is an aspiring developer passionate about building real apps to enhance his learning and sharpen his programming skills.

Contributing Guide

Thank you for your interest in contributing to this package. I currently accept contributions and corrections from everyone but should be according to standards To contribute,

  1. Fork the project
  2. Create a feature branch, branch away from master
  3. Write tests, using Mocha and Chai or any other testing frameworks, and code
  4. If you have multiple commits please combine them into a few logically organized commits by squashing them
  5. Push the commit(s) to your fork
  6. Submit a merge request (MR) to the master branch
  7. The MR title should describe the change you want to make
  8. The MR description should give a motive for your change and the method you used to achieve it.
  9. Mention the issue(s) your merge request solves, using the Solves #XXX or Closes #XXX syntax to auto-close the issue(s) once the merge request will be merged.
  10. Be prepared to answer questions and incorporate feedback even if requests for this arrive weeks or months after your MR submission
  11. If a discussion has been addressed, select the "Resolve discussion" button beneath it to mark it resolved.
  12. When writing commit messages please follow these guidelines.

Acknowledgement

I would like to use this medium to acknowledge Temitayo Fadojutimi who have helped me thus far in areas that looks confusing, his contributions by suggestions, advice and guides have really encouraged me to press on.He tweets at @adesege_

Ekundayo Abiona (ekundayo.abiona@andela.com) is not left out, whose project work have been of immense benefit to me as a guide for Continous integration and Test Coverage Reporting config.

About

A book management library that can be used to track books in the library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published