← All projects

Repository-verified project

Phreddit

A full-stack discussion platform with session authentication, threaded comments, reputation-aware voting, live updates, and administrator moderation.

React · Express · MongoDB · Socket.IO

  • 37 HTTP endpoints
  • 117 declared tests
  • 18 explicit schema indexes
Phreddit project overview
Project overview. Implementation notes and evidence are detailed below.

01 / Problem

The constraint

Keep nested discussion, voting, moderation, and account deletion consistent across related documents without hiding important limits.

02 / Structure

Architecture at a glance

  1. React client
  2. Express + session middleware
  3. MongoDB + Socket.IO rooms

03 / Implementation

Engineering decisions

  1. Mongo-backed sessions regenerate their IDs on login. Unsafe requests use origin checks and session-bound CSRF tokens with timing-safe token comparison.
  2. Flat comment selection is capped at 5,000 records; two iterative passes assemble the tree and the response discloses truncation. Author population and counting are additional database operations.
  3. Conditional single-document updates implement vote addition, removal, and switching. Replica-set transactions coordinate related writes; the standalone path is nontransactional.
  4. Three CI jobs configure unit/lint checks, replica-set integration tests, and Chromium end-to-end checks with failure diagnostics.

04 / Evidence

Measurement context

Source audited at commit 2b08f3bcba1254ba38b5d2edcca1181f54647812. Endpoint count includes 36 application routes and health; it excludes the test-only reset route. Test count is 117 source declarations across unit, integration, and browser suites, not a claim that those suites were executed in this portfolio audit.

Inspect the audited source commit ↗

05 / Trade-offs

Limits worth stating

  • A disclosed 5,000-comment cap is not unlimited end-to-end nesting.
  • No production concurrency, p95 latency, or 5,001-to-1 query improvement is claimed without a reproducible measurement.
  • 18 counts explicit schema.index calls; field-level index declarations are a separate count.