Skip to content

ContactFast — a FastAPI-powered email submission endpoint for frontend-only websites. Add a simple snippet to your contact form and start receiving messages directly in your inbox.

License

Notifications You must be signed in to change notification settings

Adelodunpeter25/ContactFast

Repository files navigation

ContactFast

A FastAPI-based contact form API that requires no signup or configuration for users. Just copy-paste the form code snippet and you are done!

🚀 Features

  • Zero Setup - No account creation, no API keys, no dashboard
  • Auto Verification - First submission automatically verifies your domain
  • Secure - Rate limiting, origin validation, spam prevention
  • Multi-Tenant - Unlimited users can use the same API
  • Simple Integration - No backend, no third party integration

🎯 How It Works

  1. User copies code snippet for their desired framework
  2. Changes to email to their own
  3. Adds form to their website
  4. First submission auto-verifies the domain and sends:
    • The contact form submission
    • A verification confirmation email
  5. All future submissions work automatically

📋 For Users (How to Use)

Step 1: Copy Your Desired Code Snippet

View All Code Snippets

Step 2: Customize

  • Change to to your email address
  • Update website_name with your site name
  • Update website_url with your site URL

Step 3: Test

  • Submit the form once
  • Check your email for:
    • The submitted contact form
    • A verification confirmation email
  • Done! Your domain is automatically verified and all future submissions will arrive in your inbox.

🛠️ Tech Stack

  • FastAPI
  • SQLAlchemy
  • PostgreSQL (Database)
  • Resend (Email service)
  • Pydantic (Data validation)

🔧 Setup (For Developers)

1. Clone and Install

# Clone the repository
git clone https://github.com/Adelodunpeter25/ContactFast.git
cd ContactFast

# Install dependencies using uv
uv sync

# For development with code quality tools
uv sync --extra dev

2. Environment Variables

Create a .env file:

RESEND_API_KEY=your_resend_api_key_here
FROM_EMAIL=noreply@yourdomain.com
BASE_URL=http://localhost:8000
DATABASE_URL=postgresql://user:password@host:port/database

3. Run Locally

# Activate virtual environment and run
uv run uvicorn main:app --reload

API will be available at http://localhost:8000

4. Development Tools

# Code formatting
uv run black .

# Linting
uv run ruff check .

# Type checking
uv run mypy .

# Auto-fix linting issues
uv run ruff check . --fix

📡 API Endpoints

Submit Contact Form

POST /submit

Request Body:

{
  "to": "recipient@example.com",
  "website_name": "My Website",
  "website_url": "https://mywebsite.com",
  "name": "John Doe",
  "email": "john@example.com",
  "subject": "Inquiry",
  "message": "Hello, I have a question..."
}

First Submission Response:

{
  "message": "Form submitted successfully! Domain auto-verified.",
  "domain": "example.com",
  "resend_response": {...}
}

Subsequent Submissions:

{
  "message": "Form submitted successfully!",
  "resend_response": {...}
}

📝 License

MIT License

🤝 Contributing

Contributions welcome! Please open an issue or PR.


Built by developers for developers who want simple contact forms without the hassle.

About

ContactFast — a FastAPI-powered email submission endpoint for frontend-only websites. Add a simple snippet to your contact form and start receiving messages directly in your inbox.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •