A system is needed for a private education business to perform some administrative functions, where administrators can keep track of teachers and their classes.
Your task is to develop a fullstack application to help the administrators. The screens and API are detailed under Tasks below. For the purposes of this exercise, you do not need to implement login and access control.
When you have completed your assignment, please submit a link to your code repository to the relevant contact person(s).
If you have any queries, feel free to get in touch with the relevant contact person(s).
- Your code should be uploaded to publically accessible Github (or other similar service) repo.
- (Optional) Deploy your web application and API to a publicly accessible hosting environment.
- Your code repository should contain a
README.mdthat includes the following:- Clear instructions to run a working local instance of your web application and API server for testing and evaluation
- Assumptions made should be documented clearly
- Link(s) to the hosted web application and API (if applicable)
- (Optional) Inputs/suggestions on the API design
- Use a single language (only TypeScript or JavaScript are allowed) across both frontend and backend.
- Use NodeJS for the backend runtime environment.
- Use the React library for the frontend.
- Using a rdbms is highly reccomended. You may use PostgreSQL, MySQL, or MariaDB.
- Utilising 3rd party libraries (e.g. Ant Design or Material UI) is allowed.
- The implementation of the frontend screens does not have to be pixel perfect with the provided Figma designs. Nonetheless, your application should have the same user flows and input controls.
- (Optional) Include unit tests.
- We will assess your submission holistically (i.e. not just in terms of functionality), including factors such as:
- Readability and code cleanliness
- Secure coding practices
- Code structure/design, e.g. modularity, testability
- Your API may be subjected to automated test tools, so please adhere closely to the given specs.
- (Optional) You can provide a Postman collection for the APIs that you've implemented, but we might still use our own tools as well to test your APIs.
- (Optional) You can provide a Postman collection for the APIs that you've implemented, but we might still use our own tools as well to test your APIs.
Design: Figma Screen
API
- Endpoint:
POST /api/teachers - Headers:
Content-Type: application/json - Success response status: HTTP 201
- Request body example:
{
"name": "Mary",
"subject": "Mathematics",
"email": "teachermary@gmail.com",
"contactNumber": "68129414"
}
Design: Figma Screen
API
- Endpoint:
GET /api/teachers - Success response status: HTTP 200
- Success response body :
{
"data" :
[
{
"name": "Mary",
"subject": "Mathematics",
"email": "teachermary@gmail.com",
"contactNumber": "68129414"
},
{
"name": "Ken",
"subject": "Mother Tongue Language",
"email": "teacherken@gmail.com",
"contactNumber": "61824191"
}
]
}
A teacher can only be the form teacher of one class.
Design: Figma Screen
API
- To add a class
- Endpoint:
POST /api/classes - Headers:
Content-Type: application/json - Success response status: HTTP 201
- Request body example:
- Endpoint:
{
"level": "Primary 1",
"name": "Class 1A"
"teacherEmail": "teachermary@gmail.com"
}
Design: Figma Screen
API
- Endpoint:
GET /api/classes - Success response status: HTTP 200
- Success response body :
{
"data" :
[
{
"level": "Primary 1",
"name": "Class 1A",
"formTeacher": {
"name": "Mary"
}
},
{
"level": "Primary 2",
"name": "Class 2B",
"formTeacher": {
"name": "Ken"
}
}
]
}
For all the above API endpoints, error responses should:
- have an appropriate HTTP response code (e.g. 400)
- have a JSON response body containing a meaningful error message in the following format:
{ "error": "Some meaningful error message" }