Configuration
Configuration model
This project is configured primarily through Vite environment variables and a small number of repository-level conventions.
The canonical frontend env types live in:
src/typings/vite-env.d.ts
Core application variables
These variables define the app shell and router behavior:
VITE_BASE_URL: frontend base pathVITE_APP_RUNTIME:backendordemoVITE_APP_TITLE: document title / product titleVITE_APP_DESC: app descriptionVITE_ROUTER_HISTORY_MODE:hash,history, ormemoryVITE_ROUTE_HOME: frontend default route key
Backend service variables
These variables control how the frontend talks to backend services:
VITE_SERVICE_BASE_URL: primary backend base URLVITE_OTHER_SERVICE_BASE_URL: optional JSON map of secondary servicesVITE_SERVICE_SUCCESS_CODE: backend success codeVITE_SERVICE_LOGOUT_CODES: codes that force logoutVITE_SERVICE_MODAL_LOGOUT_CODES: codes that force modal logoutVITE_SERVICE_EXPIRED_TOKEN_CODES: codes that trigger token refresh logicVITE_HTTP_PROXY: enable local Vite proxy mode in development
When VITE_APP_RUNTIME=demo, the request layer is intercepted by the in-app demo backend. The same application shell still runs, but the runtime no longer depends on a live Laravel API.
These values are consumed by:
src/service/request/index.tssrc/service/request/context.tssrc/utils/service.ts
Auth and route variables
These variables affect route generation and permission behavior:
VITE_AUTH_ROUTE_MODE:staticordynamicVITE_STATIC_SUPER_ROLE: special role for static-route modeVITE_MENU_ICON: fallback menu iconVITE_LOGIN_CODE_LOGIN_ENABLED: expose the template-only verification-code login moduleVITE_LOGIN_BIND_WECHAT_ENABLED: expose the template-only WeChat bind module
If you pair this frontend with Obsidian Admin Laravel, the intended mode is usually backend-driven route and menu metadata.
Both login placeholder variables should stay N unless you have implemented and tested a real backend contract for those flows.
Realtime variables
Realtime behavior is optional and controlled by:
VITE_REALTIME_ENABLEDVITE_REVERB_HOSTVITE_REVERB_PORTVITE_REVERB_SCHEMEVITE_REVERB_APP_KEY
These are used by:
src/service/websocket/index.ts
UX and storage variables
These are useful but not deployment-critical:
VITE_STORAGE_PREFIXVITE_AUTOMATICALLY_DETECT_UPDATEVITE_ICONIFY_URLVITE_SOURCE_MAPVITE_PROXY_LOGVITE_DEVTOOLS_LAUNCH_EDITOR
Recommended configuration discipline
Keep these rules:
- treat
src/typings/vite-env.d.tsas the canonical env contract - do not add undocumented
VITE_*variables casually - do not encode backend-specific behavior in random page code
- keep backend API behavior in the request layer or API facades
- update docs when a new runtime-critical variable is introduced
Configuration review before release
Before shipping a release, confirm:
- base URL matches deployment path
- backend service URL matches the deployed environment
- success / logout / refresh codes match backend behavior
- realtime variables are explicitly enabled or intentionally disabled
- generated API contract is in sync with the deployed backend