-
Notifications
You must be signed in to change notification settings - Fork 29
Shiksha Backend Design
Shiksha includes modular frontends, which can be integrated with an existing backend using adapters.
The Shiksha backend is a suite of REST APIs implemented using nodejs. The backend APIs conform to the schemas defined as part of the Shiksha Ecosystem. While the request and response of the APIs is pre-defined, deployers can use "adapters" to connect these APIs to their existing data sources which may be either databases or another application that provides APIs.
The image below demonstrates how an adopter may write an attendance adapter.
The Shiksha backend will not provide any authentication. Instead, deployers implement an OpenID compliant authentication service, which will be used by the frontend. Once the user is logged into the frontend, the token received from the authentication service is passed to all the middleware API requests. The middleware passes on the token to the adapter, which can further pass it on to the backend for validation.
Shiksha does not have any database of its own for the APIs. Instead, the Shiksha APIs are just stubs, and deployers are expected to implement adapters that will fetch data from the deployer's backend and transform it to the data models defined in Shiksha.
The below is the folder structure for a module and
/student
/student/controller.ts (has all the routes for student)
/student/dto/student.dto.ts (The DTO / model for the student entity)
..
..
/adapters/
/adapters/default
/adapters/default/student.adapter.ts (This adapter implements the methods used in the controller routes)
/adapters/default/teacher.adapter.ts
/adapters/default/attendance.adapter.ts