Annotation Database Website
Background
The annotation database Website runs on a Django (Python) backend with a Vue 3 (JavaScript, CSS, HTML) frontend.
Django
The backend runs on Django with some small modifications to the structure.
Configuration
Rather than a single settings file (the default), the server uses one of four configuration files stored in the settings
folder, each of which inherits from a base file called base.py
, which provides configurations common to all other configurations. The four configurations are:
prod.py
-- The production database configuration.stage.py
-- The staging site configuration.dev.py
-- A configuration for use on development machines.test.py
-- A configuration for use by the unit testing framework.
The base file contains two custom functions:
load_config
-- loads database configuration files, as described on the Annotation Database page: each site uses a different database with unique credentials.init_dirs
-- creates directories necessary to the operation of the server and logs any failures.
TODO: More.
Vue 3
TODO: Add this.
Model Framework
The Model
framework is a JavaScript library that provides persistable client-side representations of Django models. The framework manages the object graph so that when an instance is loaded from the server, it is looked up in the graph by its ID. If it exists, the existing instance is updated and duplication is avoided.
The Model
class has three main configuration features available to subclasses:
- path generation -- a function or variable that provides one or more ReST paths for managing object state.
- property declaration -- an Object that provides property names and default values.
- class map -- an Object that provides a mapping between property names and class names of properties that inherit from
Model
.
TODO: More.