Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| devops:xhr:dev:local_dev [2025/10/22 15:08] – [Scripts:] td | devops:xhr:dev:local_dev [2025/10/23 16:00] (current) – [Run] td | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| # Front-end | # Front-end | ||
| + | |||
| ## .env file | ## .env file | ||
| ``` | ``` | ||
| Line 8: | Line 9: | ||
| export API_HOST=http:// | export API_HOST=http:// | ||
| ``` | ``` | ||
| - | + | ### AI agent | |
| - | ## AI agent | + | |
| platform-frontend-app/ | platform-frontend-app/ | ||
| Line 18: | Line 18: | ||
| const url = `${baseUrl}${path} | const url = `${baseUrl}${path} | ||
| ``` | ``` | ||
| + | ### Run | ||
| + | |||
| + | ``` | ||
| + | . .env | ||
| + | npm run dev | ||
| + | ``` | ||
| + | |||
| + | ### dev user | ||
| + | |||
| + | thuy.dang+001@x-hr.co | ||
| + | 1S2N | ||
| + | |||
| + | # Start Agent | ||
| + | Change APP_PORT=8090 in .env to avoid conflict with devlocal services (identity management) | ||
| + | |||
| + | ``` | ||
| + | . .venv/ | ||
| + | uv sync | ||
| + | alembic upgrade head | ||
| + | export PYTHONPATH=$(pwd) | ||
| + | uv run agent | ||
| + | ``` | ||
| + | |||
| # identitiy-management-service | # identitiy-management-service | ||
| + | ## Build option gradle | ||
| + | identity-management-service/ | ||
| + | ``` | ||
| + | gpr.user=thuydang | ||
| + | gpr.key=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 | ||
| + | ``` | ||
| + | ## CORS | ||
| + | |||
| + | ### Allow OPTIONS for CORS | ||
| + | identity-management-service/ | ||
| + | ``` | ||
| + | | ||
| + | ``` | ||
| + | |||
| + | ### Add cors headers | ||
| + | |||
| + | identity-management-service/ | ||
| + | ``` | ||
| + | package co.xhr.identitymanagement.rest.configuration; | ||
| + | |||
| + | import org.springframework.beans.factory.annotation.Value; | ||
| + | import org.springframework.context.annotation.Configuration; | ||
| + | import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||
| + | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
| + | |||
| + | /** | ||
| + | * Web configuration for CORS settings | ||
| + | */ | ||
| + | @Configuration | ||
| + | public class WebConfiguration implements WebMvcConfigurer { | ||
| + | |||
| + | @Value(" | ||
| + | private String frontendBaseUrl; | ||
| + | |||
| + | @Value(" | ||
| + | private String frontendDomain; | ||
| + | |||
| + | @Override | ||
| + | public void addCorsMappings(CorsRegistry registry) { | ||
| + | registry.addMapping("/ | ||
| + | .allowedOriginPatterns( | ||
| + | frontendBaseUrl, | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ) | ||
| + | .allowedMethods(" | ||
| + | .allowedHeaders( | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | ) | ||
| + | .allowCredentials(true) | ||
| + | .maxAge(3600); | ||
| + | } | ||
| + | } | ||
| + | ``` | ||
| Line 130: | Line 226: | ||
| echo "Demo database setup completed!" | echo "Demo database setup completed!" | ||
| ``` | ``` | ||
| + | ### Troubleshooting | ||
| + | #### Pass email form: | ||
| + | |||
| + | ``` | ||
| + | curl -X POST http:// | ||
| + | -H " | ||
| + | -d ' | ||
| + | |||
| + | ``` | ||
| + | |||
| + | #### Get Token and me | ||
| + | |||
| + | ``` | ||
| + | TOKEN=$(curl -X POST http:// | ||
| + | echo $TOKEN | ||
| + | curl http:// | ||
| + | ``` | ||
| + | |||