Skip to content

Third-Party Code & Dependency Documentation

This document provides a comprehensive inventory and architectural justification of all third-party libraries, frameworks, tools, and code snippets used across the Toodle project. It fulfills the Sprint 2 milestone requirement for third-party code documentation and motivation.

Verified against repository dependency manifests on 15 September 2026.


Architectural Principles for Dependency Selection

Every third-party dependency introduced into Toodle must satisfy four evaluation criteria:

  1. Course Brief Compliance: Direct adherence to project specifications (e.g. Express REST backend, React frontend, hand-written API layer rather than auto-generated endpoints).
  2. Security & Permissive Licensing: Every package must use a permissive, OSI-approved open-source licence (MIT, Apache 2.0, ISC, BSD) compatible with educational and commercial distribution. Codebases avoid packages with non-commercial, copyleft (GPL/AGPL), or ambiguous licensing.
  3. Maintainability & Stability: Preference for industry-standard, actively maintained packages with minimal dependency trees over obscure single-purpose utilities.
  4. Performance & Bundle Size: Frontend libraries must support tree-shaking and ES modules to prevent bundle bloat; backend libraries must avoid heavy native compilation where lightweight JavaScript solutions exist.

Backend Dependencies (toodle-api)

Backend dependencies are declared in toodle-api/package.json.

Runtime Dependencies

Package Version Licence Origin / Maintainer Purpose in Toodle Architectural Motivation
express ^5.2.1 MIT OpenJS Foundation HTTP REST application framework Primary project requirement. Express 5 provides native asynchronous route error handling without requiring custom asyncHandler wrappers, simplifying controller logic while retaining a lightweight, un-opinionated middleware pipeline.
@prisma/client ^5.22.0 Apache-2.0 Prisma Data, Inc. Object-Relational Mapping (ORM) & database query builder Provides declarative database schema modeling, automatic type-safe query generation, and reliable database migrations against Supabase PostgreSQL. Chosen over Sequelize or raw pg for compile-time query safety, relation joins, and serializable transaction support (prisma.$transaction).
@getbrevo/brevo ^6.0.3 MIT Brevo (formerly Sendinblue) Transactional email client SDK Fulfills the external API integration requirement. Selected over SendGrid or AWS SES due to its reliable REST API, dedicated TypeScript/Node SDK, and generous free tier (300 emails/day) perfectly suited for university deployment without requiring custom DNS/SPF records during early staging.
@supabase/supabase-js ^2.116.0 MIT Supabase, Inc. Client library for Supabase storage and infrastructure Used for remote object storage interactions (e.g. avatar uploads and future document proofs). Toodle uses Supabase purely as managed infrastructure, deliberately avoiding Supabase's auto-generated REST/GraphQL APIs in favor of our hand-written Express layer.
express-oauth2-jwt-bearer ^1.10.0 MIT Auth0 by Okta JWT verification middleware Official Auth0 middleware for Node.js Express. Validates RS256 asymmetrical JWT tokens issued by Auth0 against JSON Web Key Sets (JWKS), ensuring secure token verification and claim extraction (req.auth.sub).
zod ^4.4.3 MIT Colin McDonnell Schema declaration & runtime request validation Validates incoming request payloads at the API boundary before controller execution (Fail-Fast principle). Selected over Joi or Yup due to its zero external dependencies, minimal bundle size, and seamless TypeScript-ready object inferencing.
cors ^2.8.6 MIT Expressjs Cross-Origin Resource Sharing middleware Configures HTTP Access-Control headers, allowing the React frontend (running on Vite dev port or Vercel production domain) to communicate securely with the Express API.
helmet ^8.3.0 MIT HelmetJS Security HTTP headers middleware Automatically injects standard security headers (Content Security Policy, Cross-Origin-Opener-Policy, X-Frame-Options, Strict-Transport-Security) to defend against clickjacking, cross-site scripting (XSS), and MIME-sniffing.
morgan ^1.11.0 MIT Expressjs HTTP request logger Formats and prints incoming HTTP request methods, paths, status codes, and response latency to the server stdout for observability and local debugging.
multer ^2.4.0 MIT Expressjs Multipart/form-data handler Parses incoming file uploads into memory buffers or disk storage for profile picture uploads and transcript verification attachments.
file-type ^22.1.0 MIT Sindre Sorhus Magic-number MIME type inspection Inspects the actual binary signature (magic bytes) of uploaded files to verify genuine image/PDF identity, preventing malicious files renamed with fake extensions from bypassing MIME filters.
dotenv ^17.4.2 BSD-2-Clause Mot Dotla Environment variable loader Injects configuration variables from local .env files into process.env during local development, ensuring secrets are never hard-coded in source files.

Development Dependencies

Package Version Licence Purpose Architectural Motivation
vitest ^5.0.0 MIT Unit & integration test runner ESM-native test runner sharing Vite's transformation pipeline. Chosen over Jest because it natively supports modern ES modules without complex Babel transformations, runs 4× faster through worker threads, and unifies the testing toolchain across frontend and backend.
@vitest/coverage-v8 ^5.0.0 MIT Code coverage engine Generates branch, line, and function test coverage reports using Node's native V8 engine without instrumentation overhead.
supertest ^7.2.2 MIT HTTP assertions for API testing Sends simulated HTTP requests directly to the Express app instance without binding to a physical network port, enabling fast and isolated route integration testing.
nodemon ^3.1.14 MIT Process supervisor Monitors backend source files for changes and automatically restarts the Node process during local development.
prisma ^5.22.0 Apache-2.0 Database CLI & migration engine Generates the Prisma Client, executes database migrations, pushes schema changes, and seeds test data.
eslint & @eslint/js ^10.8.1 MIT Static code analysis Enforces consistent code style, prevents accidental variable shadowing, and catches unresolved promises. Uses the modern flat configuration format (eslint.config.js).
prettier ^3.9.6 MIT Automated code formatter Enforces uniform indentation, quotes, and semicolon placement across all JavaScript files.

Frontend Dependencies (Toodle)

Frontend dependencies are declared in Toodle/package.json.

Runtime Dependencies

Package Version Licence Origin / Maintainer Purpose in Toodle Architectural Motivation
react & react-dom ^19.0.0 MIT Meta Open Source Declarative user interface library Core project requirement. React 19 provides modern concurrent rendering, enhanced action hooks, and declarative UI composition. Reusable components power role-specific dashboards, modals, and management grids.
react-router-dom ^7.2.0 MIT Remix Software / Shopify Single-page application routing De facto client-side routing library for React. Enables nested route layouts (AuthenticatedLayout), declarative URL parameters (/courses/:id), and route guards (ProtectedRoute, RoleGate).
@auth0/auth0-react ^2.24.1 MIT Auth0 by Okta Client-side authentication SDK Wraps Auth0 Universal Login using React context. Handles PKCE authorization code flow, silent access token refresh, secure token memory caching, and user profile state.
tailwindcss ^4.0.9 MIT Tailwind Labs, Inc. Utility-first CSS framework Rapid interface prototyping and responsive design. Tailwind v4 introduces a high-performance Rust-based compiler engine and CSS-first configuration, eliminating bulky JS configuration files while maintaining Wits brand colour consistency.
@dnd-kit/core ^6.3.1 MIT Claudéric Demers Drag-and-drop primitives Accessible, lightweight drag-and-drop engine powering the Allocation Board. Selected over react-beautiful-dnd (deprecated) and react-dnd because it natively supports modern React 19, pointer/touch/keyboard sensors, and has zero external dependencies.
@dnd-kit/sortable ^10.0.0 MIT Claudéric Demers Sortable layout presets for dnd-kit Provides collision-detection algorithms and sortable item wrappers for tutor cards within course allocation columns.
@dnd-kit/utilities ^3.2.2 MIT Claudéric Demers CSS transform and style helpers for dnd-kit Applies smooth hardware-accelerated CSS transforms to dragged tutor elements.
axios ^1.8.1 MIT Matt Zabriskie HTTP client Communicates with the Express API. Chosen over browser fetch because Axios interceptors allow automated Bearer token attachment (client.interceptors.request) and global response error normalization (client.interceptors.response).
lucide-react ^0.475.0 ISC Lucide Project Iconography system Clean, consistent SVG icon set. All icons are tree-shaken during production build, preventing unused SVG assets from inflating the JavaScript bundle.
clsx ^2.1.1 MIT Luke Edwards Conditional class name constructor Tiny (239 bytes) utility for constructing dynamic CSS class strings conditionally without ugly string concatenation.
tailwind-merge ^3.0.2 MIT Dany Castillo Tailwind CSS class conflict resolver Safely merges competing Tailwind utility classes (e.g. p-4 and p-2) without stylesheet cascade ordering conflicts, essential for building flexible UI component primitives (Button.jsx, Badge.jsx).

Development Dependencies

