1.6 KiB
1.6 KiB
Local Development
Start Server
cd /home/jjm/code/chgrid/server
export CHGRID_AUTH_SECRET=dev-secret
export CHGRID_HOST_ORIGIN=http://localhost:5173
.venv/bin/python main.py --allow-insecure-ws
Start Client
cd /home/jjm/code/chgrid/client
npm run dev
Open: http://localhost:5173
Defaults:
- Server reads
config.tomlautomatically when present. - Server default bind/port is
127.0.0.1:8765. - Server default base path is
/for local/dev; production subpath deploys should setserver.base_pathto match the published client path such as/chgrid/. - Server defaults to TLS-required unless you set
network.allow_insecure_ws=trueor pass--allow-insecure-wsfor local/dev. - Client dev default is
localhost:5173. - Auth requires
CHGRID_AUTH_SECRETin environment. - Browser-origin enforcement requires
CHGRID_HOST_ORIGINin environment. - A starter env file is available at
server/.env.sample. - Saved login uses instance-scoped server-managed
HttpOnlycookie helpers under the configured base path (for example/chgrid/auth/session/setand/chgrid/auth/session/clear) and both requireX-Chgrid-Auth-Client: 1.
Quick Restarts
Server:
lsof -tiTCP:8765 -sTCP:LISTEN | xargs -r kill
cd /home/jjm/code/chgrid/server
CHGRID_AUTH_SECRET=dev-secret CHGRID_HOST_ORIGIN=http://localhost:5173 nohup .venv/bin/python main.py --allow-insecure-ws > /tmp/chgrid-server.log 2>&1 &
Client:
lsof -tiTCP:5173 -sTCP:LISTEN | xargs -r kill
cd /home/jjm/code/chgrid/client
nohup npm run dev > /tmp/chgrid-client.log 2>&1 &