This repository contains a sample application consisting of a React frontend and Flask backend. The Flask backend simulates a call to an API (using httbin in a Docker container) and there are ways to emulate different response codes or delays. The app reports Sentry Errors, Traces and Metrics.
- Download and install Python >= 3 if you haven't already.
- Download and install a recent Node.js version if you haven't already.
- Download and install Docker Desktop if you haven't already.
- Clone the repository and open it in Visual Studio Code.
- Install the Python Language Support extension in Visual Studio Code.
- Go to "View -> Command Palette" ans search for "Python: Create Environment".
- Select ".venv" and follow the instructions
- select a Python interpreter from the list
- confirm to let all extensions to be installed.
- Rename
.env-sample
to.env
. - Create a Sentry project for React and for Flask and enter their DSNs into their respective properties in
.env
. - Open a separate terminal run
cd backend
pip install -r ./requirements.txt
- Open a terminal in Visual Studio Code and run
cd frontend
npm install
npm start
- In another separate terminal, type
./start-third-party.sh
.
This should open the browser at http://127.0.0.1:3000.
Open backend/app.py
- at around line 30 you find the call to the third party service. The inline comments contain examples how to simulate different problems, like delays or an error 500.