A simple terminal web application built on React, Flask, and Click.
Okay, this is more complicated now, but shouldn't be too bad.
- Install Nanobox. You'll probably have to make an account. You will need the credentials later.
cdinto repo- Run
nanobox dns add local terminal.local - Open another shell. You need two. You can use tmux or something if you prefer.
- Run
nanobox evar add local IS_DEV=1 - Run
nanobox runin both shells. Wait for the first to finish before running in the second. It will drop you into the container. - Run
cd /app/react_app && npm install && npm startin the second. During dev, you may have to restart this. It sometimes hangs while file listening. - Run
cd /app/flask_app && gunicorn --bind 0.0.0.0:5000 -k flask_sockets.worker app:appin the shell 1. - Navigate to terminal.local:5000 in a browser.
- Dev and restart commands as necessary.
- The react app runs on port 3000
- The flask app runs on port 5000
- The flask app proxies requests to the react app during development. For production, the react app is built and served up directly by the flask app.
- The IS_DEV environment variable triggers the proxy instead of serving the build. If you keep getting a 404, make sure this is set and the react app is running.
- I'm hoping to automate this a little more. I know it's tedious right now.