This project uses Create-React-App, Flask and SQLite.
You will need to be running two scrips in two separate terminal tabs / windows.
One will be for for running the Flask server, and the other for the React server.
First, make sure you drop into the /api
directory, create and then run a virtual environment:
python -m venv venv && source venv/bin/activate
(For future sessions, only source venv/bin/activate
will be needed to start the virtual environment. I recommend aliasing this command!)
Then install all dependencies pip install -r requirements.txt
(only the first time)
In your other Terminal window, in the root of the project directory, run npm install
(only the first time)
Ensure that your virtual environment is running (You should see a (venv)
at the end of your prompt)
Then move back to the root of the project and run
npm run start-api
This will run the Flask server on port 5000
Run npm run start
This will start your React dev server on port 3000.
You should now be able to see the app in the browser.
Use ctrl + C
to stop the server
Run deactivate
to stop the virtual environment. You do not need to move into the /api
directory first. (You do need to in order to start the virtual environment, though.)
Use ctrl + C
to stop the server.
Have fun! 😎 🎉 💻