# compsci-adl/mycoursereviews architecture

> Architecture diagram of the GitHub repository compsci-adl/mycoursereviews, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/compsci-adl/mycoursereviews
- Repository: https://github.com/compsci-adl/mycoursereviews

## Overview

MyCourseReviews is a course-review website for Adelaide University Computer Science Club students. The main workflow is browsing the course catalog, opening a course, and submitting a review; users can also discuss reviews and manage their contributions. Separate branches support course-update voting and administrator moderation. The source index and excerpts show the main route, action, authentication, and persistence boundaries; unsampled components are included only where the index identifies their role, and edges are limited to documented or indexed references.

Main entry points: [`src/app/actions/reviews.ts`](https://github.com/compsci-adl/mycoursereviews/blob/main/src/app/actions/reviews.ts) (Review and comment actions), [`src/auth.ts`](https://github.com/compsci-adl/mycoursereviews/blob/main/src/auth.ts) (Authentication), [`src/db/index.ts`](https://github.com/compsci-adl/mycoursereviews/blob/main/src/db/index.ts) (Database connection), [`src/components/course/CourseDetailClient.tsx`](https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/course/CourseDetailClient.tsx) (Course detail)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Course discovery"]
  node_browse_route["Course browse route<br/>[page.tsx]"]
  node_browse_ui["Browse courses"]
  node_course_card["Course card<br/>[CourseCard.tsx]"]
  node_course_catalog["Course catalog access<br/>[courses-db.ts]"]
  node_catalog_store[("Course data store")]
  node_course_api["Course information API"]
  node_course_route["Course detail route<br/>[page.tsx]"]
  node_course_detail["Course detail"]
end

subgraph group_community["Reviews and discussion"]
  node_review_modal["Review submission<br/>[ReviewModal.tsx]"]
  node_review_actions["Review and comment actions<br/>[reviews.ts]"]
  node_review_feed["Review discussion feed<br/>[ReviewFeedCard.tsx]"]
  node_comment_thread["Comment thread<br/>[CommentThread.tsx]"]
  node_my_reviews_route["My reviews route<br/>[page.tsx]"]
  node_my_reviews["My contributions"]
  node_edit_review["Edit review"]
  node_content_checks["Review content checks<br/>[spam.ts]"]
  node_profanity_check["Profanity checks<br/>[profanity.ts]"]
end

subgraph group_identity["Identity and persistence"]
  node_auth["Authentication<br/>[auth.ts]"]
  node_auth_route["Auth route<br/>[route.ts]"]
  node_keycloak["Keycloak"]
  node_db_connection["Database connection<br/>[index.ts]"]
  node_schema["Application data schema<br/>[schema.ts]"]
  node_postgres[("PostgreSQL")]
end

subgraph group_operations["Course updates and moderation"]
  node_update_vote_action["Course update voting<br/>[courseUpdates.ts]"]
  node_vote_logic["Vote logic"]
  node_admin_route["Admin route<br/>[page.tsx]"]
  node_admin_dashboard["Admin dashboard"]
end

node_student(("Student"))

node_student -->|"browses courses"| node_browse_route
node_browse_route -->|"loads courses"| node_course_catalog
node_course_catalog -->|"reads catalog"| node_catalog_store
node_course_catalog -->|"enriches courses"| node_course_api
node_browse_route -->|"renders"| node_browse_ui
node_browse_ui -->|"renders cards"| node_course_card
node_student -->|"opens course"| node_course_route
node_course_route -->|"loads course"| node_course_catalog
node_course_route -->|"renders detail"| node_course_detail
node_course_detail -->|"opens submission"| node_review_modal
node_review_modal -->|"submits review"| node_review_actions
node_review_actions -->|"checks session"| node_auth
node_review_actions -->|"reads and writes"| node_db_connection
node_db_connection -->|"uses schema"| node_schema
node_db_connection -->|"connects"| node_postgres
node_auth_route -->|"uses handlers"| node_auth
node_auth -->|"authenticates with"| node_keycloak
node_auth -->|"upserts identities"| node_db_connection
node_review_actions -->|"checks spam"| node_content_checks
node_review_actions -->|"checks profanity"| node_profanity_check
node_course_detail -->|"renders reviews"| node_review_feed
node_review_feed -->|"renders thread"| node_comment_thread
node_student -->|"manages contributions"| node_my_reviews_route
node_my_reviews_route -->|"renders dashboard"| node_my_reviews
node_my_reviews -->|"updates contributions"| node_review_actions
node_my_reviews -->|"opens editor"| node_edit_review
node_course_detail -->|"submits vote"| node_update_vote_action
node_update_vote_action -->|"checks session"| node_auth
node_update_vote_action -->|"reads and writes"| node_db_connection
node_update_vote_action -->|"uses vote logic"| node_vote_logic
node_student -->|"opens moderation"| node_admin_route
node_admin_route -->|"checks access"| node_auth
node_admin_route -->|"loads moderation data"| node_db_connection
node_admin_route -->|"renders dashboard"| node_admin_dashboard
node_admin_dashboard -->|"deletes comments"| node_review_actions

click node_browse_route "https://github.com/compsci-adl/mycoursereviews/blob/main/src/app/courses/page.tsx"
click node_browse_ui "https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/browse/BrowseCoursesClient.tsx"
click node_course_card "https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/browse/CourseCard.tsx"
click node_course_catalog "https://github.com/compsci-adl/mycoursereviews/blob/main/src/lib/courses-db.ts"
click node_course_route "https://github.com/compsci-adl/mycoursereviews/blob/main/src/app/courses/%5Bcode%5D/page.tsx"
click node_course_detail "https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/course/CourseDetailClient.tsx"
click node_review_modal "https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/course/ReviewModal.tsx"
click node_review_actions "https://github.com/compsci-adl/mycoursereviews/blob/main/src/app/actions/reviews.ts"
click node_review_feed "https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/course/ReviewFeedCard.tsx"
click node_comment_thread "https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/course/CommentThread.tsx"
click node_my_reviews_route "https://github.com/compsci-adl/mycoursereviews/blob/main/src/app/my-reviews/page.tsx"
click node_my_reviews "https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/dashboard/MyReviewsClient.tsx"
click node_edit_review "https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/dashboard/EditReviewModal.tsx"
click node_content_checks "https://github.com/compsci-adl/mycoursereviews/blob/main/src/lib/spam.ts"
click node_profanity_check "https://github.com/compsci-adl/mycoursereviews/blob/main/src/lib/profanity.ts"
click node_auth "https://github.com/compsci-adl/mycoursereviews/blob/main/src/auth.ts"
click node_auth_route "https://github.com/compsci-adl/mycoursereviews/blob/main/src/app/api/auth/%5B...nextauth%5D/route.ts"
click node_db_connection "https://github.com/compsci-adl/mycoursereviews/blob/main/src/db/index.ts"
click node_schema "https://github.com/compsci-adl/mycoursereviews/blob/main/src/db/schema.ts"
click node_update_vote_action "https://github.com/compsci-adl/mycoursereviews/blob/main/src/app/actions/courseUpdates.ts"
click node_vote_logic "https://github.com/compsci-adl/mycoursereviews/blob/main/src/lib/course-update-voting.ts"
click node_admin_route "https://github.com/compsci-adl/mycoursereviews/blob/main/src/app/admin/page.tsx"
click node_admin_dashboard "https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/admin/AdminDashboardClient.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_browse_route,node_browse_ui,node_course_card,node_course_catalog,node_catalog_store,node_course_api,node_course_route,node_course_detail toneBlue
class node_review_modal,node_review_actions,node_review_feed,node_comment_thread,node_my_reviews_route,node_my_reviews,node_edit_review,node_content_checks,node_profanity_check toneAmber
class node_auth,node_auth_route,node_keycloak,node_db_connection,node_schema,node_postgres toneMint
class node_update_vote_action,node_vote_logic,node_admin_route,node_admin_dashboard toneRose
class node_student toneIndigo
```

## Components

### Course discovery

- [Course browse route](https://github.com/compsci-adl/mycoursereviews/blob/main/src/app/courses/page.tsx): `src/app/courses/page.tsx`
- [Browse courses](https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/browse/BrowseCoursesClient.tsx): `src/components/browse/BrowseCoursesClient.tsx`
- [Course card](https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/browse/CourseCard.tsx): `src/components/browse/CourseCard.tsx`
- [Course catalog access](https://github.com/compsci-adl/mycoursereviews/blob/main/src/lib/courses-db.ts): `src/lib/courses-db.ts`
- **Course data store**
- **Course information API**
- [Course detail route](https://github.com/compsci-adl/mycoursereviews/blob/main/src/app/courses/%5Bcode%5D/page.tsx): `src/app/courses/[code]/page.tsx`
- [Course detail](https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/course/CourseDetailClient.tsx): `src/components/course/CourseDetailClient.tsx`

### Reviews and discussion

- [Review submission](https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/course/ReviewModal.tsx): `src/components/course/ReviewModal.tsx`
- [Review and comment actions](https://github.com/compsci-adl/mycoursereviews/blob/main/src/app/actions/reviews.ts): `src/app/actions/reviews.ts`
- [Review discussion feed](https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/course/ReviewFeedCard.tsx): `src/components/course/ReviewFeedCard.tsx`
- [Comment thread](https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/course/CommentThread.tsx): `src/components/course/CommentThread.tsx`
- [My reviews route](https://github.com/compsci-adl/mycoursereviews/blob/main/src/app/my-reviews/page.tsx): `src/app/my-reviews/page.tsx`
- [My contributions](https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/dashboard/MyReviewsClient.tsx): `src/components/dashboard/MyReviewsClient.tsx`
- [Edit review](https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/dashboard/EditReviewModal.tsx): `src/components/dashboard/EditReviewModal.tsx`
- [Review content checks](https://github.com/compsci-adl/mycoursereviews/blob/main/src/lib/spam.ts): `src/lib/spam.ts`
- [Profanity checks](https://github.com/compsci-adl/mycoursereviews/blob/main/src/lib/profanity.ts): `src/lib/profanity.ts`

### Identity and persistence

- [Authentication](https://github.com/compsci-adl/mycoursereviews/blob/main/src/auth.ts): `src/auth.ts`
- [Auth route](https://github.com/compsci-adl/mycoursereviews/blob/main/src/app/api/auth/%5B...nextauth%5D/route.ts): `src/app/api/auth/[...nextauth]/route.ts`
- **Keycloak**
- [Database connection](https://github.com/compsci-adl/mycoursereviews/blob/main/src/db/index.ts): `src/db/index.ts`
- [Application data schema](https://github.com/compsci-adl/mycoursereviews/blob/main/src/db/schema.ts): `src/db/schema.ts`
- **PostgreSQL**

### Course updates and moderation

- [Course update voting](https://github.com/compsci-adl/mycoursereviews/blob/main/src/app/actions/courseUpdates.ts): `src/app/actions/courseUpdates.ts`
- [Vote logic](https://github.com/compsci-adl/mycoursereviews/blob/main/src/lib/course-update-voting.ts): `src/lib/course-update-voting.ts`
- [Admin route](https://github.com/compsci-adl/mycoursereviews/blob/main/src/app/admin/page.tsx): `src/app/admin/page.tsx`
- [Admin dashboard](https://github.com/compsci-adl/mycoursereviews/blob/main/src/components/admin/AdminDashboardClient.tsx): `src/components/admin/AdminDashboardClient.tsx`

### Other components

- **Student**

## Connections

- Student → Course browse route: browses courses (evidence: `src/app/courses/page.tsx`)
- Course browse route → Course catalog access: loads courses (evidence: `src/app/courses/page.tsx`)
- Course catalog access → Course data store: reads catalog (evidence: `src/lib/courses-db.ts`)
- Course catalog access → Course information API: enriches courses (evidence: `src/lib/courses-db.ts`)
- Course browse route → Browse courses: renders (evidence: `src/app/courses/page.tsx`)
- Browse courses → Course card: renders cards (evidence: `src/components/browse/BrowseCoursesClient.tsx`)
- Student → Course detail route: opens course (evidence: `src/app/courses/[code]/page.tsx`)
- Course detail route → Course catalog access: loads course (evidence: `src/app/courses/[code]/page.tsx`)
- Course detail route → Course detail: renders detail (evidence: `src/app/courses/[code]/page.tsx`)
- Course detail → Review submission: opens submission (evidence: `src/components/course/CourseDetailClient.tsx`)
- Review submission → Review and comment actions: submits review (evidence: `src/components/course/ReviewModal.tsx`)
- Review and comment actions → Authentication: checks session (evidence: `src/app/actions/reviews.ts`)
- Review and comment actions → Database connection: reads and writes (evidence: `src/app/actions/reviews.ts`)
- Database connection → Application data schema: uses schema (evidence: `src/db/index.ts`)
- Database connection → PostgreSQL: connects (evidence: `src/db/index.ts`)
- Auth route → Authentication: uses handlers (evidence: `src/app/api/auth/[...nextauth]/route.ts`)
- Authentication → Keycloak: authenticates with (evidence: `src/auth.ts`)
- Authentication → Database connection: upserts identities (evidence: `src/auth.ts`)
- Review and comment actions → Review content checks: checks spam (evidence: `src/app/actions/reviews.ts`)
- Review and comment actions → Profanity checks: checks profanity (evidence: `src/app/actions/reviews.ts`)
- Course detail → Review discussion feed: renders reviews (evidence: `src/components/course/CourseDetailClient.tsx`)
- Review discussion feed → Comment thread: renders thread (evidence: `src/components/course/ReviewFeedCard.tsx`)
- Student → My reviews route: manages contributions (evidence: `src/app/my-reviews/page.tsx`)
- My reviews route → My contributions: renders dashboard (evidence: `src/app/my-reviews/page.tsx`)
- My contributions → Review and comment actions: updates contributions (evidence: `src/components/dashboard/MyReviewsClient.tsx`)
- My contributions → Edit review: opens editor (evidence: `src/components/dashboard/MyReviewsClient.tsx`)
- Course detail → Course update voting: submits vote (evidence: `src/components/course/CourseDetailClient.tsx`)
- Course update voting → Authentication: checks session (evidence: `src/app/actions/courseUpdates.ts`)
- Course update voting → Database connection: reads and writes (evidence: `src/app/actions/courseUpdates.ts`)
- Course update voting → Vote logic: uses vote logic (evidence: `src/app/actions/courseUpdates.ts`)
- Student → Admin route: opens moderation (evidence: `src/app/admin/page.tsx`)
- Admin route → Authentication: checks access (evidence: `src/app/admin/page.tsx`)
- Admin route → Database connection: loads moderation data (evidence: `src/app/admin/page.tsx`)
- Admin route → Admin dashboard: renders dashboard (evidence: `src/app/admin/page.tsx`)
- Admin dashboard → Review and comment actions: deletes comments (evidence: `src/components/admin/AdminDashboardClient.tsx`)
