Buuntu / fastapi-react

🚀 Cookiecutter Template for FastAPI + React Projects. Using PostgreSQL, SQLAlchemy, and Docker
MIT License
2.18k stars 346 forks source link

Add smpt server for password emails #59

Open Buuntu opened 4 years ago

Buuntu commented 4 years ago

There should be routes that trigger an email for "forgot" and "reset" password options. These can be celery tasks but probably need a separate container for a simple SMTP server in order to send the emails.

The fullstack Vue project has an example of a containerized SMTP server.

F1r3Hydr4nt commented 4 years ago

The fullstack Vue app relies on a third party provider, but contains all the code to implement that. You need a signup page, I sort of threw one together earlier but didn't implement the endpoint yet. Just getting used to the cookiecutting so far, do I merely add the changes to the dev repo to the cookie cutter top level when they work?

Buuntu commented 4 years ago

Thanks, if you want to take a stab at it that would be great! For the signup page, you can probably just reuse the login page with a few changes. Do you want me to assign this ticket to you?

Yeah for the SMTP server, the simpler the better. The Vue project has lots of email templates and might be overly complex for this, but if it's easy to copy+paste that is fine.

So the way I've been doing it for local development, which may not be the best way, is to make the changes at the top level and then run ./scripts/test_local.sh. It takes a minute to generate and start the docker-compose files but then you can see the changes in your local server once it does since this both starts the docker containers and runs all of the tests. I am curious myself if there is a better way to do this though, I think that's how the Vue project is setup and I haven't been able to find a better suggestion in the cookiecutter docs. The time it takes to build webpack is also very slow so it's not ideal.

For frontend stuff what you suggested might be better since this iteration cycle can take a while. For the backend it's a bit better since you can just write tests and they are very quick to run.

F1r3Hydr4nt commented 4 years ago

I can take a look at implementing a 'signup' endpoint and associated form page, sure!

pigeonflight commented 3 years ago

What's the status of this? @freddiehonohan @Buuntu

JasonHoku commented 3 years ago

@pigeonflight a quick fix option for now, as I've done in other works could be configuring EmailJS with gmail SMTP to read and send variables from react.