Skip to content

Commit

Permalink
update API and Actions list
Browse files Browse the repository at this point in the history
  • Loading branch information
panaC committed Sep 8, 2023
1 parent e66e9fe commit 05a2b39
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 2 deletions.
105 changes: 103 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ each part run a model-controler and a view for renderer process
- the controller is a middleware from Redux named [Redux-saga](https://redux-saga.js.org/). It's handle all side effect and application behaviour.
- the view for the rendering is React with [class components](https://legacy.reactjs.org/docs/components-and-props.html)

To linked all 3 parts we used :
To linked all 3 parts we used :
- IPC/RPC: we used implementation from [Electron](https://www.electronjs.org/docs/latest/api/ipc-main)
- React/Redux: We used [connect](https://react-redux.js.org/api/connect) from [react-redux](https://react-redux.js.org/).

Expand All @@ -116,4 +116,105 @@ To linked all 3 parts we used :
#### [Model View Controller Architecture](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller)
![MVC](img/thorium-mvc.png)

![architecture diagram](img/thorium-architecture.png)
![architecture diagram](img/thorium-architecture.png)


### API Concept

To have a type POST request from a renderer process to the main process we used the notion of API.
It's not an http API but an RPC encapsuled to redux/redux-saga logic with Action and Reducer.

This is a diagram of the communication:

![api](img/thorium-api.png)

Src:
- src/main/redux/sagas/api/api.ts
- src/common/redux/actions/api/index.ts
- src/renderer/common/redux/reducers/api.ts

At the moment there are 17 API endpoints from (src/main/redux/sagas/api) :

library:
- apiapp:
- apiapp/search : search a library from apiapp protocol
- browser:
- httpbrowser/browse : browse and parse an opds URL
- opds:
- opds/getFeed : get an opdsFeed with is identifier
- opds/findAllFeed: get all opdsFeed saved
- opds/deleteFeed: delete an opdsFeed with is identifier
- opds/addFeed: add an opdsFeed
- opds/getUrlWithSearchLinks: get the search URL from an opdsFeed
- publication: (src/common/api/interface/publicationApi.interface.ts)
- publication/get: get a publicationView from id
- publication/delete: delete a publicationView from id
- publication/findAll: get all publicationView
- publication/findByTag: get all publicationView from a specific tag string
- publication/updateTags: update tags list from a publication
- publication/importFromLink: import a publication from an URL
- publication/importFromFs: import a publication from a fileSystem path
- publication/search: search publication from a query text
- publication/searchEqTitrle: search publication by title matching
- publication/exportPublication: export publication to the fileSystem


### ACTION-REDUCER

From main-process to renderer-process or from renderer-process to main-process.

List of all Actions in place (src/common/redux/actions) :

- auth: opds authentication
- cancel
- done
- wipeData
- catalog
- getCatalog: ask to rehydrate catalogView in libraryState
- setCatalogView: response from getCatalog
- setTagView: rehydrate tagStringView in libraryState
- dialog: modal dialog view in library,reader
- closeRequest
- openRequest
- updateRequest
- download: download queue in library
- abort
- done
- progress
- history: history opds feed
- pushFeed
- refresh
- i18n
- setLocale
- import
- verify: import verification process
- keyboard: keyboard shortcut
- reloadShortcut
- setShortcut
- showShortcut
- lcp
- renewPublication
- returnPublication
- unlockPublicationWithPassphrase
- userKeyCheckRequest
- load: main proceess busy or not
- busy
- iddle
- net (not used)
- reader
- attachMode
- clipboardCopy
- closeRequest
- closeRequestFromPublication
- configSetDefault
- detachModeRequest
- detachModeSuccess
- fullScreenRequest
- openRequest
- openError
- setReduxState: trigger app persistence
- session: saved session
- enable
- toast: toast notification library,reader
- close
- open
Binary file added img/thorium-api.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 05a2b39

Please sign in to comment.