🚀 Need a ready-to-deploy version?
Includes Docker, setup guide, sample responses, and full API structure.
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.
- 📩 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
POST /request-verification
Request:
{
"email": "user@example.com"
}
Response:
{
"message": "Verification code sent"
}
(Printed to server logs for demo/testing)
POST /verify-code
Request:
{
"email": "user@example.com",
"code": "123456"
}
Response (success):
{
"message": "Code verified successfully"
}
Response (failure):
{
"message": "Invalid or expired code"
}
{ "message": "Valid email is required" }
{ "message": "Email and code are required" }
pip install -r requirements.txt
- Flask
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
- ✅ POST to
/request-verification
- ✅ POST to
/verify-code
⚠️ Error messages- 🖥 Console with debug codes
See
/screens/
for Postman screenshots.
Get the ZIP with full project and Docker support:
- Email: talabov.ali72@gmail.com
- Telegram: @talabovali
Need this in another language/stack (Node.js, Go, etc)?
Custom dev available — just reach out.