Skip to content

Feat/api#9

Merged
DavisNoah02 merged 4 commits intomainfrom
feat/api
Mar 29, 2026
Merged

Feat/api#9
DavisNoah02 merged 4 commits intomainfrom
feat/api

Conversation

@DavisNoah02
Copy link
Copy Markdown
Owner

This pull request introduces a complete backend persistence layer for contact form submissions, adds rate-limiting to prevent spam, and improves the robustness of the contact form both on the frontend and backend. It integrates Prisma with PostgreSQL, adds new workflows for CI and database migrations, and updates documentation and dependencies accordingly.

Backend: Contact Form Persistence & Rate Limiting

  • Added a new API flow for /api/contact that validates input using a shared Zod schema, saves messages to the database using Prisma, and applies per-IP rate limiting to prevent abuse. It also gracefully handles email delivery failures and missing configuration. [1] [2] [3] [4]
  • Introduced a contactSchema in lib/validations/contact.ts for consistent validation on both frontend and backend.
  • Added a new saveContactMessage function in lib/server/contact-message-store.ts and Prisma client setup in lib/server/db.ts. [1] [2]

Frontend: Contact Form Improvements

  • Updated the contact form page to use the shared Zod schema, improved error handling, and now displays warnings if email delivery fails but the message is saved. [1] [2] [3]

Infrastructure & Tooling

  • Added GitHub Actions workflows for CI and production database migrations, ensuring Prisma migrations are applied automatically. [1] [2]
  • Added Prisma, PostgreSQL, and related dependencies; provided scripts for migrations, client generation, and DB studio. [1] [2] [3] [4] [5]

Documentation

  • Updated README.md with environment variable setup, database command instructions, and deployment order recommendations for production. [1] [2] [3]

Other UI/UX and Theming

  • Improved theme switching logic to use useSyncExternalStore for better reactivity and reliability. [1] [2] [3] [4]
  • Minor UI tweaks, such as replacing LogoImage with Logo. [1] [2]

Backend: Contact Form & Persistence

  • Rewrote /api/contact to use shared validation, save messages to DB, and add rate-limiting per IP. Handles email failures and missing config gracefully.
  • Added saveContactMessage for DB persistence and Prisma client setup for PostgreSQL. [1] [2]
  • Implemented in-memory rate limiting and client IP extraction utilities.

Frontend: Form Validation & UX

  • Updated contact form to use shared Zod schema, improved error display, and shows warnings if email fails but message is saved. [1] [2] [3]
  • Added contactSchema and types for validation.

Infrastructure & Tooling

  • Added CI and production DB migration workflows using GitHub Actions. [1] [2]
  • Added Prisma, PostgreSQL, and related scripts and dependencies. [1] [2] [3] [4] [5]

Documentation

  • Updated README.md for environment variables, database commands, and deployment order. [1] [2] [3]

UI/UX and Theming

  • Improved theme switching to use useSyncExternalStore for more reliable updates. [1] [2] [3] [4]
  • Replaced LogoImage with Logo for consistency. [1] [2]

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
convert-neo Error Error Mar 29, 2026 7:26pm

Copy link
Copy Markdown
Owner Author

@DavisNoah02 DavisNoah02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SCALABABLE, RELIABLE AND Efficient

@DavisNoah02 DavisNoah02 merged commit f2bc564 into main Mar 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant