This repository is a Vite + React + TypeScript monorepo (npm workspaces). It contains reusable UI packages and a frontend application.
Key points
- Workspace packages:
packages/components-shared,packages/ui,packages/utils,packages/frontend-app. - Root package scripts build and manage workspaces; most package builds use
tsc -b.
Prerequisites
- Node.js (recommend v18+)
- npm (or yarn)
Quick start (development)
# from repo root
npm install
npm run dev:app # runs the frontend app (workspace)Build (production)
npm run build # builds types and runs vite build
npm run build:packages # build packages (may be required in CI)Useful scripts
npm run dev— start vite at root (general dev)npm run dev:app— startpackages/frontend-appdev servernpm run build— typecheck and buildnpm run lint/npm run lint:fix— eslintnpm run format— prettier
-
Development (local): Run the frontend dev server on the host for fast iteration. Using
tmuxor a process manager is recommended for long-running sessions:cd frontend tmux new -s frontend npm run dev -
Container and deploy to Kubernetes: To deploy the frontend to a cluster:
- Run
npm run buildin the monorepo root orpackages/frontend-appto produce static files. - Build a Docker image using the project Dockerfile or a custom Dockerfile.
- Set the image name to your registry (e.g.
registry:5000/namespace/frontend:tag). - Push the image to your registry and update the frontend manifest image, then run
kubectl apply -f <frontend-manifest>.yaml.
- Run
-
Note: For development, the host dev server is convenient. For cluster deployment, ensure static files and environment variables (API endpoint) point to the cluster backend.
Workspace packages overview
packages/frontend-app— the application; run withnpm run dev:app.packages/ui— UI primitives/components (build withnpm run build:packagesornpm run -w @nthucscc/ui build).packages/components-shared— small shared components and helpers.packages/utils— utility functions and scripts (i18n helpers, build helpers).
Project layout (important paths)
src/— app source (App.tsx, main.tsx, pages/, components/)packages/— local reusable packagespublic/— static assetsvite.config.ts,tsconfig.*.json— build configs
Environment
- Create a
.envin project root orpackages/frontend-appif needed to set API endpoints, e.g.VITE_API_URL.
Notes
- This repo uses TypeScript project references; building packages before the app is recommended in CI.
- Check
packages/*/package.jsonfor package-specific scripts.
For package-specific documentation or CI instructions, see the package folders or add dedicated README files under packages/frontend-app.