✓ Kizspy. meh/login for generating the JWT.
/api/apartments and /api/apartments/:id for all methods related to apartments.
Implement CRUD actions with apartment collection.
For the DELETE operation, ensure an apartment cannot be deleted if any residents are associated with it (i.e., if
there are documents in the resident collection referencing the apartment's id). Return an appropriate error
message (e.g., "Cannot delete apartment because it has associated residents") if deletion is attempted in such
cases.
Task 03 (4.0 marks). Client application for resident management
Student must choose one of template engines (EJS, HANDLEBARS, or PUG) with Express for building the views.
1. Authentication function
At the login view, the route path will match requests to: auth/signin. Users must enter their account name (us)
and password (pw) correctly (encrypted with bcrypt and stored in the 'accounts' collection). All CRUD actions
require authentication. Display error messages for failed logins. Store account data in the 'accounts' collection from
'account.json'. Redirect to the residents view after a successful login.
Zoom
2. After successful login, display a list of all residents (using a card view, not a table view) including the apartment
name. This route path will match requests to /view/residents.
3. After successful login, allow deletion of a selected resident by confirming the action and notifying the result. This
route path will match requests to /view/residents/:id.
4. After successful login, add a new resident that meets the requirements using a modal form.
All fields are required.
+100%
Close