Giter Club home page Giter Club logo

checkout-reviews's Introduction

Checkout Reviews

This app demonstrates functionality described in the challenge. The main pages are:

  1. index.tsx
  • Containing the main submission form, which allows users to submit a review.
  1. reviews.tsx
  • Displaying a bar graph showing the ratings spread of all reviews received so far. A bar graph was chosen here because it's the simplest way to understand the difference between fixed data points visually. It also instills familiarity in the customers, so they know what to look out for when they go to a product's reviews page.
  • Displaying the reviews received for the product so far in a descending order sorted by creation date. This allows end-users to quickly judge the usefulness of reviews.
Screen.Recording.2023-08-07.at.20.25.47.mov
Screen.Recording.2023-08-07.at.20.26.44.mov

The components used are:

  1. Reviews - a component responsible for displaying the reviews on the page. This helps us test the reviews page better as well.
  2. Star - an SVG for a star with hover animations and StarRatings - a component which renders Star and controls its state.

Steps to Run

  1. npm i
  2. npx prisma migrate dev
  3. npm run dev

Technology Choices

  1. next - a React meta-framework taking care of several important things like routing, Server-Side Rendering, etc.
  2. mantine - a React component library, taking care of accessibility and other important considerations while providing a good fundamental design system to build on.
  3. recharts - a React charting library using D3 to render graphs and charts.
  4. tailwind - providing fundamental CSS utilities to improve speed of developement.
  5. jest - the standard JS testing framework created by Facebook. Easy to use and debug.

What could be made better?

  1. Using a form-validation library to encapsulate form state in React.
  2. Using something like Docker for standardizing dependencies used by the application, defending against the "It works on my machine" problem.
  3. Adding better effects to form submission, making it clearer for the end user about the submission of the review.
  4. Paginating responses from the backend so we can limit the number of elements returned at once.
  5. Add run-time validation to APIs using zod.
  6. Add CI for running type-checks, linting and tests before merging a PR.

checkout-reviews's People

Contributors

akash-joshi avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.