-
Notifications
You must be signed in to change notification settings - Fork 1
Use .env file for environment variable setup #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # ============================================================================== | ||
| # Workspaces Frontend — Local Development Environment | ||
| # ============================================================================== | ||
| # Copy this file to .env and adjust values as needed: | ||
| # cp .env.example .env | ||
| # | ||
| # Nuxt automatically loads .env files. No need to manually export these. | ||
| # All VITE_* variables are baked into the client bundle at build time. | ||
| # ============================================================================== | ||
|
|
||
| # --- TDEI Platform APIs (auth, datasets, conversion) ------------------------- | ||
| # Point these at the TDEI dev environment. Tokens from one environment (dev, | ||
| # stage, prod) are NOT interchangeable — all components must target the same | ||
| # environment. | ||
| VITE_TDEI_API_URL=https://api-dev.tdei.us/api/v1/ | ||
| VITE_TDEI_USER_API_URL=https://portal-api-dev.tdei.us/api/v1/ | ||
|
|
||
| # --- Workspaces Backend ------------------------------------------------------ | ||
| # The workspaces-backend service, see: https://github.com/TaskarCenterAtUW/workspaces-backend | ||
| # If running locally, edit `nuxt.config.ts` devProxy settings and use local port: | ||
| # VITE_API_URL=http://localhost:3000/api/v1/ | ||
| # VITE_OSM_URL=http://localhost:3000/ | ||
|
|
||
| # Or point at the shared dev instance if you don't need to run it locally. | ||
| VITE_API_URL=https://api.workspaces-dev.sidewalks.washington.edu/api/v1/ | ||
| VITE_OSM_URL=https://osm.workspaces-dev.sidewalks.washington.edu/ | ||
|
|
||
|
Comment on lines
+18
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add missing required env key:
Proposed fix # Or point at the shared dev instance if you don't need to run it locally.
VITE_API_URL=https://api.workspaces-dev.sidewalks.washington.edu/api/v1/
+VITE_NEW_API_URL=https://api.workspaces-dev.sidewalks.washington.edu/api/v1/
VITE_OSM_URL=https://osm.workspaces-dev.sidewalks.washington.edu/🤖 Prompt for AI Agents |
||
| # --- Embedded Editors --------------------------------------------------------- | ||
| # Rapid editor (OSW editing) and Pathways editor (GTFS Pathways editing). | ||
| # These are standalone apps hosted separately. | ||
| VITE_RAPID_URL=https://rapid.workspaces-dev.sidewalks.washington.edu/ | ||
| VITE_PATHWAYS_EDITOR_URL=https://pathways.workspaces-dev.sidewalks.washington.edu/ | ||
|
|
||
| # --- Schema / Example URLs (rarely need to change) --------------------------- | ||
| VITE_IMAGERY_SCHEMA=https://raw.githubusercontent.com/TaskarCenterAtUW/asr-imagery-list/refs/heads/main/schema/schema.json | ||
| VITE_IMAGERY_EXAMPLE_URL=https://github.com/TaskarCenterAtUW/asr-imagery-list/blob/main/examples/example.json | ||
| VITE_LONG_FORM_QUEST_SCHEMA=https://raw.githubusercontent.com/TaskarCenterAtUW/asr-quests/refs/heads/main/schema/schema.json | ||
| VITE_LONG_FORM_QUEST_EXAMPLE_URL=https://raw.githubusercontent.com/TaskarCenterAtUW/asr-quests/refs/heads/main/docs/quest-definition/example.json | ||
|
|
||
| # --- Sentry (optional for local dev) ----------------------------------------- | ||
| # VITE_SENTRY_AUTH_TOKEN= | ||
| # VITE_SENTRY_DSN= | ||
|
|
||
| # --- Build metadata ----------------------------------------------------------- | ||
| CODE_VERSION=local | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -6,33 +6,10 @@ Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introdu | |||||
|
|
||||||
| ## Dev Setup | ||||||
|
|
||||||
| ``` | ||||||
| # set these e.g. to the dev TDEI instance--note: any tokens you get from these hosts must match the environment for other components | ||||||
| # e.g. you can't use dev TDEI KeyCloak JWT tokens in stage or production environments. | ||||||
| export VITE_TDEI_API_URL=https://api-dev.tdei.us/api/v1/ | ||||||
| export VITE_TDEI_USER_API_URL=https://portal-api-dev.tdei.us/api/v1/ | ||||||
|
|
||||||
| ### | ||||||
| # this accesses a local version of the workspaces-backend running on port 8000 | ||||||
| # export VITE_API_URL=http://localhost:8000/api/v1/ | ||||||
| # export VITE_OSM_URL=http://localhost:8000/ | ||||||
|
|
||||||
| # ***** USE THE ABOVE OR THE BELOW, NOT BOTH! *** | ||||||
|
|
||||||
| export VITE_API_URL=https://api.workspaces-dev.sidewalks.washington.edu/api/v1/ | ||||||
| export VITE_OSM_URL=https://osm.workspaces-dev.sidewalks.washington.edu/ | ||||||
| ### | ||||||
|
|
||||||
| # probably want to leave these as-is | ||||||
| export VITE_RAPID_URL=https://rapid.workspaces-dev.sidewalks.washington.edu/ | ||||||
| export VITE_PATHWAYS_EDITOR_URL=https://pathways.workspaces-dev.sidewalks.washington.edu/ | ||||||
|
|
||||||
| # probably don't need to change any of these | ||||||
| export CODE_VERSION="local" | ||||||
| export VITE_IMAGERY_SCHEMA=https://raw.githubusercontent.com/TaskarCenterAtUW/asr-imagery-list/refs/heads/main/schema/schema.json | ||||||
| export VITE_IMAGERY_EXAMPLE_URL=https://github.com/TaskarCenterAtUW/asr-imagery-list/blob/main/examples/example.json | ||||||
| export VITE_LONG_FORM_QUEST_SCHEMA=https://raw.githubusercontent.com/TaskarCenterAtUW/asr-quests/refs/heads/main/schema/schema.json | ||||||
| export VITE_LONG_FORM_QUEST_EXAMPLE_URL=https://raw.githubusercontent.com/TaskarCenterAtUW/asr-quests/refs/heads/main/docs/quest-definition/example.json | ||||||
| ```zsh | ||||||
| # Copy `.env.example` to `.env` and adjust values as needed. | ||||||
| # Nuxt automatically loads .env files. No need to manually export these. | ||||||
| cp .env.example .env | ||||||
|
|
||||||
| # install deps (first time only) | ||||||
| npm install | ||||||
|
|
@@ -43,4 +20,5 @@ npm run dev | |||||
|
|
||||||
| ## Troubleshooting | ||||||
|
|
||||||
| If you run ```npm run dev``` and nothing happens, check that you've set your "exports" as above. Undefined environment variables are not handled gracefully right now. | ||||||
| If you run `npm run dev` and nothing happens, double check your `.env` file. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use hyphenated wording in troubleshooting text. Use “double-check” for correct phrasing in user-facing docs. Proposed fix-If you run `npm run dev` and nothing happens, double check your `.env` file.
+If you run `npm run dev` and nothing happens, double-check your `.env` file.📝 Committable suggestion
Suggested change
🧰 Tools🪛 LanguageTool[grammar] ~23-~23: Use a hyphen to join words. (QB_NEW_EN_HYPHEN) 🤖 Prompt for AI Agents |
||||||
| Undefined environment variables are not handled gracefully right now. | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Local-backend instructions are inconsistent with the proxy guidance.
Line 20 says to edit
nuxt.config.tsproxy settings, but the sample values then point directly tolocalhost:3000. This is confusing for setup and can route traffic incorrectly depending on local ports.Proposed clarification
📝 Committable suggestion
🤖 Prompt for AI Agents