RedditClone Schema

REDDIT CLONE!

Writing a clone of Reddit has become a "FizzBuzz" fad. Jonathan Holland decided to build one using C# and ASP.NET MVC with more features than typical clones, including:

Order: links by score Submit: links Vote: links + comments Nested: comments DB: real persistence
  • View Links ordered by score
  • Submit Links
  • Vote on links
  • Comment on links in typical nested reddit fashion
  • Vote on comments
  • Order comments by score
  • Use a real database as persistence

Data Model (Numbered Code Structure)

The model uses Submission and Comment classes with Linq to SQL attributes.

  • Submissions: Includes ID, Title, Link, Score, and an EntitySet of Comments.
  • Comments: Includes ID, ParentCommentID, SubmissionID, Text, Score, and an EntitySet of ChildComments.

Controllers

  • SubmissionController: Handles Index (list by score), View (single submission), Submit (POST), and Voting (Up/Down).
  • CommentsController: Handles Create (POST) and Voting (Up/Down).

Views (Spark View Engine)

Uses the Spark view engine for layouts and partial views:

  • _renderComment: A recursive partial view to render nested comment trees.
  • Submission and SubmitLink: Reusable partial templates.

Submit a link:

Submit Comment:

Comments:

Comments are displayed here on the live site.