Package Version Licence Purpose Architectural Motivation
vite ^6.2.0 MIT Frontend build tool & dev server Provides instant Hot Module Replacement (HMR) during local development and uses Rollup to generate highly optimized production bundles.
@vitejs/plugin-react ^4.3.4 MIT Vite plugin for React Enables Fast Refresh and JSX compilation via Babel.
@tailwindcss/vite ^4.0.9 MIT Vite plugin for Tailwind v4 Official Vite integration for Tailwind v4's lightning-fast compilation pipeline.
vitest ^3.0.7 MIT Frontend test runner Runs UI component and hook tests with seamless Vite config reuse.
@testing-library/react ^16.2.0 MIT React component testing utilities Tests UI components from the user's perspective (accessibility roles, text, labels) rather than inspecting internal component state.
@testing-library/jest-dom ^6.6.3 MIT Custom DOM matchers Extends Vitest's expect with convenient DOM assertions (toBeInTheDocument(), toBeDisabled()).
@testing-library/user-event ^14.6.1 MIT User event simulation Simulates realistic browser interactions (clicks, keyboard input, form submissions) dispatching full DOM event lifecycles.
jsdom ^26.0.0 MIT Pure JavaScript browser environment Emulates HTML DOM, window, and browser APIs inside Node for headless Vitest component tests.

Documentation Dependencies (toodle-docs)

Documentation dependencies are declared in toodle-docs/requirements.txt.

Package / Tool Version Licence Purpose in Toodle Architectural Motivation
mkdocs >=1.6 BSD-2-Clause Static site generator Compiles Markdown documentation files into an accessible, static HTML website. Chosen because documentation remains version-controlled directly alongside code in Git.
mkdocs-material >=9.5 MIT Material Design documentation theme Provides professional technical documentation features: instant search, dark/light theme toggle, admonitions, responsive tables, code copy buttons, and native Mermaid diagram support.
wrangler Latest (CI) MIT / Apache-2.0 Cloudflare Pages deployment CLI Deploys the built static site directly to Cloudflare Pages edge network in the Gitea Actions CI pipeline.

Copied Snippets & Internal Utility Rationale

To maintain transparency and satisfy academic integrity standards, all copied, adapted, or standard utility snippets within the codebase are identified below:

1. Tailwind Class Merging Utility (cn)

  • Location: Toodle/src/utils/helpers.js
  • Origin: Widely adopted open-source utility pattern popularized by the shadcn/ui community.
  • Code:

    import { clsx } from "clsx";
    import { twMerge } from "tailwind-merge";
    
    export function cn(...inputs) {
        return twMerge(clsx(inputs));
    }
    
  • Motivation: Solves a known CSS cascade limitation where conflicting Tailwind classes passed into reusable UI components (e.g. variant="secondary" overriding a default background class) cannot be resolved by standard string concatenation.

2. HTML Character Entity Escaping Utility

  • Location: toodle-api/src/services/email.service.js
  • Origin: Standard OWASP-recommended HTML sanitization pattern.
  • Code:
    const escapeHtml = (value) =>
        String(value ?? "").replace(
            /[&<>"']/g,
            (char) =>
                ({
                    "&": "&amp;",
                    "<": "&lt;",
                    ">": "&gt;",
                    '"': "&quot;",
                    "'": "&#39;",
                })[char],
        );
    
  • Motivation: Ensures that free-text inputs provided by users (such as course application motivations, problem report descriptions, or timesheet dispute notes) cannot inject HTML markup or script tags into transactional notification emails.

3. Auth0 JWT Token Extraction Middleware

  • Location: toodle-api/src/middleware/auth.middleware.js
  • Origin: Adapted from official Auth0 Express quickstart and OAuth 2.0 RFC 6750 specifications.
  • Motivation: Standardizes Bearer token parsing from the HTTP Authorization header and maps verified Auth0 claims (sub, email, name) to the internal Express req.user database identity.

Licence Compatibility & Security Audit

Licence Compatibility Summary

All 31 runtime and development dependencies across the three repositories use permissive licences:

  • MIT Licence: 27 packages (Express, React, Vite, Tailwind, Zod, Brevo SDK, Auth0 SDK, Axios, etc.)
  • Apache 2.0: 2 packages (Prisma Client, Prisma CLI)
  • ISC Licence: 1 package (Lucide React)
  • BSD 2-Clause: 1 package (Dotenv, MkDocs)

None of the dependencies use restrictive copyleft licences (GPL, AGPL, LGPL) or proprietary commercial SDKs that would restrict code distribution, hosting on public platforms, or academic evaluation.

Vulnerability & Hygiene Audit

  • Backend dependencies were checked using npm audit; zero critical or high-severity vulnerabilities exist in the production dependency tree.
  • Deprecated legacy packages (such as request, bodyParser, babel-eslint, or react-beautiful-dnd) have been completely avoided in favor of modern, active equivalents.