Giter VIP home page Giter VIP logo

alvigene_next's Issues

Handle search

We need to able to search for products based on the Product.all cache list.
This means, we need to write the JSON for all products in a file programmactically. We should only update this file when updated_at for any product is changed.
When the user search for a product, we search data in this JSON. No requests sent to the server.
We also display results based on that JSON

Debouncing

j'ai erreur dans la console au niveau du debouncing c'est dans la page /app/ui/search.tsx.
il est dit que je dois appeler la hook debouncing dans une fonction

Add to cart functionality

To achieve this, the user should be able to click on the ajouter au panier button.
This will send a post request to the Alvigene (rails) API on the OrdersItems controller.
The view should work exactly as it does in the Rails project right now. So use it as example

Refresh the product cache

We need to refresh the product cache on the NextJS project whenever changes are done on the Rails project.
This only concerns products for now, but the solution should be the same for other objects as well.

To make it work, I suggest 2 approaches:

  1. Polling (Time-based revalidation): This consist in sending a request to the rails project at a given interval to see if there are changes. Use the update_at field to compare changes. If the updated_at is more recent that the one we on the NextJS project, we refresh the cache. Else, we do nothing

  2. Webhooks (On-demand revalidation): This consist in sending a notification the NextJS project from the Rails project when changes are made.

learn more

https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#revalidating-data

https://nextjs.org/docs/app/building-your-application/caching

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.