Skip to content

Commit c27c233

Browse files
authored
v0.5.21: google groups, virtualized code viewer, ui, autolayout, docs improvements
2 parents ebef5f3 + 4fb039f commit c27c233

File tree

285 files changed

+19802
-4153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

285 files changed

+19802
-4153
lines changed

README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,36 @@ Wait for the model to download, then visit [http://localhost:3000](http://localh
8989
docker compose -f docker-compose.ollama.yml exec ollama ollama pull llama3.1:8b
9090
```
9191

92+
#### Using an External Ollama Instance
93+
94+
If you already have Ollama running on your host machine (outside Docker), you need to configure the `OLLAMA_URL` to use `host.docker.internal` instead of `localhost`:
95+
96+
```bash
97+
# Docker Desktop (macOS/Windows)
98+
OLLAMA_URL=http://host.docker.internal:11434 docker compose -f docker-compose.prod.yml up -d
99+
100+
# Linux (add extra_hosts or use host IP)
101+
docker compose -f docker-compose.prod.yml up -d # Then set OLLAMA_URL to your host's IP
102+
```
103+
104+
**Why?** When running inside Docker, `localhost` refers to the container itself, not your host machine. `host.docker.internal` is a special DNS name that resolves to the host.
105+
106+
For Linux users, you can either:
107+
- Use your host machine's actual IP address (e.g., `http://192.168.1.100:11434`)
108+
- Add `extra_hosts: ["host.docker.internal:host-gateway"]` to the simstudio service in your compose file
109+
110+
#### Using vLLM
111+
112+
Sim also supports [vLLM](https://docs.vllm.ai/) for self-hosted models with OpenAI-compatible API:
113+
114+
```bash
115+
# Set these environment variables
116+
VLLM_BASE_URL=http://your-vllm-server:8000
117+
VLLM_API_KEY=your_optional_api_key # Only if your vLLM instance requires auth
118+
```
119+
120+
When running with Docker, use `host.docker.internal` if vLLM is on your host machine (same as Ollama above).
121+
92122
### Self-hosted: Dev Containers
93123

94124
1. Open VS Code with the [Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
@@ -190,6 +220,46 @@ Copilot is a Sim-managed service. To use Copilot on a self-hosted instance:
190220
- Go to https://sim.ai → Settings → Copilot and generate a Copilot API key
191221
- Set `COPILOT_API_KEY` environment variable in your self-hosted apps/sim/.env file to that value
192222

223+
## Environment Variables
224+
225+
Key environment variables for self-hosted deployments (see `apps/sim/.env.example` for full list):
226+
227+
| Variable | Required | Description |
228+
|----------|----------|-------------|
229+
| `DATABASE_URL` | Yes | PostgreSQL connection string with pgvector |
230+
| `BETTER_AUTH_SECRET` | Yes | Auth secret (`openssl rand -hex 32`) |
231+
| `BETTER_AUTH_URL` | Yes | Your app URL (e.g., `http://localhost:3000`) |
232+
| `NEXT_PUBLIC_APP_URL` | Yes | Public app URL (same as above) |
233+
| `ENCRYPTION_KEY` | Yes | Encryption key (`openssl rand -hex 32`) |
234+
| `OLLAMA_URL` | No | Ollama server URL (default: `http://localhost:11434`) |
235+
| `VLLM_BASE_URL` | No | vLLM server URL for self-hosted models |
236+
| `COPILOT_API_KEY` | No | API key from sim.ai for Copilot features |
237+
238+
## Troubleshooting
239+
240+
### Ollama models not showing in dropdown (Docker)
241+
242+
If you're running Ollama on your host machine and Sim in Docker, change `OLLAMA_URL` from `localhost` to `host.docker.internal`:
243+
244+
```bash
245+
OLLAMA_URL=http://host.docker.internal:11434 docker compose -f docker-compose.prod.yml up -d
246+
```
247+
248+
See [Using an External Ollama Instance](#using-an-external-ollama-instance) for details.
249+
250+
### Database connection issues
251+
252+
Ensure PostgreSQL has the pgvector extension installed. When using Docker, wait for the database to be healthy before running migrations.
253+
254+
### Port conflicts
255+
256+
If ports 3000, 3002, or 5432 are in use, configure alternatives:
257+
258+
```bash
259+
# Custom ports
260+
NEXT_PUBLIC_APP_URL=http://localhost:3100 POSTGRES_PORT=5433 docker compose up -d
261+
```
262+
193263
## Tech Stack
194264

195265
- **Framework**: [Next.js](https://nextjs.org/) (App Router)

apps/docs/app/[lang]/[[...slug]]/page.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
182182
tableOfContent={{
183183
style: 'clerk',
184184
enabled: true,
185-
header: <div className='mb-2 font-medium text-sm'>On this page</div>,
185+
header: (
186+
<div key='toc-header' className='mb-2 font-medium text-sm'>
187+
On this page
188+
</div>
189+
),
186190
footer: <TOCFooter />,
187191
single: false,
188192
}}

apps/docs/app/[lang]/layout.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ export default async function Layout({ children, params }: LayoutProps) {
101101
<Navbar />
102102
<DocsLayout
103103
tree={source.pageTree[lang]}
104-
themeSwitch={{
105-
enabled: false,
106-
}}
107104
nav={{
108105
title: (
109106
<Image
@@ -128,7 +125,7 @@ export default async function Layout({ children, params }: LayoutProps) {
128125
},
129126
}}
130127
containerProps={{
131-
className: '!pt-10',
128+
className: '!pt-0',
132129
}}
133130
>
134131
{children}

apps/docs/app/global.css

Lines changed: 88 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -96,54 +96,58 @@ aside#nd-sidebar {
9696
border-right: none !important;
9797
}
9898

99-
/* Responsive sidebar positioning */
100-
/* Mobile: Fumadocs handles drawer */
101-
@media (min-width: 768px) and (max-width: 1024px) {
102-
aside[data-sidebar],
103-
aside#nd-sidebar {
104-
left: var(--sidebar-offset) !important;
105-
}
99+
/* Fumadocs v16: Add sidebar placeholder styling for grid area */
100+
[data-sidebar-placeholder] {
101+
background: transparent !important;
106102
}
107103

108-
/* Desktop layout alignment */
109-
@media (min-width: 1025px) {
110-
[data-sidebar-container] {
111-
margin-left: var(--sidebar-offset) !important;
104+
/* Fumadocs v16: Hide sidebar panel (floating collapse button) */
105+
[data-sidebar-panel] {
106+
display: none !important;
107+
}
108+
109+
/* Mobile only: Reduce gap between navbar and content */
110+
@media (max-width: 1023px) {
111+
#nd-docs-layout {
112+
margin-top: -25px;
112113
}
113-
aside[data-sidebar],
114-
aside#nd-sidebar {
115-
left: var(--sidebar-offset) !important;
114+
}
115+
116+
/* Desktop only: Apply custom navbar offset, sidebar width and margin offsets */
117+
/* On mobile, let fumadocs handle the layout natively */
118+
@media (min-width: 1024px) {
119+
:root {
120+
--fd-banner-height: 64px !important;
116121
}
117-
/* TOC positioning - target all possible selectors */
118-
[data-toc],
119-
aside[data-toc],
120-
div[data-toc],
121-
.fd-toc,
122-
#nd-toc,
123-
nav[data-toc],
124-
aside:has([role="complementary"]) {
125-
right: var(--toc-offset) !important;
122+
123+
#nd-docs-layout {
124+
--fd-docs-height: calc(100dvh - 64px) !important;
125+
--fd-sidebar-width: 300px !important;
126+
margin-left: var(--sidebar-offset) !important;
127+
margin-right: var(--toc-offset) !important;
126128
}
127129

128-
/* Alternative TOC container targeting */
129-
[data-docs-page] > aside:last-child,
130-
main ~ aside {
131-
right: var(--toc-offset) !important;
130+
/* Hide fumadocs nav on desktop - we use custom navbar there */
131+
#nd-docs-layout > header {
132+
display: none !important;
132133
}
133134
}
134135

135136
/* Sidebar spacing - compact like turborepo */
136-
[data-sidebar-viewport] {
137-
padding: 0.5rem 20px 12px;
137+
/* Fumadocs v16: [data-sidebar-viewport] doesn't exist, target #nd-sidebar > div instead */
138+
[data-sidebar-viewport],
139+
#nd-sidebar > div {
140+
padding: 0.5rem 12px 12px;
138141
background: transparent !important;
139142
background-color: transparent !important;
140143
}
141144

142145
/* Override sidebar item styling to match Raindrop */
143146
/* Target Link and button elements in sidebar - override Fumadocs itemVariants */
144147
/* Exclude the small chevron-only toggle buttons */
145-
#nd-sidebar a,
146-
#nd-sidebar button:not([aria-label*="ollapse"]):not([aria-label*="xpand"]) {
148+
/* Using html prefix for higher specificity over Tailwind v4 utilities */
149+
html #nd-sidebar a,
150+
html #nd-sidebar button:not([aria-label*="ollapse"]):not([aria-label*="xpand"]) {
147151
font-size: 0.9375rem !important; /* 15px to match Raindrop */
148152
line-height: 1.4 !important;
149153
padding: 0.5rem 0.75rem !important; /* More compact like Raindrop */
@@ -154,14 +158,14 @@ aside#nd-sidebar {
154158
}
155159

156160
/* Dark mode sidebar text */
157-
.dark #nd-sidebar a,
158-
.dark #nd-sidebar button:not([aria-label*="ollapse"]):not([aria-label*="xpand"]) {
161+
html.dark #nd-sidebar a,
162+
html.dark #nd-sidebar button:not([aria-label*="ollapse"]):not([aria-label*="xpand"]) {
159163
color: rgba(255, 255, 255, 0.6) !important;
160164
}
161165

162166
/* Light mode sidebar text */
163-
:root:not(.dark) #nd-sidebar a,
164-
:root:not(.dark) #nd-sidebar button:not([aria-label*="ollapse"]):not([aria-label*="xpand"]) {
167+
html:not(.dark) #nd-sidebar a,
168+
html:not(.dark) #nd-sidebar button:not([aria-label*="ollapse"]):not([aria-label*="xpand"]) {
165169
color: rgba(0, 0, 0, 0.6) !important;
166170
}
167171

@@ -194,7 +198,10 @@ aside#nd-sidebar {
194198
}
195199

196200
/* Section headers should be slightly larger */
197-
[data-sidebar-viewport] [data-separator] {
201+
/* Fumadocs v16: Also target #nd-sidebar for compatibility */
202+
[data-sidebar-viewport] [data-separator],
203+
#nd-sidebar [data-separator],
204+
#nd-sidebar p {
198205
font-size: 0.75rem !important;
199206
font-weight: 600 !important;
200207
text-transform: uppercase !important;
@@ -218,61 +225,61 @@ aside#nd-sidebar {
218225
}
219226

220227
/* Dark mode active state */
221-
.dark #nd-sidebar a[data-active="true"],
222-
.dark #nd-sidebar button[data-active="true"],
223-
.dark #nd-sidebar a.bg-fd-primary\/10,
224-
.dark #nd-sidebar a.text-fd-primary,
225-
.dark #nd-sidebar a[class*="bg-fd-primary"],
226-
.dark #nd-sidebar a[class*="text-fd-primary"],
227-
.dark #nd-sidebar a.bg-purple-50\/80,
228-
.dark #nd-sidebar a.text-purple-600,
229-
.dark #nd-sidebar a[class*="bg-purple"],
230-
.dark #nd-sidebar a[class*="text-purple"] {
228+
html.dark #nd-sidebar a[data-active="true"],
229+
html.dark #nd-sidebar button[data-active="true"],
230+
html.dark #nd-sidebar a.bg-fd-primary\/10,
231+
html.dark #nd-sidebar a.text-fd-primary,
232+
html.dark #nd-sidebar a[class*="bg-fd-primary"],
233+
html.dark #nd-sidebar a[class*="text-fd-primary"],
234+
html.dark #nd-sidebar a.bg-purple-50\/80,
235+
html.dark #nd-sidebar a.text-purple-600,
236+
html.dark #nd-sidebar a[class*="bg-purple"],
237+
html.dark #nd-sidebar a[class*="text-purple"] {
231238
background-color: rgba(255, 255, 255, 0.15) !important;
232239
color: rgba(255, 255, 255, 1) !important;
233240
}
234241

235242
/* Light mode active state */
236-
:root:not(.dark) #nd-sidebar a[data-active="true"],
237-
:root:not(.dark) #nd-sidebar button[data-active="true"],
238-
:root:not(.dark) #nd-sidebar a.bg-fd-primary\/10,
239-
:root:not(.dark) #nd-sidebar a.text-fd-primary,
240-
:root:not(.dark) #nd-sidebar a[class*="bg-fd-primary"],
241-
:root:not(.dark) #nd-sidebar a[class*="text-fd-primary"],
242-
:root:not(.dark) #nd-sidebar a.bg-purple-50\/80,
243-
:root:not(.dark) #nd-sidebar a.text-purple-600,
244-
:root:not(.dark) #nd-sidebar a[class*="bg-purple"],
245-
:root:not(.dark) #nd-sidebar a[class*="text-purple"] {
243+
html:not(.dark) #nd-sidebar a[data-active="true"],
244+
html:not(.dark) #nd-sidebar button[data-active="true"],
245+
html:not(.dark) #nd-sidebar a.bg-fd-primary\/10,
246+
html:not(.dark) #nd-sidebar a.text-fd-primary,
247+
html:not(.dark) #nd-sidebar a[class*="bg-fd-primary"],
248+
html:not(.dark) #nd-sidebar a[class*="text-fd-primary"],
249+
html:not(.dark) #nd-sidebar a.bg-purple-50\/80,
250+
html:not(.dark) #nd-sidebar a.text-purple-600,
251+
html:not(.dark) #nd-sidebar a[class*="bg-purple"],
252+
html:not(.dark) #nd-sidebar a[class*="text-purple"] {
246253
background-color: rgba(0, 0, 0, 0.07) !important;
247254
color: rgba(0, 0, 0, 0.9) !important;
248255
}
249256

250257
/* Dark mode hover state */
251-
.dark #nd-sidebar a:hover:not([data-active="true"]),
252-
.dark #nd-sidebar button:hover:not([data-active="true"]) {
258+
html.dark #nd-sidebar a:hover:not([data-active="true"]),
259+
html.dark #nd-sidebar button:hover:not([data-active="true"]) {
253260
background-color: rgba(255, 255, 255, 0.08) !important;
254261
}
255262

