jakekausler / Library-Organizer-Server

2 stars 2 forks source link

Library Organizer

About

Library Organizer is a complete suite of tools designed to help users manage their personal or professional libraries. It hosts a variety of features:

In this document, you will find both a user guide, for normal users to learn the software, and a REST API, for developers to utilize.

Screenshots

MainGrid FilterGrid Edit Shelves ShelvesSearch StatsCount StatsPages StatsDeweys StatsDimensions

Before you start

You will need to have a MySql database setup, as well as Go and npm. First, initialize the database using /dev/create_database.sql. Then, edit /dev/libraries.env with your sql credentials and database information.

Pull down https://github.com/jakekausler/LibraryOrganizerReact and build application. Move the files from the /build folder in LibraryOrganizerReact to the /web folder in this application.

Source the /dev/libraries.env file, and then build and run the application.

User Guide

Registering and Logging In

When you first load the Library Organizer site, you will be brought to a page where you can either login to your account or register for an account. Click the appropriate button to continue to the site.

Registering an Account

If you do not have an account, you will need to register for an account. Click the register button and enter your desired username, email address, first and last name, and password. If the information provided is valid, your account will be created and you will be redirected to the main site. An empty default library is automatically created for you.

Logging In to an Account

If you do have an account, click the log in button and enter your username and password. You will be redirected to the main site.

Forgotten Password

If you have forgotten your password, you may click the log in button, then the forgot password button. Enter the email you used to create your account. An email with instructions on how to reset your password will be sent to you.

Managing Libraries and Permissions

At the core of Library Organizer are libraries. Libraries hold books and shelves on which those books can be displayed. In the settings dialog (accessed by pressing the gear button on the top right of the screen) there are various ways you may manipulate your libraries.

NOTE: You must click the save button at the bottom of the settings dialog in order for your library changes to be saved. NOTE: If you delete a library, all of its books will be deleted as well.

Managing Libraries

A user may have as many libraries as he or she desires, but must have at least one. In the settings dialog, you may create, rename, and delete your libraries. To create a library, click the plus button at the bottom of the dialog. To rename a library, simply change the library name in the text input near the top of the dialog. To delete a library, click the trash can beside the library's name. Remember that if you delete a library, all of its books will be deleted as well.

Granting Permissions

You may grant permission for other users to view, check out from, or edit your libraries. To do so, use the appropriate search box to search for a user, and click on them to add them to the corresponding permission group. You may search by name, username, or email address.

Managing User Settings

User settings are default settings used when creating shelves. These are found in the settings dialog (accessed by pressing the gear button on the top right of the screen), in the second and third tabs, respectively.

Shelf Settings

The possible shelf settings, with their value types, are as follows. See the Value Types section of this guide for more information. Setting Value Type
TODO TODO

Book Settings

The possible book settings, with their value types, are as follows. See the Value Types section of this guide for more information. Setting Value Type
TODO TODO

Searching for Books

You can open the filters menu by clicking the filter button located in the top left of the screen on the grid view. This will allow you to change which books displayed in the grid. There are several options:

To quickly navigate pages, you can press the left and right buttons at the top of the screen.

Adding and Editing Books

You may add books to or edit books in any library you own or have permission to edit. There are various ways to add or edit books.

The Book Editor

The book editor is a dialog that contains input fields for a book. The main fields and their values are as follows. See the Value Types section of this guide for more information.

Field Value Type Tab Description
Title String 1 The title of the book. Required
Subtitle String 1 The subtitle of the book.
Series String 1 The series the book is a part of. Suggestions will appear with possible series as you type.
Volume Number 1 The series volume of the book. Required. Zero is the empty volume.
Publisher String 2 The publisher of the book. Suggestions will appear with possible publishers as you type.
City String 2 The city where the book was published. Suggestions will appear with possible cities as you type.
State String 2 The state where the book was published. Suggestions will appear with possible states as you type.
Country String 2 The country where the book was published. Suggestions will appear with possible countries as you type.
Originally Published Year 2 The year in which the book was originally published. Required. 0000 is the empty year.
Edition Published Year 2 The year in which this edition of the book was published. Required. 0000 is the empty year.
ISBN ISBN 2 The ISBN of the book.
Edition Non-Negative Integer 2 The edition of the book. Required. Zero is the empty edition.
Lexile Lexile 2 The Lexile of the book. Required. 0L is the empty lexile.
Dewey Dewey 2 The dewey of the book. Required. 000 is the empty dewey.
Format String 2 The binding of the book.
Pages Non-Negative Integer 2 The number of pages in the book. Required. Zero is the empty number of pages.
Width Non-Negative Integer 2 The width of the book in millimeters. Required. Zero is the empty width.
Height Non-Negative Integer 2 The height of the book in millimeters. Required. Zero is the empty height.
Depth Non-Negative Integer 2 The depth of the book in millimeters. Required. Zero is the empty depth.
Weight Non-Negative Number 2 The weight of the book in ounces. Required. Zero is the empty weight.
Primary Language String 2 The main language in which the book is written.
Secondary Language String 2 The secondary language in which the book is written.
Original Language String 2 The original language in which the book is written.
Owned Checkbox 2 Whether or not the book is owned. If not owned, it is on the wish list.
Read Checkbox 2 Whether or not the book has been read by the library owner.
Reference Checkbox 2 Whether or not the book is considered reference by the library owner.
Reading Checkbox 2 Whether or not the book is being read by the library owner.
Shipping Checkbox 2 Whether or not the book is being shipped.

There is also a section on the first tab for adding and editing the contributors for a book. A contributor is added by filling in its fields and pressing the plus button. To edit an existing contributor, press the pencil button and fill in its fields, then click the save button. To remove an existing contributor, press the trash button.

Field Value Type Description
First Name String The first name of the contributor
Middle Names String The middle names of the contributor, separated by spaces
Last Name String The last name of the contributor
Role String The role the contributor had for the book, for instance "Author" or "Editor"

Finally, there is a section on the first tab for adding, changing, editing, and removing a book's image and spine color. An image may be added or changed in two ways: 1) By pressing the paste button and typing in an image url, or 2) By pressing the upload button and uploading an image. To remove an image, press the trash button. An image may also be cropped or rotated by pressing the pencil button.

When a book is saved, its spine color is automatically set based on the most prominant color in the image. To override this, you may click the spine color button and choose a new color. To go back to the automatically calculated color, click the default button in the color chooser.

Add from Scratch

To add a book from scratch, click the plus button at the top of the grid view. Any field which has a user setting will be automatically filled in.

Add from ISBN

To add a book from isbn, click the barcode button at the top of the grid view. Enter the isbn number and press enter. A list of possible matches will appear. Click on the one you would like to add and a book editor will appear with information gathered from that isbn.

Add from Existing Book

To add a book from an existing book, click on the book you would like to duplicate in either the library or grid view, then click on the copy button in the book view dialog. An editor menu will appear with the book's information.

Edit an Existing Book

To edit an existing book, click on the book you would like to edit and then click the pencil button. An editor menu will appear with the book's information.

Bulk Editing

TODO

Checking Out and Returning Books

If you have permission to check out from a library, you may check out books (and also return them). Any book you have checked out will display as checked out to you and will not be available for others to check out.

Checking Out a Book

To check out a book, click on the book you would like to check out from either the grid or library view. Then click the cart button. Upon confirming that you would like to check out the book, it will now be listed as a book you have checked out.

Returing a Book

To check out a book, click on the book you would like to check in from either the grid or library view. Then click the cart button. Upon confirming that you would like to check in the book, it will no longer be listed as a book you have checked out.

Exporting and Importing CSV Files

You may export or import books in a csv format. There are various options for exporting books and special considerations that must be made when importing books.

The CSV Format

TODO

Exporting

TODO

Importing

TODO

Viewing a Library

The library view (accessed by using the second button at the top of the screen) shows a physical representation of a library. It is based on case and book measurements.

Navigating the Library

To change the current library, click the filter button in the top left of the screen. To move around in the library, use the scroll bars at the right and bottom of the screen.

Searching for Books

TODO

Editing a Library

There are three types of information that can be edited for a library: The cases, breaks, and details.

Managing Cases

A library is made of book cases. Each book case has the following fields that may be edited. See the Value Types section for more details.

Field Value Type Description
Case Width Positive Integer This is the width of the shelf from end to end, not including the sides (so, from inside edge to inside edge)
Number of Shelves Positive Integer The number of shelves on this case. This is the number of locations that books may be placed, so it should include the bottom of the case.
Padding Left/Right Positive Integer This is the minimum amount of space that should be left on either side of a shelf to make up for measurements that were too small. The more accurate that you are in your measurements, the less padding that is needed.
Shelf Height Positive Integer The height, from the top of one shelf to the bottom of the next, of a shelf gap. This does not include the actual shelf height.
Spacer Size Positive Integer The thickness of the sides/shelves of a case. This is how thick the "outline" of the case and its shelves will be.

