This repository hosts the code for Lee Paulison's portfolio built with React and Vite. The site showcases projects and includes a contact form protected by Google reCAPTCHA. A Firebase Cloud Function verifies each reCAPTCHA token before an email is sent.
Install dependencies and start the development server:
npm install
npm run devCreate an .env file and provide your reCAPTCHA site key and the URL of the Cloud Function:
VITE_APP_RECAPTCHA_SITE_KEY=your_site_key
VITE_APP_RECAPTCHA_URL=https://your-cloud-function-urlFor the Firebase function, set RECAPTCHA_SECRET_KEY in the environment variables on Firebase. To install dependencies for the function locally run:
npm install --prefix functionsCreate a production build with:
npm run buildLocally preview the built app using:
npm run previewThe functions/ directory contains verifyRecaptcha, an HTTPS function that validates reCAPTCHA tokens. It is used by the contact form to help prevent spam submissions. Deploy it with Firebase CLI after running its linter:
npm run lint --prefix functions
firebase deploy --only functionssrc/– React components and pagespublic/– static assetsfunctions/– Firebase Cloud Function for reCAPTCHA verification
Tailwind CSS is configured in tailwind.config.js and Vite is set up with the @vitejs/plugin-react plugin.