256263
/* Light mode hover state */
257-
:root:not(.dark) #nd-sidebar a:hover:not([data-active="true"]),
258-
:root:not(.dark) #nd-sidebar button:hover:not([data-active="true"]) {
264+
html:not(.dark) #nd-sidebar a:hover:not([data-active="true"]),
265+
html:not(.dark) #nd-sidebar button:hover:not([data-active="true"]) {
259266
background-color: rgba(0, 0, 0, 0.03) !important;
260267
}
261268

262269
/* Dark mode - ensure active/selected items don't change on hover */
263-
.dark #nd-sidebar a.bg-purple-50\/80:hover,
264-
.dark #nd-sidebar a[class*="bg-purple"]:hover,
265-
.dark #nd-sidebar a[data-active="true"]:hover,
266-
.dark #nd-sidebar button[data-active="true"]:hover {
270+
html.dark #nd-sidebar a.bg-purple-50\/80:hover,
271+
html.dark #nd-sidebar a[class*="bg-purple"]:hover,
272+
html.dark #nd-sidebar a[data-active="true"]:hover,
273+
html.dark #nd-sidebar button[data-active="true"]:hover {
267274
background-color: rgba(255, 255, 255, 0.15) !important;
268275
color: rgba(255, 255, 255, 1) !important;
269276
}
270277

