https://github.com/naskio/daar_4_bookfinder
Search engine for free books
https://github.com/naskio/daar_4_bookfinder
docker docker-compose gutenberg mongodb neo4j react redux search-engine
Last synced: 2 months ago
JSON representation
Search engine for free books
- Host: GitHub
- URL: https://github.com/naskio/daar_4_bookfinder
- Owner: naskio
- License: gpl-3.0
- Created: 2021-01-31T09:08:43.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-08T21:09:17.000Z (over 5 years ago)
- Last Synced: 2025-02-25T06:16:28.329Z (over 1 year ago)
- Topics: docker, docker-compose, gutenberg, mongodb, neo4j, react, redux, search-engine
- Language: JavaScript
- Homepage: https://naskio.github.io/DAAR_4_BookFinder/
- Size: 11.7 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DAAR Project A: Book Finder



Search Engine for free books (gutenberg.org).
* [Introduction](#Introduction)
* [Features](#Features)
* [Quick Links](#Quick-Links)
* [DataSet](#dataset)
* [Getting started](#getting-started) (Instructions to build and run the project)
* [Requirements](#requirements)
* [Configure](#configure)
* [build](#build)
* [Run](#run)
* [Docker Architecture](#docker-architecture)
* [MongoDB](#mongodb)
* [Neo4j](#neo4j)
* [Code Structure](#code-structure)
* [User Interfaces](#user-interfaces)
* [About](#about)
## Introduction
Book Finder is a Search Engine that helps you find free books quickly and recommend you similar books.
### Features
- Indexing Books from online library (gutenberg.org or another source).
- Search a book by a keyword.
- Search a book by a regular expression.
- The search results are sorted by relevancy.
- Get recommendations (Similar books).
- Auto-correct: the system suggests automatically a keyword when you search for a keyword that doesn't match.
- REST APIs that can be used with other clients.
### Quick Links
These are a shortcuts to help you access the Application quickly.
- [Book Finder](http://localhost:3000/)
- [REST APIs (Swagger Docs)](http://localhost:8000/api/swagger/)
- [REST APIs](http://localhost:8000/api/)
### DataSet
The system supports indexing books from ```gutenber.org``` (it can be expanded easily to cover more libraries).
## Getting started
These instructions will get you a copy of the project up and running on your local machine or in a production server.
### Requirements
To make the system independent of the environment and make it easier for you to run it, we are using Docker.
1. [Docker or Docker Desktop](https://www.docker.com) (Docker engine 19+ with Docker compose).
### Configure
After cloning the repository, we start by configuring the environment:
1. Rename ```.env_example``` to ```.env``` or create an ```.env``` file in the root folder (same folder
as ```docker-compose.yaml``` file) and copy the content of ```.env_example``` to ```.env``` file.
1. Optionally Customize the variables according to your preferences.
### Build
1. We start by building the images using the command
```shell script
docker-compose build
```
1. Run the project
```shell script
docker-compose up
```
1. Open a new tab in the terminal and run the migrations using the command
```shell script
docker-compose run web python manage.py migrate
```
1. then index some books from gutenberg.org (change the parameter n to change the number of books)
```shell script
docker-compose run web python manage.py collect_data --n 10
```
1. Calculate the Jaccard's Graph
```shell script
docker-compose run web python manage.py calculate_graph
```
1. Calculate the Centrality Ranks (Betweenness Centrality)
```shell script
docker-compose run web python manage.py calculate_centrality
```
### Run
- To run the system
```shell script
docker-compose up
```
- To shut down the system (from another tab)
```shell script
docker-compose down
```
## Docker Architecture
The application consists of 4 containers:
1. *mongodb* where the MongoDB instance is running.
1. *neo4j* where the neo4j instance is running.
1. *web* where the backend server is running.
1. *frontend* server to serve the React App.
> MongoDB will persist data on ```./mongodb_data/``` folder (mounted-host volume).
> Neo4j will persist data on ```./neo4j_data/``` folder (mounted-host volume).
### MongoDB
We use MongoDB to store the books meta-data and the index table (keywords -> books).
### Neo4j
We use neo4j to store the Jaccard's Graph.
## Code Structure
- frontend: contains the code of the Web App (which is also available as PWA) using React and Redux.
- backend: contains the code of search engine, using Django and Django Rest Framework.
## User Interfaces
After indexing some books, we can test the Search Engine
1. Search by keyword

1. Search results

1. Search by regex

1. Auto-complete

1. Auto-correct

1. book

1. similar books

1. Mobile App (PWA)
1. Add to Home Screen

1. Icon

1. PWA

## About
Team: Mehdi Nassim KHODJA, Qiwei XIAN, Adel EL AMRAOUI
Developed by students at Sorbonne University, just for learning purposes (part of DAAR lectures). Using Python with
Django, MongoDB, Neo4j, React, Redux and Docker.