Cases may also be moved up or down by using the respective buttons, or deleted using the trash button of the corresponding case. To add a new shelf, click the plus button at the bottom of the dialog.

Managing Breaks

There are two types of breaks that a library may include:

In addition to these types of breaks, breaks can be of a specific value type:

To add a break, press the plus button at the bottom of the dialog. To remove a break, press the trash can on the corresponding break.

Managing Details

There are two other features of a library that may be edited:

Viewing Statistics

The statistics menu can be accessed by clicking the third button on the top of the screen. To change which libraries are being used to calculate the statistics, click the filter button in the top left of the screen. Only owned books are used in the calculations. There are several types of statistics, grouped into various categories:

Value Types

There are several fields that require a specific value type. The different value types are described here:

REST API

Books

Get Books


* **Error Response**
```json

Save Book


* **Error Response**
```json

Add Book


* **Error Response**
```json

Delete Book


* **Error Response**
```json

Checkout Book


* **Error Response**
```json

Checkin Book


* **Error Response**
```json

Export Books


* **Error Response**
```json

Export Contributors


* **Error Response**
```json

Import Books


* **Error Response**
```json

Get Ratings


* **Error Response**
```json

Add Rating


* **Error Response**
```json

Get Reviews


* **Error Response**
```json

Add Review


* **Error Response**
```json

Information

Get Statistics


* **Error Response**
```json

Get Dimensions


* **Error Response**
```json

Get Publishers


* **Error Response**
```json

Get Cities


* **Error Response**
```json

Get States


* **Error Response**
```json

Get Countries


* **Error Response**
```json

Get Formats


* **Error Response**
```json

Get Roles


* **Error Response**
```json

Get Series


* **Error Response**
```json

Get Languages


* **Error Response**
```json

Get Deweys


* **Error Response**
```json

Libraries

Get Libraries


* **Error Response**
```json

Get Owned Libraries


* **Error Response**
```json

Save Owned Libraries


* **Error Response**
```json

Get Cases


* **Error Response**
```json

Save Cases


* **Error Response**
```json

Get Breaks


* **Error Response**
```json

Update Breaks


* **Error Response**
```json

Get Author Based Series


* **Error Response**
```json

Update Author Based Series


* **Error Response**
```json

Get Sort Method


* **Error Response**
```json

Update Sort Method


* **Error Response**
```json

Settings

Get Settings


### Save Settings

* **Action**
`Save the user's settings.`

* **Method**
`PUT`

* **URL**
`/settings`

* **URL Params**
`none`

* **URL Arguments (?)**
`none`

* **Data Params**
```json
    "group": "Book",
    "name": "IsOwned",
    "value": "true",
    "valuetype": "select",
    "possiblevalues": [
        "true",
        "false"
    ]

* **Error Response**
```json

Get Setting


## Users
* Get Users `GET /users`
* Login `POST /users/login`
* Register `POST /users`
* Logout `POST /users/logout`
* Send Password Reset `PUT /users/password`
* Finish Password Reset `GET /users/password/:token`
* Get Username `GET /users/username`

### Get Users

* **Action**
`Get the users in a library.`

* **Method**
`GET`

* **URL**
`/users`

* **URL Params**
`none`

* **URL Arguments (?)**
`none`

* **Data Params**
`none`

* **Success Response**
```json
    [{
        "id": 1234,
        "username": "janedoe",
        "first": "Jane",
        "last": "Doe",
        "fullname": "Jane Doe",
        "email": "jdoe@test.com",
        "iconurl": "/res/usericons/1234.jpg"
    }]

### Login

* **Action**
`Log a user in to the system.`

* **Method**
`POST`

* **URL**
`/users/login`

* **URL Params**
`none`

* **URL Arguments (?)**
`none`

* **Data Params**
Form Data
  * `username`
  * `password`

* **Success Response**
Redirect to main page

* **Error Response**
```json

Register


### Logout

* **Action**
`Log a user out of the system.`

* **Method**
`POST`

* **URL**
`/users/logout`

* **URL Params**
`none`

* **URL Arguments (?)**
`none`

* **Data Params**
`none`

* **Success Response**
Redirect to unregistered page

* **Error Response**
```json

Send Password Reset


* **Error Response**
```json

Finish Password Reset


* **Error Response**
```json

Get Username