Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Summer task 2024 gorrion - Jakub Taborski #9

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jtab4
Copy link

@jtab4 jtab4 commented Jun 24, 2024

I have completed task for summer-camp-2024.

  • created lib with functions that opens csv & json file and merging into one array with sorting ascending by product id and filter products without alcohol and also function that fetch array length
  • implement test to check array length and check functionality for different pges
  • endpoint for fetching data from lib functions
  • displaying data on page using server side rendering with client components for better SEO, better scalability and quicklier loading

product.ts

  • parseCSV : function that opens csv file and returned all products from file
  • parseJSON : function that opens json file and returned all products from file
  • fetchProducts: merging all products from files using previous mentioned functions using spread operator (...), sorting ascending by id product and filtering products without alcohol and also pagination - function returns products from concrete page
  • getCountProducts : help function created by me that returns length of non-alcohol products

api/route.ts

  • endpoint that use functions from lib and fetch products from concrete page and amount of all non-alcohol products

page.tsx

  • server component that fetch products depending on url params page
  • transfer data as a props to ProductList client component that display products in table

pagelist.tsx

  • client component that receives data as a props from server component and display data in table
  • import pagination client component that contains paginating logic (moving between pages) and interface

pagination.tsx

  • client component that contains paginating logic and interface to allow users moving between pages and browse another products

tests

  • functions from libs passed all of tests
  • created tests for my created function to checking length of non alcohol products
  • created tests to check functionality for another pages on list

I would be glad to talk in person and answer all your questions about possibilities in this role, this task and my previous projects.

Have a nice day :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant