Skip to content
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

Fix/auth flow #341

Merged
merged 12 commits into from
Feb 25, 2025
63 changes: 32 additions & 31 deletions frontend/.env.sample
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# The backend api endpoint url.
# Data type: String (e.g., http://localhost:8000/api/v1/).
# Default value: http://localhost:8000/api/v1/.
# Data type: String (e.g., "http://localhost:8000/api/v1/").
# Default value: "http://localhost:8000/api/v1/".
# Note: Ensure CORs is enabled in the backend and access is given to your port.
VITE_BASE_API_URL = 'http://localhost:8000/api/v1/'
VITE_BASE_API_URL = "http://localhost:8000/api/v1/"

# The matomo application ID.
# Data type: Positive Integer (e.g., 0).
# Default value: 0.
VITE_MATOMO_ID = 0

# The matomo application domain.
# Data type: String (e.g., subdomain.hotosm.org).
# Default value: subdomain.hotosm.org.
VITE_MATOMO_APP_DOMAIN = "subdomain.hotosm.org"
# Data type: String (e.g., "fair.hotosm.org").
# Default value: "fair.hotosm.org".
VITE_MATOMO_APP_DOMAIN = "fair.hotosm.org"

# The cache duration for polling the backend for updated statistics, in seconds.
# Data type: Positive Integer (e.g., 900).
Expand All @@ -37,14 +37,15 @@ VITE_MAX_TRAINING_AREA_UPLOAD_FILE_SIZE = 5242880

# The current version of the application.
# This is used in the OSM redirect callback when a training area is opened in OSM.
# Data type: String (e.g., v1.1).
# Data type: String (e.g., "v1.1").
# Default value: "v0.1".
VITE_FAIR_VERSION = "v0.1"

# Comma separated hashtags to add to the OSM ID Editor redirection.
# Data type: String (e.g., '#HOT-fAIr, #AI-Assited-Mapping').
# Default value: `FAIR_VERSION`.
VITE_OSM_HASHTAGS =
# Data type: String (e.g., "#HOT-fAIr, #AI-Assited-Mapping").
# Default value: "#HOT-fAIr".
# Note: please add the quotes.
VITE_OSM_HASHTAGS = "#HOT-fAIr"

# The maximum zoom level for the map.
# Data type: Positive Integer (e.g., 22).
Expand All @@ -66,14 +67,14 @@ VITE_MIN_ZOOM_LEVEL_FOR_TRAINING_AREA_LABELS = 18

# The fill color for the training area AOI rectangles.
# Data type: String (e.g., "#247DCACC").
# Note: Colors must be hex codes or valid colors. e.g 'red', 'green', '#fff'.
# Default value: #247DCACC.
# Note: Colors must be hex codes or valid colors. e.g red, green, #fff.
# Default value: "#247DCACC".
VITE_TRAINING_AREAS_AOI_FILL_COLOR = "#247DCACC"

# The outline color for the training area AOI rectangles.
# Data type: String (e.g., "#247DCACC").
# Note: Colors must be hex codes or valid colors. e.g 'red', 'green', '#fff'.
# Default value: #247DCACC.
# Note: Colors must be hex codes or valid colors. e.g red, green, #fff.
# Default value: "#247DCACC".
VITE_TRAINING_AREAS_AOI_OUTLINE_COLOR = "#247DCACC"

# The outline width for the training area AOI rectangles.
Expand All @@ -100,20 +101,20 @@ VITE_TRAINING_AREAS_AOI_LABELS_OUTLINE_WIDTH = 2

# The fill color for the training area AOI labels.
# Data type: String (e.g., "#247DCACC").
# Note: Colors must be hex codes or valid colors. e.g 'red', 'green', '#fff'.
# Default value: #D73434.
# Note: Colors must be hex codes or valid colors. e.g red, green, #fff.
# Default value: "#D73434".
VITE_TRAINING_AREAS_AOI_LABELS_FILL_COLOR = "#D73434"

# The outline color for the training area AOI labels.
# Data type: String (e.g., "#247DCACC").
# Note: Colors must be hex codes or valid colors. e.g 'red', 'green', '#fff'.
# Default value: #D73434.
# Note: Colors must be hex codes or valid colors. e.g red, green, #fff.
# Default value: "#D73434".
VITE_TRAINING_AREAS_AOI_LABELS_OUTLINE_COLOR = "#D73434"


