Skip to content

A Reddit/Hacker News clone written in Laravel

Notifications You must be signed in to change notification settings

theo0165/duckpond

Repository files navigation

Duckpond

Simple Reddit clone written in Laravel 9. Demo screenshots available here.

Built by

Install guide

  1. Clone the repository

    •   git clone https://github.com/theo0165/duckpond
      
        cd duckpond
  2. Create .env file

    •   cp .env.example .env
  3. Update .env with your own values.

  4. Install dependencies for php and node.js

    •   npm install
        composer install
  5. Generate application key

    •   php artisan key:generate
  6. Run migrations and populate database for testing

    •   php artisan migrate:fresh --seed
    • This will take up to 30 seconds
  7. Start dev servers

    •   npm run dev
        php artisan serve
  8. Visit the website on http://localhost:8000

Code Review

Code review written by Christopher, Oliver & Sophie.

  1. No installation guide (during time of code review)
  2. CreateReplayController :15 : $data as a variable name could be more specific.
  3. ShowUserController :12 : is this comment supposed to be there?
  4. GuestTest :328 : This test is in a comment, can be deleted since it’s not being used.
  5. In the table comments there is a column named parent_id, maybe specify more.
  6. All tests “includes” the faker class but it is never used.
  7. Most of the controllers have unused request classes.
  8. Comment on what q would be in search controller.
  9. A lot of files have the “boiler” code left.
  10. The code could benefit a lot from comments explaining more specific variables.
  11. DeleteCommentController.php:16 has commented dd left in code
  12. ShowPostController.php:13 do not use $request
  13. [minor]Controller/submit breaks structure with small letters
  14. StoreSubmitController.php:25 has commented dd left in code
  15. ShowUserProfileController.php:12 commented code left in prod
  16. UserFollowCommunityController.php $checkIfFollow-naming. Check if whats follow what?
  17. Maybe pagination on front page?
  18. Models/Comment.php:52 has some commented code
  19. Models/Post.php:25 has some commented code
  20. Good use of built in functions etc.
  21. Very good html structure.
  22. Good grouping of routes.
  23. Overall a very well made project, especially considered the time frame ⭐️

Tables/Models

  • User
    • Email
    • Username
    • Password
    • Is admin?
  • Post
    • Title
    • Value
    • Type
      • Text/link
    • User id
  • Community
    • Title
    • Owner (user id)
  • Vote
    • Post id
    • Comment id
    • User id
    • Up/down (true/false)
  • Comment
    • User id
    • Text
    • Post id -> post
    • Parent id -> comment
  • Post on community
    • User id
    • Post id
    • Commnunity id

Relationships

  • User

    • Has Many
      • Posts
      • Comment
      • Community
  • Post

    • Has Many
      • Comments
    • Belongs to
      • User
      • Community
  • Community

    • Has many
      • Posts
    • Belongs to
      • User
  • Comment

    • Has many
      • Comments
    • Belongs to
      • Post/comment
      • User
  • Vote

    • Belongs to
      • Post/Comment

Features

  • Users
    • Admin (?)
      • Can delete posts
    • Profile page, public
      • Posts
      • Comments (?)
      • Settings for own user.
        • Update
          • Password
          • Email
  • "Communties"
    • Can visited seperate from front page
      • Can only see posts from that community
    • User can delete
    • Posts
      • Text/link
      • Upvote/Downvote
      • Comment
        • Upvote/downvote
        • Delete
      • Delete
    • User can create
    • User can follow
      • Posts from followed communties on front page
  • Front page
    • Sort by most upvoted last 24hr
  • Search
    • Communities
    • User
    • Post (?)
  • Sort by controversial
    • Many upvotes and downvotes

Deliminations

  • No mods on communties
    • Only super user

About

A Reddit/Hacker News clone written in Laravel

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages