r/FastAPI • • Dec 22 '24

Question Pivot from Flask

Hey everyone,

I recently built an app using Flask without realizing it’s a synchronous framework. Because I’m a beginner, I didn’t anticipate the issues I’d face when interacting with multiple external APIs (OpenAI, web crawlers, etc.). Locally, everything worked just fine, but once I deployed to a production server, the asynchronous functions failed since Flask only supports WSGI servers.

Now I need to pivot to a new framework—most likely FastAPI or Next.js. I want to avoid any future blockers and make the right decision for the long term. Which framework would you recommend?

Here are the app’s key features:

  • Integration with Twilio
  • Continuous web crawling, then sending data to an LLM for personalized news
  • Daily asynchronous website crawling
  • Google and Twitter login
  • Access to Twitter and LinkedIn APIs
  • Stripe payments

I’d love to hear your thoughts on which solution (FastAPI or Next.js) offers the best path forward. Thank you in advance!

10 Upvotes

12 comments sorted by

View all comments

Show parent comment

1

u/lozanov1 Dec 26 '24

It makes more sense to have a script that does this on a schedule and saves the result in a db/file. Then your API just geta the data from the db/file and serves is to the end user.

1

u/RestaurantOld68 Dec 26 '24

Yes that’s what I’m doing currently