GDG-On-Campus-ICTU / MaterialHub-Hactoberfest

This repository contains the source code for a single-page web application that displays a list of cool tech materials. Users can view detailed information about each material, including the contributor, resource name, link, and tags. New materials can be added through a user-friendly form.
https://material-hub-hactoberfest.vercel.app/
7 stars 10 forks source link

Add client-side data validation #20

Open Perry-Bright opened 1 month ago

Perry-Bright commented 1 month ago

Data validation on the client-side to prevent inconsistent or invalid data being stored

Perry-Bright commented 1 month ago

It could also handle duplicate entries

mohtasheem135 commented 1 month ago

Handling duplicate data is very much possible and we can achieve it but how to make sure that the added data is valid or not.

Perry-Bright commented 1 month ago

we can use the fetch API to make a HEAD request to the link. If the response is OK (200-299), we consider the link valid. If the response is not OK, or if there's an error making the request, we consider the link invalid.

but this implementation has some limitations:

after more research, we can solve this issues using more complex crawling algorithms that use a combination of techniques like

mohtasheem135 commented 1 month ago

Cool, I think it can be done.

Perry-Bright commented 1 month ago

I appreciate your positive attitude and approach to challenging tasks. It's great working with you, @mohtasheem135