You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## ShadowRoom (P2P Clipboard + File Share)
This repo contains:
- `server/`: Node.js + Express + Socket.io signaling server (handshake only).
- `client/`: Vite + React + Tailwind UI + WebRTC (simple-peer).
### Signaling server (dev)
```bash
cd server
npm install
npm run dev
```
Server runs on `http://localhost:3001`.
### Client (dev)
```bash
cd client
npm install
npm run dev
```
Client runs on `http://localhost:5173`.
### Configuration
- **Client:** `VITE_SIGNALING_URL` — signaling server URL (default `http://localhost:3001`). Set at **build time** for production (e.g. in Netlify).
- **Server:** `PORT` (set by Render), `CLIENT_ORIGIN` (optional, e.g. `https://your-app.netlify.app` for CORS).
---
## Deploy (Netlify + Render)
The repo is split so you can deploy:
| Folder | Deploy to | Role |
|----------|-----------|---------------------|
| `client/`| **Netlify** | Frontend (SPA) |
| `server/`| **Render** | Signaling backend |
### 1. Deploy backend (Render)
1. Push this repo to GitHub.
2. In [Render](https://render.com): **New → Web Service**, connect the repo.
3. Set **Root Directory** to `server`.
4. **Build command:** `npm install`
**Start command:** `npm run start`
5. Deploy. Note the service URL (e.g. `https://shadowroom-signaling.onrender.com`).
### 2. Deploy frontend (Netlify)
1. In [Netlify](https://netlify.com): **Add new site → Import from Git**, connect the same repo.
2. Use the repo root; Netlify will use the repo’s `netlify.toml` (base = `client`, publish = `dist`).
3. In **Site settings → Environment variables**, add:
- **Key:** `VITE_SIGNALING_URL`
- **Value:** your Render backend URL (e.g. `https://shadowroom-signaling.onrender.com`)
4. Trigger a new deploy so the build uses this variable.
### 3. Optional: lock CORS to your frontend
In Render, for your backend service add an env var:
- **Key:** `CLIENT_ORIGIN`
- **Value:** `https://your-netlify-site.netlify.app`
(Replace with your real Netlify URL.)
# ShadowRoom