Skip to content

Add Contact Page and Link It from Navbar #111

Description

@Amrita2222

Add Contact Page and Link It from Navbar

Is your feature request related to a problem?
The Contact page at /contact exists (src/app/contact/page.tsx) and renders the <Contact /> component, but the contact form currently uses a simulated API with a random 70% success rate — it does not actually send emails or store messages.

What Needs to Be Done

  1. Backend: Create a real API route at src/app/api/contact/route.ts to handle form submissions
  2. Email Integration: Use nodemailer (already in dependencies) to send contact form submissions to the project admin email
  3. Form Validation: Add server-side validation for name, email, subject, and message fields
  4. Rate Limiting: Add basic rate limiting to prevent spam
  5. Success/Error Handling: Show proper toast notifications based on actual API response
  6. Navbar Link: Verify the /contact link in Navbar.tsx works correctly (it already exists in the navLinks array)

Files to Modify

  • src/components/Contact.tsx — Update form submission handler to call real API
  • Create: src/app/api/contact/route.ts — New API endpoint
  • .env.example — Add SMTP/email config variables if needed

Tech Stack

  • Email: nodemailer (already installed)
  • Validation: Zod schema validation
  • UI: shadcn/ui form components, toast notifications

Acceptance Criteria

  • Contact form submits to a real API endpoint
  • Emails are sent via nodemailer to admin
  • Server-side validation for all fields
  • Success/error toast notifications
  • Form resets on successful submission
  • Works in both dark and light mode

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew functionality being addedui/uxInterface or user experience improvements

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions