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
<palign="center">The open-source platform to build AI agents and run your agentic workforce. Connect 1,000+ integrations and LLMs to orchestrate agentic workflows.</p>
# and NEXT_PUBLIC_APP_URL from apps/sim/.env into apps/realtime/.env so both
99
+
# services use the same auth secret and DB.
100
+
101
+
# DB migration env
109
102
cp packages/db/.env.example packages/db/.env
110
-
# Edit both .env files to set DATABASE_URL="postgresql://postgres:your_password@localhost:5432/simstudio"
103
+
104
+
# Edit each .env to set DATABASE_URL="postgresql://postgres:your_password@localhost:5432/simstudio"
111
105
```
112
106
113
-
4. Run migrations:
107
+
We use per-app `.env` files (the Turborepo-canonical pattern) rather than a
108
+
single root `.env`. This mirrors production — each service has its own env
109
+
block in Docker Compose / k8s — and keeps sim's app secrets (OAuth, LLM keys,
110
+
Stripe, etc.) out of the realtime server's process scope. The shared values
111
+
(DATABASE_URL, BETTER_AUTH_SECRET, INTERNAL_API_SECRET, etc.) are duplicated
112
+
across `apps/sim/.env` and `apps/realtime/.env`; that's the trade-off.
113
+
114
+
Production uses env vars passed through Docker Compose / Kubernetes directly
115
+
and does not read any `.env` files.
116
+
117
+
1. Run migrations:
114
118
115
119
```bash
116
120
cd packages/db && bun run db:migrate
117
121
```
118
122
119
-
5. Start development servers:
123
+
1. Start development servers:
120
124
121
125
```bash
122
126
bun run dev:full # Starts Next.js app and realtime socket server
123
127
```
124
128
125
-
Or run separately: `bun run dev` (Next.js) and `cd apps/sim && bun run dev:sockets` (realtime).
129
+
Or run separately: `bun run dev` (Next.js) and `bun run dev:sockets` (realtime). All scripts run from the repo root.
126
130
127
131
## Copilot API Keys
128
132
129
133
Copilot is a Sim-managed service. To use Copilot on a self-hosted instance:
130
134
131
-
- Go to https://sim.ai → Settings → Copilot and generate a Copilot API key
132
-
- Set `COPILOT_API_KEY`environment variable in your self-hosted apps/sim/.env file to that value
135
+
- Go to [https://sim.ai](https://sim.ai) → Settings → Copilot and generate a Copilot API key
136
+
- Set `COPILOT_API_KEY` in `apps/sim/.env` to that value
133
137
134
138
## Environment Variables
135
139
136
-
See the [environment variables reference](https://docs.sim.ai/self-hosting/environment-variables) for the full list, or [`apps/sim/.env.example`](apps/sim/.env.example) for defaults.
140
+
See the [environment variables reference](https://docs.sim.ai/self-hosting/environment-variables) for the full list, or [`apps/sim/.env.example`](apps/sim/.env.example)(main app) and [`apps/realtime/.env.example`](apps/realtime/.env.example) (realtime server) for defaults.
137
141
138
142
## Tech Stack
139
143
@@ -160,4 +164,4 @@ We welcome contributions! Please see our [Contributing Guide](.github/CONTRIBUTI
160
164
161
165
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
0 commit comments