SKOLE-DIRY — Digital Diary Module
Module ID:SKOLE-DIRY | Version: 1.0 | Status: ActiveProducts: Parent App (read/status update) · Teacher App (create/manage) · Web App (view)
1. Overview
Scope In
- Teachers: Create, edit, delete diary entries (homework, classwork, notes, reminders)
- Parents: View diary entries for their child, mark as completed
- Filtering by grade, student, diary type, status
Scope Out
- File upload (attachment_url stored but upload handled externally)
- Student self-service diary access
2. Requirements
Functional Requirements (FR)
What the module must DO — actions, behaviors, and outcomes.- SKOLE-DIRY-FR001: The module shall allow teachers to create diary entries with title, description, grade, type (homework, classwork, note, reminder), due date, priority, and optional attachment URLs.
- SKOLE-DIRY-FR002: The module shall allow targeting diary entries to either an entire grade or a specific student.
- SKOLE-DIRY-FR003: The module shall enable teachers to update and soft-delete diary entries.
- SKOLE-DIRY-FR004: The module shall allows parents to view all relevant diary entries for their child’s grade or student ID.
- SKOLE-DIRY-FR005: The module shall allow parents to mark a diary entry as ‘completed’ for their child.
- SKOLE-DIRY-FR006: The module shall support priority levels: low, medium, and high.
- SKOLE-DIRY-FR007: The module shall allows web admins to view all diary activities across the school.
Non-Functional Requirements (NFR)
How well the module must do it — performance, security, and reliability.- SKOLE-DIRY-NFR001: The module shall behave reliably by ensuring soft-deleted entries (
deleted_status = 1) never appear in consumer API responses. - SKOLE-DIRY-NFR002: The module shall perform visual highlighting for overdue pending tasks in the parent application.
- SKOLE-DIRY-NFR003: The module shall ensure that diary entries are delivered to parents with minimal latency after being published by a teacher.
Constraints
Rules and boundaries — tech choices and platform restrictions.- C001: We must implement soft-deletion using a
deleted_statusflag because the platform architecture avoids permanent data removal for audit purposes. - C002: We must use external file storage for attachments as the platform does not currently host raw binary assets for diary entries.
3. Sub-modules / Backlog
4. Logical Implementation
Entry Lifecycle State Machine
Teacher Create Flow
Parent View Flow
Parent Status Update Flow
Error Handling
5. UI Requirements
Parent App — DiaryScreen
Components:
UI States:
- Loading: 3 skeleton cards
- Empty: “No diary entries for this period”
- Error: Toast + retry button
Teacher App — DiaryScreen
Additional Components:
Web App — Diary Page
6. Conditional Expressions
7. Internal Module Connections
8. External Connections
9. Database Tables
digital_diary Schema
10. API Endpoints Summary
- Default sort: by due_date ascending
PARENT-01: List Child’s Diary Entries
Section 1: Endpoint Summary
Returns all diary entries visible to parent for their child, including homework, classwork notes, and reminders. Filters by priority, type, and status.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/parent-app/digital-diary - Authentication: JWT Bearer Token (Parent)
- Rate Limit: 100 requests per minute
Section 4: Query Parameters
Section 6: Response Schema (Success - 200)
Section 7: Error Responses
401 - UnauthorizedSection 8: Implementation Examples
JavaScript:Section 9: Database Context
Tables:- digital_diary (primary)
- students (join for access control)
Section 10: Business Logic & Validations
Filtering:- Automatically hides deleted entries (deleted_status = 1)
- Scopes to parent’s school and child’s grade
- Respects privacy: parents see only entries for their child’s grade/student
- Default sort: by due_date ascending
Section 11: Related Endpoints
- GET
/parent-app/digital-diary/:id- Single entry detail - PUT
/parent-app/digital-diary/:id- Mark completed - POST
/parent-app/digital-diary/:id/attachments- Upload file
Section 12: Response Summary Table
PARENT-02: Get Diary Entry Detail
Section 1: Endpoint Summary
Fetch complete details of a single diary entry including full description, attachments, and completion status.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/parent-app/digital-diary/:id - Authentication: JWT (Parent)
Section 3: Path Parameters
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
PARENT-03: Mark Entry Completed
Section 1: Endpoint Summary
Parent marks a diary entry as completed for their child, updating status to reflect completion.Section 2: HTTP Details
- HTTP Method: PUT
- Endpoint URL:
/parent-app/digital-diary/:id - Authentication: JWT (Parent)
Section 5: Request Body Schema
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
PARENT-04: Upload Attachment
Section 1: Endpoint Summary
Allows parents to attach files (completion proof, photos) to diary entries.Section 2: HTTP Details
- HTTP Method: POST
- Endpoint URL:
/parent-app/digital-diary/:id/attachments - Content-Type:
multipart/form-data - Authentication: JWT (Parent)
Section 5: Request Body Schema
Section 6: Response Schema (Success - 201)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
TEACH-01: List Teacher’s Diary Entries
Section 1: Endpoint Summary
Teacher views all diary entries they created with filtering by type, priority, date.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/teachers-app/digital-diary - Authentication: JWT (Staff)
Section 4: Query Parameters
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
TEACH-02: Get Entry Detail
Section 1: Endpoint Summary
Fetch complete entry details for viewing/editing.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/teachers-app/digital-diary/:id - Authentication: JWT (Staff)
Section 6: Response Schema (Success - 200)
Section 12: Response Summary Table
TEACH-03: Create Diary Entry
Section 1: Endpoint Summary
Teacher creates new diary entry (homework, classwork, note, reminder) for grade or specific student.Section 2: HTTP Details
- HTTP Method: POST
- Endpoint URL:
/teachers-app/digital-diary - Authentication: JWT (Staff)
Section 5: Request Body Schema
Section 6: Response Schema (Success - 201)
Section 7: Error Responses
400 - Invalid TypeSection 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
TEACH-04: Update Entry
Section 1: Endpoint Summary
Teacher updates diary entry contents, deadline, or priority.Section 2: HTTP Details
- HTTP Method: PUT
- Endpoint URL:
/teachers-app/digital-diary/:id - Authentication: JWT (Staff)
Section 5: Request Body Schema
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
TEACH-05: Delete Entry
Section 1: Endpoint Summary
Teacher soft-deletes a diary entry (hidden from parents but retained in database for audit).Section 2: HTTP Details
- HTTP Method: DELETE
- Endpoint URL:
/teachers-app/digital-diary/:id - Authentication: JWT (Staff)
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 9: Database Context
Setsdeleted_status = 1, entry hidden from all consumer APIs
Section 12: Response Summary Table
ADMIN-01: List All Entries (Web App)
Section 1: Endpoint Summary
Admin views all diary entries across school with global filters.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/web-app/digital-diary - Authentication: JWT (Admin)
Section 4: Query Parameters
Section 6: Response Schema (Success - 200)
Section 12: Response Summary Table
ADMIN-02: Get Entry Detail (Web App)
Section 1: Endpoint Summary
Admin views complete diary entry details including creator and target audience.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/web-app/digital-diary/:id - Authentication: JWT (Admin)
Section 12: Response Summary Table
ADMIN-03: Create Entry (Web App)
Section 1: Endpoint Summary
Admin creates diary entries on behalf of staff (for system announcements or corrections).Section 2: HTTP Details
- HTTP Method: POST
- Endpoint URL:
/web-app/digital-diary - Authentication: JWT (Admin)