Skip to content

ginazampino/southjerseydeb-astro

Repository files navigation

South Jersey Deb (Front End)

Using: Astro, JSX, JSDoc, Sass, Render.io

🔥 Check the website's Google Lighthouse scores: https://southjerseydeb.com

Project Highlights

  1. Astro (JSX) front-end framework
  2. Headless CMS (Strapi) back-end
  3. REST API data fetching (Strapi)
  4. Type checking (JSDoc w/ TypeScript)
  5. API integration (Formspree)
  6. Cloud hosting (Render)
  7. CI/CD (GitHub Actions)

Code Excerpts

REST API

Fetching and rendering data from the CMS:

const apiUrl = `https://southjerseydeb-strapi.onrender.com/api/${endpoint}?populate=*`;
const data = await fetchData('about');

Props

Using props in Astro components:

<Features beds={bedrooms} baths={bathrooms} sqft={sqft} />
<span>{author}, {relationship}</span>

Type Checking

Using JSDoc to check types:

* @param {string} selector - The CSS selector for the elements to be faded.
* @returns {Promise<any>} - The data fetched from the API.
* @type {NodeListOf<Element>}

Contact Form

Integrating Formspree endpoint into the contact form:

<form action=`${endpoint}` method="POST">