Skip to content

The Add Bookmarks API Flow

abhishekmg edited this page Jul 2, 2025 · 1 revision

There are 3 apis in this flow

  • API for min data: This adds the min data to the DB so that the uploading in as fast as possible for the user.
  • API for screenshot: This gets the screenshot for the api and uploads it to DB
  • API for the remaining data: This generates all the meta data for the URL , this includes blur hash, OCR, image caption, image dimensions, and then it uploads all this data to DB

Edge case

  • If the URL is an image or any Mimetype like test.com/img.jpg then we do not take screenshot , we upload it to s3 and then take meta data for it

Flow

  • add-min-data
    • (in useQuery) add-screenshot api, if URL is not Mimetype, then call screenshot api. We are calling this in useQuery to bypass the vercel upload limit issue
      • call add-remaining data api , this will get the uploaded screenshot or ogImage and it will generate meta_data for screenshot and upload the ogImage to s3
    • (in API) call the add-remaining API if the URL is Mimetype, here the Mimetype URL will be uploaded to s3 and for this meta_data will be generated
Clone this wiki locally