First Client Lessons

First Client Lessons

Kamil Rogozinski 8 min read

Overview of my first client project

I’ve just wrapped up my first ever client project: a website for my local barbershop. I’ve been going there for about three years, so when the owner asked if I could build him a simple, fast, and modern site, I was all in. The experience turned out to be a great deep-dive into AstroJS, static site hosting, and even pulling in data from the Google Places API.


The Project Overview

The website needed the following sections:

Since this is a local barbershop, the goal was to create a straightforward static site that loads quickly and doesn’t bombard visitors with unnecessary scripts. In other words, it had to be simple to navigate and friendly for both desktop and mobile users.


Why AstroJS?

I’d heard about AstroJS for a while but never tried it out. The key selling point that caught my attention was “Ship less JavaScript”. Astro takes the approach of rendering most content as static HTML and only shipping client-side scripts where needed. This felt like a perfect fit for a site that mostly relies on text, images, and a few interactive elements.

Initial Impressions

Overall, there’s a bit of a learning curve with Astro, but once I got the hang of it, everything started to make sense.


Hosting on Netlify

After building the site, I started thinking about hosting. This project is for a small local business, so cost was definitely a factor. Netlify’s free tier is often enough for straightforward static sites, and the only real cost for the client would be the domain name itself.

Steps to Deploy

  1. Connect Repository: I created a new repository on GitHub for the barbershop site.
  2. Netlify Integration: Went to Netlify, clicked “New site from Git,” and linked it to the GitHub repo.
  3. Build Settings: Astro’s default build command is typically npm run build, and the output directory is dist. Netlify usually detects this automatically, but I double-checked in the deployment settings.
  4. Domain Setup: The client purchased a custom domain. I set up the DNS records to point to Netlify’s servers, which was pretty straightforward, though I had to read through the docs to figure out how to do it.
  5. Go Live: Once the DNS propagated, the site was live. (Prior to this project, I didn’t even know what DNS propagation was!)

Netlify also offers a neat preview deployment feature, so we could test changes or new features in a staging environment before pushing them to production.


Implementation Details

Google Places API for Reviews

The owner wanted a live feed of customer reviews from Google, so I used the Google Places API. Here’s the gist of how I did it:

  1. API Key: I generated an API key from the Google Cloud Platform console and restricted it to only work with the barbershop domain.
  2. Serverless Function (Optional): In some cases, you might need a serverless function to keep the API key hidden. But with Astro, you can fetch data during the build process server-side.
  3. Display: I created a small Astro component that displays each review, including the rating and user comments.

Embedding Google Maps

For the “Contact” section, I embedded a Google Map so visitors can see the exact location. This was as simple as copying the embed code from Google Maps and dropping it into the relevant Astro component. I made sure to keep it responsive by applying standard responsive iframe techniques (wrapping the iframe in a container and setting width/height to 100% with some CSS).

Astro’s image handling is straightforward, but you still want to optimize images for performance. Since I just had a handful of photos, I made sure they were resized and compressed before placing them in the public folder. For even better optimization, Astro has an experimental image component that can handle responsive images with ease. I might switch to that in a future update.

Meet the Team & Community

The barbershop owner wanted a personal touch, so we created profiles for each barber, with a short bio and a photo. For the community section, we showcased local events and fundraisers they’ve hosted or participated in.

Server-Side Rendering & Netlify Functions

One of the trickier parts of the project was figuring out how to securely handle the API key for Google Places. Initially, I tried making calls on the client side, but that would expose the API key in the browser. Then I looked into Astro’s server-side rendering and Netlify Functions:


Performance & SEO With Lighthouse

Another challenge was making sure the site performed well and scored highly on Lighthouse. I found myself getting quite fixated on hitting 100% on Performance, SEO, Accessibility, and Best Practices. Here’s what I learned:

Even after spending some time tuning the site, I still find that the site does not always rank well on google search results. I think this is an area where I need to do more research and improve in.


Lessons Learned

  1. Astro’s Structure: At first, the structure felt rigid, but I soon realized it forces you to keep everything neatly organized.
  2. Performance by Default: Astro really does prioritize performance, which made a huge difference for a small business site aiming for fast load times on mobile devices.
  3. Netlify Simplicity: Netlify’s free tier is often enough for most small business static sites. The biggest cost was just the domain.
  4. Google API Quirks: Managing API keys is always a bit tricky. Make sure you lock down your keys and know whether you’re fetching data at build time or runtime. This caused me a lot of trouble when I wanted to use Netlify Functions to fetch the data without exposing the key.
  5. Client Communication: This was my first real client project, and I learned a lot about managing expectations, deadlines, and scope creep (hello, new features!).

Final Thoughts

If you’re looking to build a static, fast site, definitely give Astro a spin. Once you get over the initial setup, it’s surprisingly straightforward. And if you’re seeking a free or low-cost hosting solution, Netlify is a fantastic companion—easy to set up, with plenty of useful extras.

This project was my first step into blending a new JavaScript framework (Astro) with a real-world client scenario. Although it took me a bit of time to grasp the folder structure and “island architecture,” I came away appreciating Astro’s minimalistic approach to shipping code. Now that the barbershop site is live, I’ve seen firsthand how fast it loads and how well it handles SEO out of the box.

We are currently in discussion of adding a shop section to the site for e-vouchers to the barbershop. I’ve started looking into possible solutions, but it’s a bit more complex than I initially thought. I’ll be sure to write about it in a future post if we go ahead with it.

Thanks for reading! If you have any questions about Astro, Netlify, or pulling data from the Google Places API, feel free to reach out using the form on the contact page.