<commit_before>General overview
================

There are three classes of object in Biblionarrator:

Record objects
-------------

The record viewer/editor interface is accessed at [GET] /record/{ID}, and various
formats can be accessed by setting the format={FORMAT} parameter

Other than the default view being the interface, and having a path of /record/,
Record objects behave the same as Administrative objects.

Administrative objects
---------------------

Administrative objects include:

* Collection
* Field
* RecordType
* Style
* SystemSettings - *NOTE*: not yet normalized to use this API
* Template
* User
* UserSettings - *NOTE*: not yet normalized to use this API


Administrative objects are accessed at /resources/{OBJECT}, and have
the following methods:

* [GET] /resources/{OBJECT} (JSON request) - retrieve a JSON listing (suitable
  for direct ingestion by DataTable) of all objects of that type.<commit_msg>Start adding design principles to doc/architecture<commit_after>General overview
================


Design Principles
=================

Biblionarrator has been designed from the beginning to be as simple as
possible, and do only one thing, but do it well. To that end, Biblionarrator
was designed around the concept that there are only two first-order entities:
records, and records and record collections. Besides these, there are a handful
of second-order entities necessary for the business of handling records and
record collections.

Code in Biblionarrator follows -- or at least should follow -- a
model-view-controller pattern. To the extent that it can be generalized,
business logic should be placed in the model layer rather than the controller or
view.


API
===

There are three classes of object that can be accessed in Biblionarrator:

Record objects
-------------

The record viewer/editor interface is accessed at [GET] /record/{ID}, and various
formats can be accessed by setting the format={FORMAT} parameter

Other than the default view being the interface, and having a path of /record/,
Record objects behave the same as Administrative objects.

Administrative objects
---------------------

Administrative objects include:

* Collection
* Field
* RecordType
* Style
* SystemSettings - *NOTE*: not yet normalized to use this API
* Template
* User
* UserSettings - *NOTE*: not yet normalized to use this API


Administrative objects are accessed at /resources/{OBJECT}, and have
the following methods:

* [GET] /resources/{OBJECT} (JSON request) - retrieve a JSON listing (suitable
  for direct ingestion by DataTable) of all objects of that type.
{'fraction_non_alphanumeric': 0.09727028066128413, 'fraction_numerical': 0.0, 'mean_word_length': 4.091976516634051, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4397218', 'n_tokens_mistral': 638, 'n_tokens_neox': 601, 'n_words': 337}