refactor code & fixed location

This commit is contained in:
Warunee Tamkoo 2026-04-27 19:21:23 +07:00
parent 41c1aa8e45
commit 487a6b520e
23 changed files with 566 additions and 145 deletions

View file

@ -7,7 +7,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
This is an HRMS (Human Resource Management System) check-in/check-out web application built for the Bangkok Metropolitan Administration (BMA). The application allows employees to record their work attendance using geolocation verification and camera features.
**Tech Stack:**
- Vue 3 with Composition API and TypeScript
- Vue 3 with Composition API and TypeScript 4.7.4
- Vite for build tooling
- Quasar Framework for UI components
- Pinia for state management
@ -122,6 +122,12 @@ Required in `.env.production`:
- `VITE_API_URI_CONFIG` - Production API base URL
- `VITE_URL_SSO` - Keycloak SSO logout URL
- `VITE_URL_USER` - User service URL for redirects
- `VITE_URL_LANDING` - Landing page URL
**Note:** `.env.local` uses `:` instead of `=` for variable assignment (non-standard format that works with the current setup)
- `VITE_API_URI_CONFIG` - Production API base URL
- `VITE_URL_SSO` - Keycloak SSO logout URL
- `VITE_URL_USER` - User service URL for redirects
### PWA Configuration
@ -130,6 +136,30 @@ Required in `.env.production`:
- Icons: 192x192 and 512x512 PNG
- Service worker registered in `src/registerServiceWorker.ts`
### Import Aliases
- `@` is configured as an alias for the `src/` directory
- Use this for all imports from within the source directory
### Environment Variable Substitution (Docker)
The Docker build uses a multi-stage pattern:
1. **Build stage**: Node.js Alpine builds the static assets with `npm run build`
2. **Production stage**: nginx serves the static files
- Environment variables (`VITE_API_URI_CONFIG`, `VITE_URL_SSO`, `VITE_URL_LANDING`, `VITE_URL_USER`) are substituted at container runtime via `entrypoint.sh` using `sed`
- Built JS files contain placeholder values that get replaced with actual values at startup
### Testing Patterns
- Unit tests: `*.spec.{js,ts}` - Run with Vitest in jsdom environment
- E2E tests: `*.cy.{js,ts}` - Run with Cypress
- E2E test server runs on port 4173 (via `start-server-and-test`)
### HTTP Interceptor Behavior
- The axios interceptor in `http.ts` detects 401/403 responses but automatic logout is currently disabled (commented out)
- 401 handling is done manually in `messageError()` from the mixin store
## Development Notes
**When adding new features:**