Skip to content

Commit f73b303

Browse files
committed
changed description env.example for backend
1 parent a237530 commit f73b303

File tree

1 file changed

+36
-17
lines changed

1 file changed

+36
-17
lines changed

README.md

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,42 @@ The frontend implements a caching mechanism for the public health check endpoint
8686

8787
## Environment Variables
8888

89-
This project uses environment variables for configuration, particularly for OIDC authentication details. Template files are provided:
90-
91-
- `.env.example` (at the project root, for backend configuration)
92-
- `frontend/.env.example` (in the frontend directory, for frontend configuration)
93-
94-
These files list the required variables but contain placeholder values.
95-
96-
**To configure your local environment:**
97-
98-
1. **Copy the templates:**
99-
```bash
100-
cp .env.example .env
101-
cp frontend/.env.example frontend/.env
102-
```
103-
2. **Edit the `.env` files:** Open the newly created `.env` files (in the root directory and the `frontend/` directory) and replace the placeholder values with your actual Zitadel application details (Issuer URI, Client IDs, Client Secret). Refer to `docs/auth-config.md` for details on each variable.
104-
105-
**Important:** The `.env` files contain sensitive information and are listed in `.gitignore`. **Never commit `.env` files to the Git repository.**
89+
This project uses environment variables for configuration, particularly for OIDC authentication details.
90+
91+
**Frontend Configuration (Vite):**
92+
93+
- The frontend uses a standard `.env` file located at `frontend/.env`.
94+
- A template file `frontend/.env.example` lists the required variables (like `VITE_ZITADEL_ISSUER_URI`, `VITE_ZITADEL_CLIENT_ID`).
95+
- **To configure:**
96+
1. Copy `frontend/.env.example` to `frontend/.env`.
97+
2. Edit `frontend/.env` with your actual Zitadel **frontend** application details.
98+
99+
**Backend Configuration (Spring Boot):**
100+
101+
- The backend reads configuration from **actual environment variables** set in your system or terminal session. It **does not** automatically read from `.env` files.
102+
- The `.env.example` file in the project root serves as a **template** listing the variables the backend expects (like `ZITADEL_AUTHDEMO_ISSUER_URI`, `ZITADEL_AUTHDEMO_BACKEND_CLIENT_ID`, `ZITADEL_AUTHDEMO_CLIENT_SECRET`).
103+
- **To configure:**
104+
1. Refer to `.env.example` for the required variable names.
105+
2. Set these variables in your environment *before* launching the backend. Examples:
106+
* **Linux/macOS (bash/zsh):**
107+
```bash
108+
export ZITADEL_AUTHDEMO_ISSUER_URI="https://your-issuer..."
109+
export ZITADEL_AUTHDEMO_BACKEND_CLIENT_ID="your-backend-id"
110+
export ZITADEL_AUTHDEMO_CLIENT_SECRET="your-secret"
111+
cd backend
112+
./mvnw spring-boot:run
113+
```
114+
* **Windows (PowerShell):**
115+
```powershell
116+
$env:ZITADEL_AUTHDEMO_ISSUER_URI="https://your-issuer..."
117+
$env:ZITADEL_AUTHDEMO_BACKEND_CLIENT_ID="your-backend-id"
118+
$env:ZITADEL_AUTHDEMO_CLIENT_SECRET="your-secret"
119+
cd backend
120+
./mvnw spring-boot:run
121+
```
122+
3. Alternatively, configure them via your IDE's run configuration settings.
123+
124+
**Important:** Environment variables (especially secrets like `ZITADEL_AUTHDEMO_CLIENT_SECRET`) should be handled securely. The `.env` files are listed in `.gitignore` and should **never be committed** to the repository.
106125
107126
108127
## Running with OIDC

0 commit comments

Comments
 (0)