.
├── app.py
├── blocklist.py
├── client_secret.json
├── db.py
├── docker-compose.yml
├── Dockerfile
├── Google.py
├── instance
│ └── data.db
├── migrations
├── models
│ ├── __init__.py
│ └── user.py
├── README.md
├── requirements.txt
├── resources
│ └── user.py
├── schemas.py
├── settings.py
├── tasks.py
├── templates
│ └── email
│ ├── action.html
│ └── action.original.html
└── token_gmail_v1.pickle
This project demonstrates a simple REST API for user registration with email verification using the Gmail API. The application is built with Flask, SQLAlchemy, SQLite, and Docker.
- POST
/register
: Register a new user and send a welcome email. - GET
/user
: Get a list of all users. - DELETE
/deleteall
: Delete all users from the database.
- Docker
- Docker Compose
-
Clone the repository:
https://github.com/shakil1819/E-Mail-Register---REST-API-Implementation.git
-
Navigate to the project directory:
-
Build and run the Docker containers:
docker-compose up --build
Create a .env
file in the project root and add the following:
REDIS_URL=redis://redis:6379/0
To register a user, make a POST request to /register
with the following JSON payload:
{
"username": "john_doe",
"email": "john.doe@example.com",
"password": "password123"
}
To get a list of all users, make a GET request to /user
.
To delete all users from the database, make a DELETE request to /deleteall
.
- Enable the Gmail API and download the
client_secret.json
. - Place the
client_secret.json
in the project root directory.
- The email templates can be found in the
templates/email
directory. - The Gmail token is stored in
token_gmail_v1.pickle
.
---After Meeting on Apr 1, 2024, 10:30 ~ 11:00---
- Run from Locally installed redis => commit
- Production server (alternative of flask,use gunicorn) => commit
- run rq locally, update task management accordingly => commit
- invalid email error endpoint solve (write endpoint by yourself, if user send invalid mail address, or it is not found, then how it should be identified?) => commit