... | ... | @@ -13,15 +13,14 @@ new feature/fix branch -> Pull Request -> Peer Review -> merge into develop -> m |
|
|
So basically pep8 with some additions and a few lifted restrictions, notably
|
|
|
> Each line of text in your code should be at most 100 characters long.
|
|
|
|
|
|
|
|
|
## 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.
|
|
|
The JS code is located in `front/`, it's built by npm + webpack.
|
|
|
|
|
|
## 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.
|
|
|
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:
|
... | ... | @@ -40,7 +39,7 @@ Doesn't contain any models, it only defines `django-rest-framework` endpoints fo |
|
|
__3) imports__
|
|
|
Historicaly Missleading name, it deals with both importing and exporting data.
|
|
|
|
|
|
__4) helper apps: versioning, users, bootstrap, reporting__
|
|
|
__4) helper apps: versioning, users, bootstrap, reporting
|
|
|
* versioning defines an abstract model to keep the history of a model instance
|
|
|
* users stores everything related to users but unrelated to the business logic;
|
|
|
* bootstrap is just a display layer to automate generating bootstrap css frontend forms.
|
... | ... | @@ -50,17 +49,17 @@ __4) helper apps: versioning, users, bootstrap, reporting__ |
|
|
> Not only does it protects against circular imports but it's also good design to have your data flow one way only.
|
|
|
|
|
|
## 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.
|
|
|
The front-end code is mostly vanilla JS and some jQuery, except the edition UI which is done in vue.js.
|
|
|
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 leveraging the rest api with vue.js.
|
|
|
More info on the largest blocks:
|
|
|
|
|
|
__1) edition panels__
|
|
|
The edition UI relies mostly on JS because it is complex and interconnected.
|
|
|
There are for now 3(4) panels:
|
|
|
There are for now 4 panels:
|
|
|
* source, that only displays the image (later on it will be the location of images annotations)
|
|
|
* segmentation
|
|
|
* visual transcription
|
|
|
* (WIP) diplomatic transcription
|
|
|
* text transcription
|
|
|
|
|
|
__2) wheelzoom__
|
|
|
Somewhat independent library to deal with parallel zooming in standard DOM, SVG and CANVAS.
|
... | ... | @@ -68,8 +67,7 @@ This breaks often.. |
|
|
|
|
|
__3) 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/.
|
|
|
It is pretty much still under development and hopefully at some point will have it's own repository.
|
|
|
|
|
|
__4) external libraries__
|
|
|
They are listed in `front/src/vendor.js` and `front/package.json` as npm dependencies:
|
... | ... | @@ -78,6 +76,7 @@ They are listed in `front/src/vendor.js` and `front/package.json` as npm depende |
|
|
* dropzone
|
|
|
* moment
|
|
|
* paper.js
|
|
|
* vue.js
|
|
|
|
|
|
|
|
|
## Working with an asynchronous task queue: celery
|
... | ... | |