BnbNotifier: Authentication and Web Scraping 🔒

app 1/12
part 2

This week I made progress on learning about Authentication and Web Scraping.

auth-meaning

Authentication is a huge topic in a software project. When you're paying for a product or service, it's essential to ensure that only you have access to your profile.

When starting to implement authentication for the first time, it can be pretty intimidating since it touches so many aspects of software engineering, from programming fundamentals you learn in the first couple of weeks of a coding course to server and client-side programming like setting cookies on the client (cookies are a weird way of describing data stored on the client's device ).
You also need to understand connecting to a database and storing encrypted passwords. It's also helpful to know some user interface fundamentals, like coding a form to accept a username and password and validating these inputs, and to have some CSS knowledge to style the UI.
Caching is another important aspect, as different components on a page may render conditionally based on whether a user is logged in or not.

Overall, authentication spans a wide range of skills making it a challenging but essential part of software development.

Elloitt Chong in this video highlights the different ways of implementing authentication in apps really well.
auth-meaning

Lucia, Next-Auth, Clerk are people or companies that do some of the heavy lifting for you. I chose to use Lucia for this project since I wanted to try implementing Auth at a lower level and try to learn more.

Web Scraping

The code below can receive an Airbnb URL and scrape all the listings on the page.

pup


I was somewhat surprised that it did not take too long to google and chat gpt my way to this solution. The challenging part I am facing now is being able to run this code in a production environment. When the data is fetched like so

await page.goto(airbnbUrl, { waitUntil: "networkidle2" });

pupputeer, actually renders the fetched data in a chrome browser and in a production/serverless/hosted environment, it does not like that. And I have found it difficult to find a solution for Vercel, the hosting service I am using, so I am trying to understand and make it work on AWS.

19 July 2024
hi

WRITTEN BY

Cam Adams

View all posts