Enable dev mode for React app with proxy support; refine build, styles, and UI.
- Adjusted `package.json` scripts for Bun dev server and build flow.
- Added `dev.html` for standalone web development with hot-reload enabled.
- Introduced `WebDisableEmbedded` and `WebDevProxyURL` configurations to support proxying non-API paths.
- Refactored server logic to handle reverse proxy for development mode.
- Updated `App.jsx` structure, styles, and layout for responsiveness and dynamic padding.
- Improved login interface with logo support and cleaner design.
- Enhanced development flow documentation in `README.md`.
SpiderFrequencytime.Duration`env:"ORLY_SPIDER_FREQUENCY" usage:"spider frequency in seconds" default:"1h"`
// Web UI and dev mode settings
WebDisableEmbeddedbool`env:"ORLY_WEB_DISABLE" default:"false" usage:"disable serving the embedded web UI; useful for hot-reload during development"`
WebDevProxyURLstring`env:"ORLY_WEB_DEV_PROXY_URL" usage:"when ORLY_WEB_DISABLE is true, reverse-proxy non-API paths to this dev server URL (e.g. http://localhost:5173)"`
}
// New creates and initializes a new configuration object for the relay
w.Write([]byte("Web UI disabled (ORLY_WEB_DISABLE=true). Run the web app in standalone dev mode (e.g., npm run dev) or set ORLY_WEB_DEV_PROXY_URL to proxy through this server."))
return
}
// Default: serve embedded React app
fileServer:=http.FileServer(GetReactAppFS())
// Serve the React app files
fileServer.ServeHTTP(w,r)
}
@ -246,14 +297,16 @@ func (s *Server) handleAuthLogout(w http.ResponseWriter, r *http.Request) {
@@ -246,14 +297,16 @@ func (s *Server) handleAuthLogout(w http.ResponseWriter, r *http.Request) {
return
}
// Expire the cookie
http.SetCookie(w,&http.Cookie{
http.SetCookie(
w,&http.Cookie{
Name:"orly_auth",
Value:"",
Path:"/",
MaxAge:-1,
HttpOnly:true,
SameSite:http.SameSiteLaxMode,
})
},
)
w.Header().Set("Content-Type","application/json")
w.Write([]byte(`{"success": true}`))
}
@ -295,7 +348,9 @@ func (s *Server) handlePermissions(w http.ResponseWriter, r *http.Request) {
@@ -295,7 +348,9 @@ func (s *Server) handlePermissions(w http.ResponseWriter, r *http.Request) {
@ -9,12 +9,41 @@ This is a React web application that uses Bun for building and bundling, and is
@@ -9,12 +9,41 @@ This is a React web application that uses Bun for building and bundling, and is
## Development
To run the development server:
There are two ways to develop the web app:
1) Standalone (recommended for hot reload)
- Start the Go relay with the embedded web UI disabled so the React app can run on its own dev server with HMR.
- Configure the relay via environment variables:
```bash
# In another shell at repo root
export ORLY_WEB_DISABLE=true
# Optional: if you want same-origin URLs, you can set a proxy target and access the relay on the same port
When ORLY_WEB_DISABLE=true is set, the Go server still serves the API and websocket endpoints and sends permissive CORS headers, so the dev server can access them cross-origin. If ORLY_WEB_DEV_PROXY_URL is set, the Go server will reverse-proxy non-/api paths to the dev server so you can use the same origin.
2) Embedded (no hot reload)
- Build the web app and run the Go server with defaults:
<buttonclassName="mt-2 bg-red-600 text-white px-5 py-2 rounded hover:bg-red-700"onClick={()=>updateStatus('Private key login not implemented in this basic interface. Please use a proper Nostr client or extension.','error')}>LoginwithPrivateKey</button>