... | ... | @@ -12,24 +12,24 @@ new feature/fix branch -> Pull Request -> Peer Review -> merge into develop -> t |
|
|
* [cia python guidelines](https://wikileaks.org/ciav7p1/cms/page_26607631.html)
|
|
|
Note: considering using black for more code homogeneity
|
|
|
|
|
|
## General organisation
|
|
|
## General organization
|
|
|
eScriptorium follows Docker & Django good practices as much as possible.
|
|
|
The root directory is the docker-compose root. The `app/` directory is the Django root.
|
|
|
All templates can be found in the project folder `app/escriptorium/templates/`.
|
|
|
Some statics can be found in the project folder; others, when closely related to an app can be found in their respective directory.
|
|
|
|
|
|
## Backend apps
|
|
|
## Back-end apps
|
|
|
They lie in app/apps/, they can be imported directly from anywhere because apps/ is added to the python PATH in settings.py.
|
|
|
|
|
|
__1) core__
|
|
|
It is the main application, it contains most models and business logic. The main models are:
|
|
|
* `Document`, which represents a working directory (for the user it could be a single doc, a related ensemble, an entire corpus..).
|
|
|
* `DocumentPart` represents an image which is usualy the scan of a page or a double page.
|
|
|
* `DocumentPart` represents an image which is usually the scan of a page or a double page.
|
|
|
* `Block` and `Line` contains segmentation data.
|
|
|
* A `Transcription` is one representation of the text. It is unbound from the segmentation.
|
|
|
Which means one DocumentPart can only have one segmentation but many transcriptions.
|
|
|
* `LineTranscription` makes the link between the segmentation and the content.
|
|
|
It is also versionned to keep an history of modifications.
|
|
|
It is also versioned to keep an history of modifications.
|
|
|
* `OcrModel` stores segmentation & recognition models.
|
|
|
|
|
|
__2) api__
|
... | ... | @@ -46,9 +46,9 @@ __4) helper apps: versioning, users, bootstrap__ |
|
|
> _Warning_: It is very important to import one way only, from the more general app to the more specific app (to the business model).
|
|
|
> Not only does it protects against circular imports but it's also good design to have your data flow one way only.
|
|
|
|
|
|
## Frontend apps
|
|
|
The frontend code is mostly vanilla JS and some JQuery, we are considering using vue.js, but since we are mostly backend devs we didn't jump in yet.
|
|
|
We try to be "javascript lazy", meaning we try to use as little ajax as possible (because it's a lot harder to maintain), but sometimes the UI cost is too great, a good example of this is the edition UI which is almost entirely JS.
|
|
|
## Front-end apps
|
|
|
The front-end code is mostly vanilla JS and some jQuery, we are considering using vue.js, but since we are mostly backend devs we didn't jump in yet.
|
|
|
We try to be "javascript lazy", meaning we try to use as little ajax as possible (because it's a lot harder to maintain), but sometimes the UI cost is too great, a good example of this is the edition UI which is almost entirely asynchronous JS.
|
|
|
More info on the largest blocks:
|
|
|
|
|
|
__1) edition panels__
|
... | ... | @@ -60,15 +60,15 @@ There are for now 3(4) panels: |
|
|
* (WIP) diplomatic transcription
|
|
|
|
|
|
__2) wheelzoom__
|
|
|
Somewhat independant library to deal with parallel zooming in standard DOM, SVG and CANVAS.
|
|
|
Somewhat independent library to deal with parallel zooming in standard DOM, SVG and CANVAS.
|
|
|
This breaks often..
|
|
|
|
|
|
__3) baseline editor__
|
|
|
Also an independant library whose goal is to allow the creation and correction of baselines and polygons over an image.
|
|
|
It is pretty much still under developement and hopefully at some point will have it's own repository.
|
|
|
A standalone version (not integrated into panels) is available at /baseline-editor/.
|
|
|
Also an independent library whose goal is to allow the creation and correction of baselines and polygons over an image.
|
|
|
It is pretty much still under development and hopefully at some point will have it's own repository.
|
|
|
A standalone version (not integrated into panels/db) is available at /baseline-editor/.
|
|
|
|
|
|
__4) external librairies__
|
|
|
__4) external libraries__
|
|
|
They are located in `app/escriptorium/static/vendor/`
|
|
|
* jQuery (mostly for the modal we are trying to avoid using it as much as possible)
|
|
|
* bootstrap + fontawesome(free)
|
... | ... | @@ -78,10 +78,11 @@ They are located in `app/escriptorium/static/vendor/` |
|
|
|
|
|
|
|
|
## Working with an asynchronous task queue: celery
|
|
|
[...] (some tuto somewhere?)
|
|
|
Preview: https://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
|
|
|
|
|
|
|
|
|
## The channel server (daphne) and working with websockets
|
|
|
[...] (some tuto somewhere?)
|
|
|
Preview: https://channels.readthedocs.io/en/latest/
|
|
|
|
|
|
## statics and medias
|
|
|
[...]
|
... | ... | |