Skip to content

Express server connected to reactjs for google search & certain content scrapping (puppeteer), using htmx + nodecache

Notifications You must be signed in to change notification settings

Ebrahim-Ramadan/Express-React-PlagiarismCheck.02

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Express-React-PlagiarismCheck.02-APIUpdate

Express server connected to reactjs for google search & certain content scrapping (puppeteer), using htmx + nodecache, solving this challenge.


This is test02 for individual phrases which they will be divided from the main paragraphs in the very soon
This very modular UI shows to the user to start typing the whole text for check, submitting in ctrl+Enter after finishing.
getting out of (unshowing) the typing-modal cancels the request with a useEffect()'s cleanup func:

  useEffect(() => {  
    if (showModal) {  
          modalRef.current.focus();  
          try{  
          await fetch()...  
          } catch (error) {  
        if (error.name === 'AbortError') {  
          console.log('Fetch request was aborted by the user.');  
          toastify('Requet Aborted')  
        } else {  
          console.error('An error occurred:', error.message);  
        }  
      }  
            const textareaElement = modalRef.current;  
      if (abortControllerRef.current) {  
        abortControllerRef.current.abort();  
      }  
return () => {  
      // Cleanup function  
      // If the component unmounts or the dependency array changes, abort the request  
      if (abortControllerRef.current) {  
        abortControllerRef.current.abort();  
      }  
    };  
    }  

with the main textarea ``` <textarea type="text" ref={modalRef} placeholder="start writing" /> ```

02.01.mp4



02.02.mp4



Client dir.


Features:


-- AbortController to update the request state in case o cancelling the requet by the user (out of the typing-modal)
-- hovering over the ` @Ebrahim Ramadan ` for a little shows this modal of me for [My Github Overview](https://github.com/ebrahim-Ramadan/). and clicking on it takes you to [My Twitter](https://twitter.com/scoopsahoykid).
![Screenshot 2023-07-26 152600](https://github.com/Ebrahim-Ramadan/Express-React-PlagiarismCheck.02-RESTfulAPI/assets/65041082/241539d5-1b54-4125-8d4f-25540146d089)
-- Different Errors handled very gracefully on both server and client related, check the API

About

Express server connected to reactjs for google search & certain content scrapping (puppeteer), using htmx + nodecache

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published