SYSTEM DESIGN

SYSTEM ARCHITECTURE DIAGRAM


About the system we have a frontend authentication powered by next.js and Keycolak, which is used to connect key of the access of the middleware for authentication services. The entire system is containerised via Docker. And the Keycloak is used as the identity and access management tool, with a single instance hosted alongside the web-app. NextAuth.js facilitates interaction between the web-app and the Keycloak OpenID Connect interface. In addition, various API routes internally use the Keycloak Admin REST API to interact with Keycloak when certain actions are performed.


ENTITY RELATIONSHIP DIAGRAM (ERD)


For the backend, we use the Postgres database that uses Prisma for the object relational mapping. We also use Prisma to interact with the Postgres via the backend to the website.

For the backend, we use the Postgres database that use prisma to owe the object relational mapping. We also use Prisma to interact with the Postgres via the backend to the website. The system contains 2 PostgreSQL databases, both within a single dockerised PostgreSQL instance: care_quality_dashboard and keycloak.
The keycloak database is entirely managed by Keycloak in the Keycloak Docker Container.
The care_quality_dashboard database is the system's own database storing information such as responses, questions, departments, hospitals, etc. An ER-UML diagram is below:


As the UML diagrams shows, the backend can be split out of three layers, the bottom layer which kind of has semi on layers on each of them. The middle layer has the tracklist of the backend. And the top one has major details of user data. Each kind of dashboards on the top is like is like 3 parts of the dashboard. Each layer is almost independent of each of them and only got 1 or 2 connecting tables.

PACKAGES AND APIs USED


The system's backend consists primarily of Next.js API routes to create a REST API that is consumed by the React-based frontend. The REST API documentation exists in the form of an OpenAPI 3 (Swagger) specification. Consequently, the system is interact with Keycloak via the Keycloak Admin REST API -- all actions that can be performed through the Keycloak Admin Console can also be performed through this Admin REST API. The Keycloak Admin REST API was only ever be used when running code on the server-side on API routes. The admin credentials are required to generate an admin access token for use in the Admin REST API requests.

SITEMAPS


The Sitemap slides below show how our frontend is organised and how users can navigate through our website. The category is dependent on what user type is currently accessing the website. Different users have different pages, which they can access.
1 / 5

2 / 5

3 / 5

4 / 5

5 / 5