r/FastAPI • u/RestaurantOld68 • 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!
View all comments
Show parent comment
1
u/RestaurantOld68 Dec 22 '24
One problem i have is that for example i have a function that crawls a website then gets all the links of the inside articles and then crawls them aswell. it then compiles a summary of each one. I'm doing these asyncronously because a site might have 20 articles so i want to send all the requests then wait for the responses and then show the results. I was doing all that in my backend but i guess you're suggesting i should create a worker at that spot that will write something to the database that then will be able to be read normally, i guess with a status pending for loading. If yes would you suggest any tools to do that, even then for tasks not to run for an eternity i would have to use async requests