Tiny Office With Discord
- Go
- pnpm
- requiredfield
- Discord Bot Token, Groq API Key
To bypass the browser's restriction that requires enabling
Secure
when usingSameSite=None
for cross-site cookie authentication, this project uses Caddy to proxy requests withtls internal
. This avoids the manual hassle of creating, signing, and installing certificates.Additionally, Caddy rewrites/overwrites certain headers to enforce strict cross-site cookie policies. For production builds, the frontend is generated as a static site, and the backend serves the frontend assets directly, eliminating the need for cross-site cookies.
Caddyfile
: proxies frontend and backend dev servers with a certificate (default3001
->3000
for frontend;8081
->8080
for backend).env
:PORT
: frontend dev server listening port (default3000
)SERVER_PORT
: backend server listening port (default8080
)VITE_SERVER_HOSTNAME
: where the frontend should reach the backend, this must be configured to point to the hostname and port where Caddy proxies the backend (defaulthttps://localhost:8081
).
nuxt.config.ts
:vite.server.hmr.clientPort
must be the same as the port listening port ofvite
, not after proxied through Caddy (default3000
)
go run .
: backend dev server listen onSERVER_PORT
(8080
) portpnpm dev
: frontend dev server listen onPORT
(3000
) portcaddy run --config ./Caddyfile
: proxy those 2 servers
- Install Docker Engine or Podman
cp docker-compose.example.yml docker-compose.yml
- Modify environment variables in
docker-compose.yml
docker compose up -d
docker compose down
git pull --rebase
docker compose up -d