This document provides high level guidance on the application's architecture. This is the more typical high-level architecture information and doesn't go into the code level details that implement the described architecture. For code-level guidance see CODE_ARCHITECTURE.md
Atoll's API should follow a true RESTful API pattern, including the use of HATEOAS.
- The API base path is
/api
. - The version is also included in the path
/api/v{n}
(starting withv1
).
This was done to ensure that logging that includes a URL makes it very obvious what version was used by a client (for example). A modern choice involving the use of headers may support other use-cases but there's no need for those in Atoll at this time. - Base-level collection resources fall into 3 categories:
i) Actions that are more RPC style (these should be the exception- there are none at time of writing) will be named like this/api/v1/actions/do-something
ii) Resources are named as plural nouns separated by dashes if multiple words are involved, for example,/api/v1/work-items
iii) BFF endpoints are named with abff
base path, for example,/api/v1/bff/views/plan
- Item level endpoints are available for the collections, for example,
/api/v1/sprints/{id}
.
These endpoints differ from the collection endpoints by returning more detail than the collection resource itself- logic that may be too expensive to perform when retrieving the full list of items. - Sometimes IDs have "magic values" instead of a specific unique identifier. These magic
values are differentiated by the used of
--
as prefix and suffix.
For example,/api/v1/projects/{id}/sprints/--curr--
and/api/v1/projects/{id}/sprints/--next--
As mentioned in the "Endpoints" section above, the full list will be maintained here:
- Current item is referenced by
--curr--
- Next item is referenced by
--next--
- Previous item is referenced by
--prev--
The API reponses include links and there's an index resource (/api/v1/
) that provides named
links so that a consuming app (or developer) can discover resource links dynamically.
For more information see ARCHITECTURE_HATEOAS.md.
After testing a number of different CSS approaches, "CSS Modules" was chosen for the following reasons:
- It worked well with the various tooling (TSDX, Webpack, Typescript, etc.)
- It kept styling localized with the components (important for bundling and performance loading the app as it grows).
- SSR support worked correctly (in particular "Styled Components" didn't work well when NextJS was used- the Atoll project started off by using NextJS but ran into other problems with it).
The CSS styling framework/tooling candidates that were researched included:
- Separate SASS files.
- Styled Components.
- CSS Modules.
To support theming it was decided that a "home grown" solution would work best.
- The "home grown" approach worked reliably with the "atoll-shared" module approach.
- It also worked well with CSS Modules.
To allow the app to be used on various devices the Atoll project leverages global CSS classes that include:
- "mobile" when a phone is detected.
- "os-*" classes are used to customize the UI for the Electron desktop cient app.