full-stack-fastapi-template icon indicating copy to clipboard operation
full-stack-fastapi-template copied to clipboard

♻️ Send account creation email asynchronously via BackgroundTasks

Open saleemasekrea000 opened this issue 11 months ago • 2 comments

Making it a background task improves responsiveness and user experience. For future If you need to perform heavy background computation and you don't necessarily need it to be run by the same process (for example, you don't need to share memory, variables, etc), you might benefit from using other bigger tools like Celery According to the FastAPI docs : https://fastapi.tiangolo.com/tutorial/background-tasks/?h=#technical-details

saleemasekrea000 avatar Feb 20 '25 19:02 saleemasekrea000

@alejsdev Hi, is there any kind of feedback? It's been a long time...

saleemasekrea000 avatar May 22 '25 18:05 saleemasekrea000

Hi @YuriiMotov , This is my first-ever open-source contribution. I’d like to propose making background task support optional:

  • Introduce a boolean USE_CELERY in config.py.
  • If USE_CELERY=True, the developer can start Celery + RabbitMQ via a Docker Compose profile, for example:
    docker-compose --profile celery up
  • If USE_CELERY=False, only the backend runs:
    docker-compose up

is this approach acceptable?

jishnu70 avatar Oct 25 '25 14:10 jishnu70