ScriptoriumV2, an upgraded version of the Scriptorium, is an online library information system which allows easy access to books belonging to various genres. It also has a smart recommendation system in place, which suggests books to users based on their borrowing history.
It has an Angular CLI frontend, Flask backend, and the storage is handled using MySQL (InnoDB) and Firebase.
Largely, the functionalities implemented include the following.
- Without logging into the website, a user can still view and search all books that are available
- Once a user logs in, they can borrow upto three books at a time, for a period of 21 days. There is a provision for them to renew or return the book before this period expires, beyond which they will be charged a nominal fee.
- Only a logged-in user can avail the personalised book recommendations feature, else, the latest books added to the library are recommended.
- Anyone, irrespective of whether they are a member, can contribute books to the library
A schematic diagram portraying the flow of data across the system. If the Diagram is not rendered and looks like plain text/code, then please enable the Github + Mermaid extension for Chrome.
sequenceDiagram
Angular ->> Flask: Cross Domain API call
Flask -->> Flask: REST API calls (opt)
Flask ->> MySQL: read/write requests
MySQL -->> Flask: response for read requests (opt)
Flask ->> Firebase: image storage
Firebase ->> Flask: image url
Flask ->> MySQL: read/write requests
MySQL -->> Flask: response for read requests (opt)
Flask ->> Angular: json response
Make sure you have installed all of the following prerequisites on your development machine:
- Python3 - Download & Install Python3, and ensure that it is latest version to avoid any version clashes.
- Node.js - Download & Install Node.js and the npm package manager. If you encounter any problems, you can also use this GitHub Gist to install Node.js.
- MySQL Server - Download & Install XAMPP, and make sure it's running on the default port.
- Angular CLI - Use the Angular CLI to manage your front-end packages. Make sure you've installed Node.js and npm first, then install Angular globally using npm.
Follow these steps systematically to deploy this application on your system:
- Clone the repository to your local system
$ git clone https://github.com/AryaRajivChaloli/ScriptoriumV2.git
- Navigate into the folder and create a local python environment
$ cd ScriptoriumV2
$ pipenv shell
- Install the dependencies in the environment
$ pip install flask flask-cors flask-mysqldb pyrebase4
-
Create a firebase storage and update the firebase configuration in the
app.py
file using your credentials. Following which, add the private key to the firebase project in thekeyfile.json
file. -
Start the MySQL server. Create a database with 4 tables: users, books, borrow, and history with the requisite fields in each one of them.
-
Run the flask server (on port 5000 by default)
$ flask run
- Run the angular server (on port 4200 by default), in the angular app folder
$ cd scriptorium
$ ng serve
Once all the steps required to deploy the application has been completed, it is now ready to go!
View the application on the browser at port 4200
The following is a glimpse of the Recommendation page in the Application.