271278
/* Light mode - ensure active/selected items don't change on hover */
272-
:root:not(.dark) #nd-sidebar a.bg-purple-50\/80:hover,
273-
:root:not(.dark) #nd-sidebar a[class*="bg-purple"]:hover,
274-
:root:not(.dark) #nd-sidebar a[data-active="true"]:hover,
275-
:root:not(.dark) #nd-sidebar button[data-active="true"]:hover {
279+
html:not(.dark) #nd-sidebar a.bg-purple-50\/80:hover,
280+
html:not(.dark) #nd-sidebar a[class*="bg-purple"]:hover,
281+
html:not(.dark) #nd-sidebar a[data-active="true"]:hover,
282+
html:not(.dark) #nd-sidebar button[data-active="true"]:hover {
276283
background-color: rgba(0, 0, 0, 0.07) !important;
277284
color: rgba(0, 0, 0, 0.9) !important;
278285
}
@@ -351,7 +358,16 @@ aside[data-sidebar] > *:not([data-sidebar-viewport]) {
351358
[data-sidebar] [data-title],
352359
#nd-sidebar > a:first-child,
353360
#nd-sidebar > div:first-child > a:first-child,
354-
#nd-sidebar img[alt="Sim"] {
361+
#nd-sidebar img[alt="Sim"],
362+
/* Hide theme toggle at bottom of sidebar on desktop */
363+
#nd-sidebar
364+
> footer,
365+
#nd-sidebar footer,
366+
aside#nd-sidebar > *:last-child:not(div),
367+
#nd-sidebar > button:last-child,
368+
#nd-sidebar button[aria-label*="theme" i],
369+
#nd-sidebar button[aria-label*="Theme"],
370+
#nd-sidebar > div:last-child > button {
355371
display: none !important;
356372
visibility: hidden !important;
357373
height: 0 !important;
@@ -498,13 +514,14 @@ main article,
498514
============================================ */
499515

500516
/* Main content area - center and constrain like turborepo/raindrop */
517+
/* Note: --sidebar-offset and --toc-offset are now applied at #nd-docs-layout level */
501518
main[data-main] {
502519
max-width: var(--spacing-fd-container, 1400px);
503520
margin-left: auto;
504521
margin-right: auto;
505522
padding-top: 1rem;
506-
padding-left: calc(var(--sidebar-offset) + var(--content-gap));
507-
padding-right: calc(var(--toc-offset) + var(--content-gap));
523+
padding-left: var(--content-gap);
524+
padding-right: var(--content-gap);
508525
order: 1 !important;
509526
}
510527

0 commit comments

Comments
 (0)