alvigene_next's Issues
Start a ruby on rails project as API only
Start a new ruby on rails project on your own account.
Use that project to learn how to build and API only app with ruby on rails.
Once you are done, your next task will be to consume the data from that app from this alvigene NextJS app.
Follow this tutorials
https://duetcode.io/rails-api-only-course
https://www.youtube.com/watch?v=FJiIvFoxqsc
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
create a dynamic product show page
There should only be one component for the show page. Use the queries getProduct
component to fetch the data for that page.
Fetch products from the rails API app
Consume the products API endpoint from the rails Alvigene project
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:
-
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 theupdated_at
is more recent that the one we on the NextJS project, we refresh the cache. Else, we do nothing -
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/caching
Move current site to NextJS
Copy the current html site to the nextJS project.
It must work the same as in the current version.
Cleanup source code
Remove commented codes and unused files.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.