Skip to content

Architecture

George C. G. Barbosa edited this page Apr 12, 2021 · 3 revisions

To illustrate TNRSweb architecture we can look at the folders inside the root directory of this repository:

.
├── actions
├── CHANGELOG.md
├── components
├── constants
├── next.config.js
├── package.json
├── package-lock.json
├── pages
├── public
└── README.md

Actions

The actions folder is where we store the functions that should or could be accessed by multiple components. At the time we wrote this documentation, those are the files inside actions

.
├── api-requests
│   ├── request-citations.js
│   ├── request-collaborators.js
│   ├── request-family-classifications.js
│   ├── request-parse-names.js
│   ├── request-resolve-names.js
│   ├── request-sources.js
│   └── request-tnrs-version.js
├── index.js
├── round-score.js
├── sort-by-column.js
├── table-sort.js
└── warnings.js

Every action must be registered in the file index.js We keep the API requests inside the folder api-requests. If you need to fetch data from the API, first make sure the function you need does not exist.

Components

Components are parts of the TNRSweb application. They are usually composable. Smaller components can be aggregated to assemble bigger components. For example, the layout component is formed by top-bar + footer.

Similar to the actions, the components must be registered in the file index.js.

.
├── best-match-settings
├── download-results
├── download-settings
├── footer
├── index.js
├── layout
├── match-threshold
├── options-box
├── parse-table
├── resolve-table
├── search-box
├── table-pagination-actions
└── top-bar

Other files/folders

public

We keep files that should be accessed via HTTP request, like images, videos, and documents inside the public folder.

next.config.js

The file next.config.js is used to configure the application. System-wide configurations, such as the API address are kept in this file.

constants

The folder constants should house configurations that affect the system's appearance. At the time we wrote this documentation it only contains the theme file, where we can change the website colors.

Clone this wiki locally