# The remote url to JOSM.
# Data type: String (e.g., "http://127.0.0.1:8111/").
# Default value: http://127.0.0.1:8111/.
# Default value: "http://127.0.0.1:8111/".
VITE_JOSM_REMOTE_URL = "http://127.0.0.1:8111/"


Expand Down Expand Up @@ -148,22 +149,22 @@ VITE_MAX_ACCEPTABLE_POLYGON_IN_TRAINING_AREA_GEOJSON_FILE = 10


# The predictor API URL.
# Data type: String (e.g., https://predictor-dev.fair.hotosm.org/predict/).
# Default value: https://predictor-dev.fair.hotosm.org/predict/.
VITE_FAIR_PREDICTOR_API_URL = https://predictor-dev.fair.hotosm.org/predict/.
# Data type: String (e.g., "https://predictor-dev.fair.hotosm.org/predict/").
# Default value: "https://predictor-dev.fair.hotosm.org/predict/".
VITE_FAIR_PREDICTOR_API_URL = "https://predictor-dev.fair.hotosm.org/predict/".


# The OSM Database status API.
# Data type: String (e.g., https://api-prod.raw-data.hotosm.org/v1/status/).
# Default value: https://api-prod.raw-data.hotosm.org/v1/status/.
VITE_OSM_DATABASE_STATUS_API_URL = https://api-prod.raw-data.hotosm.org/v1/status/
# Data type: String (e.g., "https://api-prod.raw-data.hotosm.org/v1/status/").
# Default value: "https://api-prod.raw-data.hotosm.org/v1/status/".
VITE_OSM_DATABASE_STATUS_API_URL = "https://api-prod.raw-data.hotosm.org/v1/status/"

# The Base URL for OAM Titiler.
# Data type: String (e.g.,https://titiler.hotosm.org).
# Default value: https://titiler.hotosm.org.
VITE_OAM_TITILER_ENDPOINT = https://titiler.hotosm.org/
# Data type: String (e.g.,"https://titiler.hotosm.org").
# Default value: "https://titiler.hotosm.org".
VITE_OAM_TITILER_ENDPOINT = "https://titiler.hotosm.org/"

# The new S3 bucket for OAM aerial imageries.
# Data type: String (e.g.,https://oin-hotosm-temp.s3.us-east-1.amazonaws.com/).
# Default value: https://oin-hotosm-temp.s3.us-east-1.amazonaws.com/.
VITE_OAM_S3_BUCKET_URL = https://oin-hotosm-temp.s3.us-east-1.amazonaws.com/
# Data type: String (e.g.,"https://oin-hotosm-temp.s3.us-east-1.amazonaws.com/").
# Default value: "https://oin-hotosm-temp.s3.us-east-1.amazonaws.com/".
VITE_OAM_S3_BUCKET_URL = "https://oin-hotosm-temp.s3.us-east-1.amazonaws.com/"
9 changes: 7 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"lint": "eslint .",
"preview": "vite preview",
"format": "prettier --write 'src/**/*.{js,jsx,ts,tsx,json,css,scss,md}'",
"format:check": "prettier --check 'src/**/*.{js,jsx,ts,tsx,json,css,scss,md}'"
"format:check": "prettier --check 'src/**/*.{js,jsx,ts,tsx,json,css,scss,md}'",
"test": "vitest",
"coverage": "vitest run --coverage"
},
"dependencies": {
"@shoelace-style/shoelace": "^2.16.0",
Expand Down Expand Up @@ -45,6 +47,7 @@
"@eslint/js": "^9.9.0",
"@tailwindcss/typography": "^0.5.15",
"@tanstack/eslint-plugin-query": "^5.58.1",
"@testing-library/react": "^16.2.0",
"@types/geojson": "^7946.0.14",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
Expand All @@ -62,13 +65,15 @@
"eslint-plugin-react-refresh": "^0.4.9",
"eslint-plugin-tailwindcss": "^3.17.5",
"globals": "^15.9.0",
"jsdom": "^26.0.0",
"postcss": "^8.4.47",
"prettier": "3.3.3",
"tailwindcss": "^3.4.12",
"typescript": "^5.5.3",
"typescript-eslint": "^8.0.1",
"vite": "^5.4.1",
"vite-tsconfig-paths": "^5.0.1"
"vite-tsconfig-paths": "^5.0.1",
"vitest": "^3.0.5"
},
"pnpm": {
"overrides": {
Expand Down
Loading
Loading