Mynij - search faster, offline

Mynij Milestone 3: PWA Application Release

The code of Mynij application was refactored into a progressive web application by using the render.js and the PWA generator of ERP5. The new user interface provides some visualisation of the index building and sharing process.
  • Last Update:2021-02-22
  • Version:001
  • Language:en

The goal of this Milestone is to refactor the Mynij application using the same code base of Officejs applications and provide a simple solution for users to define thier own list of websites to search and index. This PWA app will provide:

  • Accessibility (make an app easier to use)
  • Query and results page
  • Add and List RSS/Sitemap sources
  • Build source index in background
  • Import list of RSS/Sitemap
  • Export list of RSS/Sitemap
  • Import index with or without content
  • Export index with or without content

The OfficeJS appstore is a software to run an ecosystem for progressive web applications developed with renderJS and jIO. The Appstore can be reached at https://officejs.com and includes a collection of productivity apps such as editors or converters. Apps are developed under the premises of privacy and availability meaning users are free to choose their storage, can work offline and synchronize their applications easily.

Source code of Mynij app was built as erp5 Business Template (bt5) and can be found in Nexedi gitlab here: https://lab.nexedi.com/Mynij/erp5/tree/Mynij/bt5/erp5_web_mynij_search. This bt5 is installable in erp5 instance, then it will be possible to export as OfficeJS application.

There is many ways to get an erp5 instance in order to deploy your own Mynij app, these documentation below explain how to process and install a bt5:

Mynij Offline installation

Mynij PWA deployed in OfficeJS store is offline-capable web applications, the first launch will install all required files in the browser (html, css, javascript, etc...) which now provide offline experience, aided by officejs service workers.

Officejs Appstore - Dashboard

To install Mynij, go to https://officejs.com and click on Mynij. You will be redirected to the latest Mynij app version and installation will start immediately.

Mynij App Offline installation

 

Configure the storage by selecting Local is Enough where to store RSS/Sitemap sources and index in the web browser indexeddb. When Mynij will build sitemap, the result will be stored in the storage that has been choosen.

Mynij - Choose your storage

Features of Mynij application

Manage Sitemap/RSS Sources

The app will allow to add index Sources with a title and links to one or more rss/Sitemap. A document is created with portal type Mynij Search Collection and store it in the browser indexeddb for later use. At any moment, it's possible to edit the document, add or remove links.

Clicking on Add or + button will open the form bellow for adding a new source.

Build source index in background

Mynij activities page is used for to display all background tasks, these tasks are index building or Torrent seeding. As they can run from few minutes to many hours or indefinitely for torrent seed, we use RenderJS Service Callback to start them.

RenderJS Service Callback is automatically trigger as soon as the gadget is loaded into the DOM and is cancelled as soon as the gadget is removed from the DOM. This is usefull to control and cancel automatically the job when the page change.

Launch a build will simply add the index in the build queue, which is a FIFO list, all registered index in the queue will be built sequentially. Activities page show the current build progression with current state as well as all finished builds.

When the build is finished, the index state will change to built and a popup notification show up with the number of items added to the browser local storage.

Query and results

The search page (menu Search) allow to make a query and get result, the page contain Mynij logo, a search input and list of indexex for query. The user input a pattern, select an index for query then type enter to see result.

There is two results tabs:

  • Mynij results: it present Mynij search result using flexsearch. 
  • Google results: this tab show search result from searx free metasearch engine.

 

A click on Google tab will show online results.

Import and export RSS/Sitemap Source

Export Sources generate a JSON File containing index definition (title, links). This file can be shared between Mynij users and imported in another Mynij app. It's possible to export a single index or full list of indexes of the app.


 

Exported JSON containing list of sources looks like the content bellow:

[{
    "title": "Nexedi.com",
    "links": "http://softinst126139.host.vifib.net/www.nexedi.com.xml"
}, {
    "title": "TheVerge.com",
    "links": "http://softinst126139.host.vifib.net/www.theverge.com.xml"
}]

Import and export Index

Export Index allow to save the full index into JSON file, this mean export all Flexsearch data, index definition and saved content with or without pages. Exporting index has two variants: export the stringified JSON file, or a compressed version of the file, which is smaller and thus takes less time to download.

The user can decide to export compressed file with JSZip (which can take a bit more time to generate zip file but has a smaller size) or simple file, it's also possible to decide if pages content will be included to the export or not.

Import will take the exported index file and restore full index with or without page content (if was exported without page content). The index to import can be a zipped JSON or a non compressed JSON file, Mynij will automatically detect if uncompression is required while restoring index.

Selenium UI Tests

Selenium test suite integrated to erp5 is used to run automated tests of Mynij app. The UI is tested with random data to ensure that all features are working well and there is no regression during the development. Mynij selenium test bt5 source code can be found here erp5_web_mynij_search_ui_test.

Here is mynij search Zuite result in erp5: