danielkhan / funnel-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Funnel Sample Application

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.

Setup

  1. Download and install Python >= 3 if you haven't already.
  2. Download and install a recent Node.js version if you haven't already.
  3. Download and install Docker Desktop if you haven't already.
  4. Clone the repository and open it in Visual Studio Code.
  5. Install the Python Language Support extension in Visual Studio Code.
  6. Go to "View -> Command Palette" ans search for "Python: Create Environment".
  7. Select ".venv" and follow the instructions
  • select a Python interpreter from the list
  • confirm to let all extensions to be installed.
  1. Rename .env-sample to .env.
  2. Create a Sentry project for React and for Flask and enter their DSNs into their respective properties in .env.
  3. Open a separate terminal run
  • cd backend
  • pip install -r ./requirements.txt
  1. Open a terminal in Visual Studio Code and run
  • cd frontend
  • npm install
  • npm start
  1. In another separate terminal, type ./start-third-party.sh.

This should open the browser at http://127.0.0.1:3000.

Emulating Problems

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.

About


Languages

Language:JavaScript 52.6%Language:CSS 25.8%Language:HTML 10.7%Language:Python 10.6%Language:Shell 0.3%