TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How to develop React+Flask locally in a way that can easily be deployed?

9 pointsby RSchaefferalmost 3 years ago
I&#x27;m a newcomer to fullstack development with no experience in infra. I want to make a web app based on a React frontend and Flask backend (with a Postgres database). What are people&#x27;s recommendations for developing locally, in a way that can be easily &amp; immediately deployed?<p>A lot of the tutorials I can find either (a) don&#x27;t mention deployment, or (b) treat it like a final step at the end, rather than something that needs to be done on a semi-frequent basis.

6 comments

smt88almost 3 years ago
Don&#x27;t worry about your deployment being directly related to your dev environment. That&#x27;s a good goal, but most people make do without it.<p>You can use Vagrant or Docker[1] locally and then deploy somewhere easy like Render.com[2][3].<p>Since you&#x27;re new to fullstack, you may have an easier time with Next.js (definitely use the TypeScript option) because then you&#x27;re only learning&#x2F;using a single language in a single repository for both frontend and backend.<p>1. <a href="https:&#x2F;&#x2F;blog.miguelgrinberg.com&#x2F;post&#x2F;how-to-dockerize-a-react-flask-project" rel="nofollow">https:&#x2F;&#x2F;blog.miguelgrinberg.com&#x2F;post&#x2F;how-to-dockerize-a-reac...</a><p>2. <a href="https:&#x2F;&#x2F;render.com&#x2F;docs&#x2F;deploy-flask" rel="nofollow">https:&#x2F;&#x2F;render.com&#x2F;docs&#x2F;deploy-flask</a><p>3. <a href="https:&#x2F;&#x2F;render.com&#x2F;docs&#x2F;deploy-create-react-app" rel="nofollow">https:&#x2F;&#x2F;render.com&#x2F;docs&#x2F;deploy-create-react-app</a>
评论 #31802618 未加载
roflyearalmost 3 years ago
There is a good reason that tutorials treat it that way: it should be treated that way, IMO.<p>I don&#x27;t agree that your dev environment should perfectly match whatever environment you&#x27;re deploying to. It is good to do some things: same version of Python, same DB and same version, hopefully same OS, but that is rarely something you always have control over. You do, so sure, do the best you can here.<p>Rather, I would suggest you configure your development environment to best facilitate development, especially for learning. On some apps maybe you will need to have some kind of parity environment (mostly this is DB level stuff, then specific Python version, then OS version, in my experience problems rarely if ever come up that aren&#x27;t in these categories) but it is rare, and you definitely do not need this for learning.<p>The easiest thing and best thing for learning may be to get a cheap VM and set up your own environment. If you do want to learn a tool like Docker, sure - but I don&#x27;t suggest developing in Docker. It is more of a pain than it is worth.
JoeCortopassialmost 3 years ago
It can be really simple on the cloud. Everything I&#x27;m describing might even fit on both platforms free tier<p>For Flask, follow this tutorial. It&#x27;s the absolute simplest I&#x27;ve come across: <a href="https:&#x2F;&#x2F;cloud.google.com&#x2F;run&#x2F;docs&#x2F;quickstarts&#x2F;build-and-deploy&#x2F;deploy-python-service" rel="nofollow">https:&#x2F;&#x2F;cloud.google.com&#x2F;run&#x2F;docs&#x2F;quickstarts&#x2F;build-and-depl...</a><p>For React, follow this tutorial: <a href="https:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;AmazonS3&#x2F;latest&#x2F;userguide&#x2F;HostingWebsiteOnS3Setup.html" rel="nofollow">https:&#x2F;&#x2F;docs.aws.amazon.com&#x2F;AmazonS3&#x2F;latest&#x2F;userguide&#x2F;Hostin...</a><p>But instead of the files it tells you to create, just use create-react-app, and run &quot;npm run build&quot;. Then take the directory it creates (hint: it&#x27;s named &quot;build&quot;), and drop all it&#x27;s contents in your s3 bucket
FractalHQalmost 3 years ago
If your goal is to stand up a hobby app asap as opposed to learn backend tech, you can have a serverless app hooked up to a Postgres DB in minutes all for free with Cloudflare Pages and Supabase. I’ve built many Sveltekit Apps this way in weekends.
GVRValmost 3 years ago
If you&#x27;re just starting out, and want to focus on the frameworks right now without worrying about infrastructure _but_ still want something to show someone, start with replit.com
aristofunalmost 3 years ago
Aim for docker -&gt; docker compose -&gt; docker swarm<p>The easiest path for tiny dev teams