Giter Club home page Giter Club logo

behtarino-task's Introduction

This is a Next.js project bootstrapped with create-next-app.

Getting Started

to run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3008 with your browser to see the result.


and to run the cypress e2e testing server:

npm run cypress
# or
yarn cypress

Preferable Structure

I used Atomic Design for directory structure.

Preferable Technology

Using ISR technology instead of SSR or SSG is much more better because it's as fast as SSG and dynamic like SSR.

Make it better

These options would make the app better:

  • Using Context API instead of drilling props. (It's not approptiate for now because when we want to use this we should have SPA version of our app and loading components and etc...)
  • Add toggle button for next-themes to set theme state (with its persistance).
  • Add next-pwa in next.config.js file to have caching. (and offline support by adding _offline.jsx file in pages directory).
  • Add Snackbar for notify users to their own actions. (such as copied in clipboard!)

Deploy on Vercel

You can check out Live Demo.

PAY ATTENTION!

I wanted to add cypress e2e testing but for installtion (npm run cypress:install) it seems that needs VPN! but these Items should be tested:

  • Home page should have exactly 20 products as the cy intercepts the GET request from fakestoreapi. (data-testid=PRODUCT_CARD)
  • Product detail pages should contains exactly the same Title as the cy intercepts the GET request from fakestoreapi. (data-testid=PRODUCT_TITLE)
  • Other infos about Product details can be tested but it's optional for more assurance!

behtarino-task's People

Contributors

amyrsaalehi avatar

Watchers

 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.