This is the starter for the Flask React project.
-
Clone this repository (only this branch)
git clone https://github.com/appacademy-starters/python-project-starter.git
-
Install dependencies
pipenv install --dev -r dev-requirements.txt && pipenv install -r requirements.txt
-
Create a .env file based on the example with proper settings for your development environment
-
Setup your PostgreSQL user, password and database and make sure it matches your .env file
-
Get into your pipenv, migrate your database, seed your database, and run your flask app
pipenv shell
flask db upgrade
flask seed all
flask run
-
To run the React App in development, checkout the README inside the
react-app
directory.
IMPORTANT! psycopg2-binary MUST remain a dev dependency because you can't install it on apline-linux. There is a layer in the Dockerfile that will install psycopg2 (not binary) for us.
-
Make sure you have the Microsoft Remote - Containers extension installed.
-
Make sure you have Docker installed on your computer.
-
Clone the repository (only this branch)
git clone https://github.com/appacademy-starters/python-project-starter.git
-
Open the repo in VS Code.
-
Click "Open in Container" when VS Code prompts to open container in the bottom right hand corner.
-
Be Patient! The initial install will take a LONG time, it's building a container that has postgres preconfigured and even installing all your project dependencies. (For both flask and react!)
Note: This will take much less time on future starts because everything will be cached.
-
Once everything is up, be sure to make a
.env
file based on.env.example
in both the root directory and the react-app directory before running your app. -
Get into your pipenv, migrate your database, seed your database, and run your flask app
pipenv shell
flask db upgrade
flask seed all
flask run
-
To run the React App in development, checkout the README inside the
react-app
directory.