Code Monkey home page Code Monkey logo

reddit-clone's Introduction

reddit-clone

A Reddit clone.

If I had more time, I could improve many things, like:

  • In the frontend:
    • The design of the page.
    • Show content instead of only a title.
    • Show images.
    • Make the page responsive to mobile devices.
    • Show a message when there are no recent posts to display.
    • Don't hit the endpoint that gets all the recent posts data when the user likes a post.
    • Don't allow the user to create posts with empty content, and show a proper message.
    • Clear the text in the input element of the 'Create post' component after the user created a post.
    • Fix the bug where the homepage looks bad when there are many posts.
    • Maybe disable action buttons ('Like' and 'Create post') after they're pressed and until the action they initiate finishes. This way the user can't spam the endpoints from the application.
    • Use a proper tool to provide styling to the components.
    • Create components to avoid repeating some style rules.
    • Allow the user to sort posts by creation date and/or likes.
    • Follow proper conventions for CSS styles implementation.
  • In the backend:
    • Move the routes definition to a 'routes' folder.
    • Move the business logic of each endpoint to a 'services' folder.
    • Create controllers between routes and services to validate the data provided in the request.
    • Correctly return responses for error cases.
    • Maybe make success return responses follow a convention and/or be more descriptive.
    • Enforce very strict model definitions and make sure there's no way of inserting or updating rows with incorrect data.
    • Implement pagination for the GET endpoint.
  • Overall:
    • Use TypeScript.
    • Add unit tests for the logic.
    • Add integration tests for simple scenarios.
    • Consider scaling problems.
    • Consider authentication.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.