Building a High-Performance Contractor Website with React, Gatsby, and SSR


A deep dive into building “The Best Piling Contractors in Ash Vale: McCance Group” website using modern frontend technologies.
🏗️ Project Overview
In the competitive construction sector, having a fast, SEO-friendly, and visually appealing website is non-negotiable. The McCance Group, known for its premium piling services in Ash Vale, needed a digital presence that matched its reputation. This blog walks through how we built their website using React, Gatsby, and Server Side Rendering (SSR) to maximize performance, SEO, and user experience.
🛠️ Tech Stack
React: Component-based UI library
Gatsby v5+: React-based static site generator with support for SSR
GraphQL: Data querying for content
Styled Components / TailwindCSS: For styling
Netlify / Vercel: Hosting
Headless CMS (e.g., Contentful/Sanity): Optional for dynamic content
🌐 Why Gatsby for McCance Group?
Gatsby provides the best of both worlds: static site generation and SSR. Since SEO and fast load times were top priorities, Gatsby was chosen for:
⚡ Lightning-fast performance (static pre-rendered pages)
🔍 Built-in SEO optimization
🔌 Rich plugin ecosystem
🔄 Server-side rendering support for dynamic parts like service listings
🧱 Step-by-Step Implementation
1️⃣ Initialize Gatsby Project
bashCopyEditnpm install -g gatsby-cli gatsby new mcance-group-site cd mcance-group-site
2️⃣ Configure Project Structure
bashCopyEdit/src /components Layout.js SEO.js Header.js Footer.js /pages index.js services.js about.js contact.js /templates service-template.js
3️⃣ Add Styling (TailwindCSS example)
bashCopyEditnpm install -D tailwindcss postcss autoprefixer npx tailwindcss init -p
Update
tailwind.config.js
and import styles ingatsby-browser.js
.
4️⃣ Add SEO Support
Create an SEO component using Gatsby’s
Helmet
plugin.jsxCopyEdit// src/components/SEO.js import React from "react" import { Helmet } from "react-helmet" const SEO = ({ title, description }) => ( <Helmet> <title>{title}</title> <meta name="description" content={description} /> </Helmet> ) export default SEO
5️⃣ Static Pages
Use
pages/index.js
for the homepage:jsxCopyEditimport React from "react" import Layout from "../components/Layout" import SEO from "../components/SEO" export default function HomePage() { return ( <Layout> <SEO title="McCance Group | Best Piling Contractors in Ash Vale" /> <section className="text-center py-10"> <h1 className="text-4xl font-bold">Welcome to McCance Group</h1> <p className="mt-4">Expert Piling Solutions in Ash Vale</p> </section> </Layout> ) }
6️⃣ Dynamic Content with SSR
For services that are updated often (e.g., “Mini Piling”, “Basement Foundations”), we use SSR.
Enable SSR in
gatsby-config.js
:jsCopyEdit// gatsby-config.js module.exports = { plugins: [ `gatsby-plugin-react-helmet`, `gatsby-plugin-postcss`, ], // Enable SSR for dynamic routes flags: { DEV_SSR: true, }, }
Create SSR page in
/src/pages/services.js
:jsxCopyEditexport async function getServerData() { const res = await fetch("https://api.mcancegroup.com/services") const services = await res.json() return { props: { services, }, } } export default function ServicesPage({ serverData }) { return ( <Layout> <SEO title="Our Piling Services" /> <h1 className="text-3xl font-bold">Our Services</h1> <ul className="mt-4"> {serverData.services.map((srv) => ( <li key={srv.id} className="mt-2"> <h2 className="text-xl">{srv.title}</h2> <p>{srv.description}</p> </li> ))} </ul> </Layout> ) }
7️⃣ Contact Form Integration
Use a Netlify function or form handling service like Formspree:
jsxCopyEdit<form method="POST" action="/success" netlify> <input type="text" name="name" required /> <input type="email" name="email" required /> <textarea name="message" required></textarea> <button type="submit">Send</button> </form>
🚀 Deployment
Deploy to Netlify or Vercel:
bashCopyEditnpm run build
Push to GitHub → Connect repo to deployment platform → Set SSR routes if needed.
🧠 Tips for Success
Use
gatsby-plugin-image
for optimized image loadingCache heavy API calls when possible
Use Lighthouse to monitor performance and SEO
Always include structured data for local business (JSON-LD schema)
✅ Final Output
The final site:
Loads in under 1s on 4G
Renders pages from server when content is dynamic
Is fully SEO-optimized (meta tags, semantic HTML, sitemaps)
Looks modern and professional across devices
Visit: https://mcancegroup.com (hypothetical link)
📦 Source Code
You can find the GitHub repository here:
👉 github.com/yourusername/mcance-group-gatsby
🏁 Conclusion
With Gatsby SSR and React, building a performant, SEO-friendly website for contractors like McCance Group becomes efficient and scalable. This architecture ensures visibility on search engines, rapid load times, and great UX – crucial for local business success.
Subscribe to my newsletter
Read articles from Stella Josephine directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
