This is the development frontend for the Photosphere application. Built on React and bundled with Vite.
dev-frontend/
├── src/
│ ├── index.tsx # React entry point
│ ├── app.tsx # Main app component
│ ├── tailwind.css # Tailwind CSS
│ ├── lib/
│ │ ├── task-queue-provider-websocket.ts # WebSocket task queue provider
│ │ ├── worker-backend-websocket.ts # WebSocket worker backend
│ │ └── use-web-socket.ts # WebSocket hook
│ └── test/
│ └── e2e/
│ └── frontend.test.ts # E2E tests
├── index.html # HTML template
├── package.json
├── vite.config.ts # Vite configuration
├── tailwind.config.js # Tailwind configuration
├── postcss.config.js # PostCSS configuration
└── tsconfig.json
First, follow the instructions in the main readme.
Then open a terminal and change directory to the dev-frontend project:
cd apps/dev-frontendTo enable the frontend you must first run the dev-server.
Run the dev server like this:
bun startThen click the link or point your browser at the default location for Vite: http://localhost:8080.
Set the VITE_BASE_URL environment variable to point the frontend to the backend:
export VITE_BASE_URL=http://localhost:3000Or on Windows:
set VITE_BASE_URL=http://localhost:3000Build the project to a static web page like this:
bun run buildThe static web page is output to the dist subdirectory.
After building the static web page, you can test it locally using live-server.
First install live-server globally:
pnpm install -g live-serverNow change into the directory where the static web page is generated:
cd distFrom here, start live-server:
live-serverThe web page should automatically be displayed in your browser.
Compile the whole project:
bun run compileCompile in watch mode in another terminal, if you want to make changes to the code while it is running:
bun run compile:watchSet environment variables:
export VITE_BASE_URL=<photosphere-api-url>Run it in prod mode:
cd photosphere/dev-frontend
bun run start:prodbun testbun run test-e2eEnable this to debug with Playwright:
export PWDEBUG=1Or on Windows:
set PWDEBUG=1VITE_NODE_ENV- Set to "production" for production use.VITE_BASE_URL- Sets the URL for the connection to the backend.