Integrate my store With a database without 3rd party app

When I click(or any event) on a product in collection page, i need to store the details of that product (product id and product name) in my database (preferably mongoDB) without using any third party app. how to do that?

If you already have the database set up on a server, just send an ajax request to an endpoint that updates that. You can get the product info using Liquid: https://shopify.dev/api/liquid/objects/product

If you need a custom app built for you feel free to reach out to my team at speedboostr.com/contact. We’ve built custom apps as well as public apps, so any functionality outside your wheelhouse we can help.