BookLab allows users to quickly scan the books on their bookshelves and provides recommendations based on your collection when scanning other bookshelves. Click the image below for a video preview of the application:
Download the source code by running the following code in your command prompt:
git clone https://gitlab.ewi.tudelft.nl/TI2806/2017-2018/MS/ms1/ms1.git
or simply grab a copy of the source code as a Zip file.
The project provides multiple deployment types:
- Testing
This deployment type is suitable for testing and development environments and uses an in-memory database to store the data. This deployment uses the latest, cutting-edge technology for book detection and recommendation. - Production
This deployment type is suitable for a production environment and uses a Postgres as backing database. This deployment uses the latest, cutting-edge technology for book detection and recommendation. - OSS
This deployment type is similar to the testing deployment type, but does not rely on external (Google) services for book detection and text extraction. This type should be preferred if using the (paid) services from Google forms a problem.
Make sure you have done the following:
- Install and start Docker
Docker should be running before you are able to build the images. See Docker for more information on installing it. On Windows, make sure you have exposed the daemon without TLS (you can change this in Settings). - Install docker-compose
Make sure thatdocker-compose
is installed on your system. See this page on how to install the program. - Add Google Books API key to environment
Add the API key for Google Books to your environmental variables under the name
GOOGLE_BOOKS_API_KEY
. See this page on how to acquire an API key. - Copy Google Cloud credentials to configuration folder
The key file for your Google Cloud service account should be put in theconfig
directory right in the root of the project askeys.json
. See this page on how to acquire a service account for Google Cloud and generate a key file. Make sure you have enabled the Google Vision API.
After that, run the following command to build the Docker images for the project:
./gradlew dockerBuildImage
Finally, you can start the images using docker-compose
. Make sure that you have set the TAG
environmental variable
to the version you want to deploy (e.g 1.0).
docker-compose up
The website will now be available at http://localhost.
Make sure the following variables are defined in your environment:
- GOOGLE_BOOKS_API_KEY
An API key for Google Books which allows the backend server to query its catalogue. See this page on how to acquire an API key. - GOOGLE_APPLICATION_CREDENTIALS The path to your Google Cloud service account keys. See this page on how to acquire a service account for Google Cloud and generate a key file. Make sure you have enabled the Google Vision API.
After that, run the following command to start the backend (testing deployment):
./gradlew :booklab-deployment-testing:run
To run the frontend run the following code in your command prompt within the booklab-frontend-web
folder. Make sure you have installed the dependencies of the project using npm install
.
npm run ng serve -- --open
This will automatically open the frontend on http://localhost:4200.
Before starting development, make sure you have the correct environmental variables defined. See the deployment steps on which variables have to be defined.
In order to run the tests and the linter, enter the following code in your command prompt:
./gradlew check
This command will show all the tests that fail and possible formatting errors.
In order to run the tests for the Angular frontend, enter the following code in your command prompt in the booklab-frontend
directory:
npm run test
Additionally, if you want to check the source code for formatting errors, run:
npm run lint
Finally, if you want to run the end-to-end tests, run:
npm run e2e
If you do not have the Android SDK or iOS SDK installed and you are not interested in building the mobile applications, either:
- Set the environmental variable to ignore the projects:
ORG_GRADLE_PROJECT_exclude=booklab-frontend-ios,booklab-frontend-android
- Set the
exclude
property in yourgradle.properties
:
exclude=booklab-frontend-ios,booklab-frontend-android
In addition to this document, the repository contains a README for each of the modules that builds this project. Read below to learn how you can take part in improving BookLab.
Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to BookLab.
The code is released under the Apache version 2.0 license. See the
LICENSE.txt
file.