https://github.com/ajsalemo/dapr-distributed-application
A Dapr application made up of a React/Express front-end and a Flask back-end in self-hosted mode with Docker-Compose.
https://github.com/ajsalemo/dapr-distributed-application
backend dapr dapr-component dapr-sidecar docker docker-compose express flask frontend linux python react
Last synced: 3 months ago
JSON representation
A Dapr application made up of a React/Express front-end and a Flask back-end in self-hosted mode with Docker-Compose.
- Host: GitHub
- URL: https://github.com/ajsalemo/dapr-distributed-application
- Owner: Ajsalemo
- Created: 2021-09-14T21:33:38.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-11-15T21:48:45.000Z (over 4 years ago)
- Last Synced: 2025-06-09T17:05:09.414Z (about 1 year ago)
- Topics: backend, dapr, dapr-component, dapr-sidecar, docker, docker-compose, express, flask, frontend, linux, python, react
- Language: JavaScript
- Homepage:
- Size: 890 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dapr-Distributed-Application
A [Dapr](https://dapr.io/) application made up of a React/Express front-end and a Flask back-end in self-hosted mode with Docker-Compose. [Envoy](https://www.envoyproxy.io/docs/envoy/latest/) is used as a proxy to the rest of the containers - with the entrypoint being set to port 10000.
Currently developed to be ran in self-hosted mode.
Project structure:
- `frontend`:
- A React application which utilizes Express to serve it's static files and run server side calls to make use of its Dapr sidecar.
- Uses Daprs [service invocation](https://docs.dapr.io/reference/api/service_invocation_api/) which calls to Daprs `frontend` sidecar. This call invokes the associated endpoint on the `backend` service which is used to retrieve a list of bikes from Azure Database for PostgreSQL.
- Uses Daprs [secrets API](https://docs.dapr.io/reference/api/secrets_api/) to retrieve secrets for a local environment Secret Store(.env file).
- `backend`:
- A Flask application which retrieves data from Azure Database for PostgreSQL and returns this to the `frontend` to be displayed.
- `components`:
- Dapr components are defined in this location.
- `config.yaml` is defined to utilize [Dapr distributed tracing with Zipkin](https://docs.dapr.io/operations/monitoring/tracing/setup-tracing/#zipkin-in-self-hosted-mode)
- `localsecretstore.yaml` is defined to utilize the local environment variable secret store.
- `envoy`:
- Envoy and it's custom `envoy.yaml` is defined in this location.
- The `Dockerfile` is used to pull Envoy's image while `envoy.yaml` has a custom configuration that is copied over to the containers default configuration for this project
- In this example, requests are proxied via Envoy on port 10000 to the other containers(services). Additionally, and example of how to remove headers have been added. So far removing the `x-powered-by` header in the `envoy.yaml`.

