Frontend application for the Lodge Manager project. It is a React, TypeScript, Vite, and Tailwind CSS application located in the frontend directory.
Install these before running the frontend:
- Git, for cloning the repository.
- Node.js
20.19.0or newer in the Node 20 line, or Node.js22.12.0or newer. The current Vite tooling requires^20.19.0 || >=22.12.0. - npm. npm is included with Node.js and is used by the existing
package-lock.json. - A terminal or command prompt.
- A modern browser such as Chrome, Edge, Firefox, or Safari.
Check whether Git is already installed:
git --versionIf the command is not found, install Git from:
https://git-scm.com/downloads
Check whether Node.js and npm are already installed:
node --version
npm --versionThe Node.js version must satisfy:
^20.19.0 || >=22.12.0
Recommended installation options:
- Download the current LTS version from
https://nodejs.org/en/download. - Use
nvmon macOS or Linux if you need to manage multiple Node versions. - Use
nvm-windowson Windows if you need to manage multiple Node versions.
After installing Node.js, reopen your terminal and verify:
node --version
npm --versionFrom the repository root, move into the frontend folder before running frontend commands:
cd frontendAll commands in the rest of this README assume you are inside the frontend directory.
Install the exact dependency versions recorded in package-lock.json:
npm ciUse npm ci for a clean and reproducible setup. If you are actively changing dependencies and need npm to update package-lock.json, use:
npm installThe frontend currently does not require any Vite environment variable to run. The Axios client in src/lib/axios.ts defaults to http://localhost:8000/api/v1 automatically.
To override the backend URL (e.g. pointing at a staging server), create frontend/.env and set:
VITE_BASE_API_URL=http://127.0.0.1:8000/api/v1
⚠️ The variable name isVITE_BASE_API_URL— notVITE_API_BASE_URL. Only variables prefixed withVITE_are exposed to frontend code by Vite.
Do not commit .env files or secrets. The root .gitignore already ignores .env, and frontend/.gitignore ignores *.local files.
Start the Vite development server:
npm run devVite will print the local URL in the terminal. By default it is usually:
http://localhost:5173/
Open that URL in your browser.
To expose the dev server on your local network:
npm run dev -- --hostTo run the dev server on a specific port:
npm run dev -- --port 3000npm run devRuns the local Vite development server with hot module replacement.
npm run buildRuns TypeScript project checks and creates a production build in:
frontend/dist
npm run previewServes the built dist output locally. Run npm run build before previewing.
npm run lintRuns ESLint across the frontend source.
From the repository root:
cd frontend
npm ci
npm run devThen open the URL printed by Vite.
The frontend can be run independently for screens that use mock data. Once a screen calls the FastAPI backend, start the backend separately.
See backend/README.md for the full backend setup. Quick reference for Windows PowerShell:
# From the project root (LodgeOpsProject/)
cd backend
.\.venv\Scripts\Activate.ps1
uvicorn app.main:app --reload --port 8000The backend runs at http://127.0.0.1:8000.
Once both servers are running, the frontend at http://localhost:5173 will communicate with the backend automatically via the Axios client configured in src/lib/axios.ts.
frontend/
|-- public/ Static assets served by Vite
|-- src/
| |-- components/ Reusable UI, auth, dashboard, and layout components
| |-- hooks/ Shared React hooks
| |-- lib/ Axios instance, utilities, and form validation schemas
| |-- pages/ Route-level pages (Login, Register, Dashboard, etc.)
| |-- services/ API request functions & query hooks
| |-- types/ TypeScript interfaces and shared types
| |-- App.tsx Route configuration & QueryClientProvider setup
| |-- index.css Global styles and Tailwind imports
| `-- main.tsx React application entry point
|-- index.html Vite HTML entry
|-- package.json npm scripts and dependency list
|-- package-lock.json Locked dependency versions
|-- tsconfig*.json TypeScript configuration
`-- vite.config.ts Vite, React Compiler, Babel, and Tailwind setup
- React 19 & React DOM: Core UI library.
- React Router DOM v7: Client-side routing.
- TanStack React Query v5: Server state management & data fetching.
- Axios: HTTP client with credentials support.
- Tailwind CSS v4 & @tailwindcss/vite: Utility-first styling.
- React Hook Form & Zod: Schema-driven form validation.
- Lucide React: UI iconography.
- Radix UI & CVA / clsx: Headless primitives and class composition.
- React Hot Toast: Notification toasts.
- TypeScript: Static typing.
- Vite: Local development server & production bundler.
If dependencies become inconsistent, remove the installed dependency folder and reinstall from the lockfile.
macOS or Linux:
rm -rf node_modules
npm ciWindows PowerShell:
Remove-Item -Recurse -Force node_modules
npm ciRun:
npm installCommit the updated package-lock.json only if the dependency changes are intentional.
Install a supported Node.js version:
^20.19.0 || >=22.12.0
Then reinstall dependencies:
npm ciRun the dev server on another port:
npm run dev -- --port 3000Check the terminal running Vite for compile errors. Also open the browser developer tools console and check for runtime errors.
Confirm the backend is running at the URL configured for the frontend. For local backend development, the expected backend URL is usually:
http://127.0.0.1:8000
Also check backend CORS settings if the browser blocks requests from the frontend dev server.
Build the frontend:
npm run buildDeploy the generated dist directory to a static hosting provider or serve it behind a web server. The production host must be configured to return index.html for client-side routes such as /login, /dashboard, and /rooms.