Skip to content

A simple and effective Flask REST API for sending and verifying 6-digit codes via email. Perfect for MVPs, internal tools, or staging environments that need quick email-based auth.

Notifications You must be signed in to change notification settings

Talabov/Email-Verification-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

📧 Email Verification API


🚀 Need a ready-to-deploy version?

Includes Docker, setup guide, sample responses, and full API structure.

👉 Buy it on Gumroad


A lightweight Flask REST API that handles email-based verification via 6-digit codes. Supports sending and validating codes with in-memory storage. Great for prototypes, internal tools, or staging apps.


✅ Key Features

  • 📩 Request email verification codes
  • 🔐 6-digit code generation with random
  • 🧾 Email & code validation logic
  • 🗃 In-memory storage (reset on restart)
  • 🧪 Modular structure with endpoints split by responsibility
  • ⚙️ Docker-ready, Postman-tested

🚀 Endpoints

Request Verification Code

POST /request-verification

Request:

{
  "email": "user@example.com"
}

Response:

{
  "message": "Verification code sent"
}

(Printed to server logs for demo/testing)


Verify Code

POST /verify-code

Request:

{
  "email": "user@example.com",
  "code": "123456"
}

Response (success):

{
  "message": "Code verified successfully"
}

Response (failure):

{
  "message": "Invalid or expired code"
}

⛔ Error Handling

{ "message": "Valid email is required" }
{ "message": "Email and code are required" }

⚙️ Requirements

pip install -r requirements.txt
  • Flask

🖥 How to Run

python app.py

Server runs at:

http://127.0.0.1:5000/

Or use Docker:

docker build -t email-verification-api .
docker run -p 5000:5000 email-verification-api

🧪 Example Screenshots

  • ✅ POST to /request-verification
  • ✅ POST to /verify-code
  • ⚠️ Error messages
  • 🖥 Console with debug codes

See /screens/ for Postman screenshots.


💼 Ready-to-Use Version

Get the ZIP with full project and Docker support:

👉 Buy it on Gumroad


📬 Contacts


Need this in another language/stack (Node.js, Go, etc)?
Custom dev available — just reach out.

About

A simple and effective Flask REST API for sending and verifying 6-digit codes via email. Perfect for MVPs, internal tools, or staging environments that need quick email-based auth.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy