mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 15:07:55 -05:00
docs: updated docker + README to reflect new monorepo structure, removed husky
This commit is contained in:
@@ -18,11 +18,14 @@ alias pgc="PGPASSWORD=postgres psql -h db -U postgres -d postgres"
|
||||
alias check-db="PGPASSWORD=postgres psql -h db -U postgres -c '\l'"
|
||||
|
||||
# Sim Studio specific aliases
|
||||
alias logs="tail -f logs/*.log 2>/dev/null || echo 'No log files found'"
|
||||
alias sim-start="npm run dev"
|
||||
alias sim-migrate="npx drizzle-kit push"
|
||||
alias sim-generate="npx drizzle-kit generate"
|
||||
alias sim-rebuild="npm run build && npm start"
|
||||
alias logs="cd /workspace/sim && tail -f logs/*.log 2>/dev/null || echo 'No log files found'"
|
||||
alias sim-start="cd /workspace/sim && npm run dev"
|
||||
alias sim-migrate="cd /workspace/sim && npx drizzle-kit push"
|
||||
alias sim-generate="cd /workspace/sim && npx drizzle-kit generate"
|
||||
alias sim-rebuild="cd /workspace/sim && npm run build && npm start"
|
||||
|
||||
# Default to sim directory
|
||||
cd /workspace/sim 2>/dev/null || true
|
||||
|
||||
# Welcome message - only show once per session
|
||||
if [ -z "$SIM_WELCOME_SHOWN" ]; then
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"dockerComposeFile": "docker-compose.yml",
|
||||
"service": "app",
|
||||
"workspaceFolder": "/workspace",
|
||||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
|
||||
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
|
||||
@@ -15,6 +15,7 @@ services:
|
||||
depends_on:
|
||||
- db
|
||||
network_mode: service:db
|
||||
working_dir: /workspace/sim
|
||||
|
||||
db:
|
||||
image: postgres:14
|
||||
|
||||
@@ -5,9 +5,12 @@ set -e
|
||||
|
||||
echo "🔧 Setting up Sim Studio development environment..."
|
||||
|
||||
# Change to the sim directory
|
||||
cd /workspace/sim
|
||||
|
||||
# Setup .bashrc
|
||||
echo "📄 Setting up .bashrc with aliases..."
|
||||
cp .devcontainer/.bashrc ~/.bashrc
|
||||
cp /workspace/.devcontainer/.bashrc ~/.bashrc
|
||||
# Add to .profile to ensure .bashrc is sourced in non-interactive shells
|
||||
echo 'if [ -f ~/.bashrc ]; then . ~/.bashrc; fi' >> ~/.profile
|
||||
|
||||
@@ -55,13 +58,13 @@ echo "Waiting for database to be ready..."
|
||||
cat << EOF >> ~/.bashrc
|
||||
|
||||
# Additional Sim Studio Development Aliases
|
||||
alias migrate="npx drizzle-kit push"
|
||||
alias generate="npx drizzle-kit generate"
|
||||
alias dev="npm run dev"
|
||||
alias build="npm run build"
|
||||
alias start="npm run start"
|
||||
alias lint="npm run lint"
|
||||
alias test="npm run test"
|
||||
alias migrate="cd /workspace/sim && npx drizzle-kit push"
|
||||
alias generate="cd /workspace/sim && npx drizzle-kit generate"
|
||||
alias dev="cd /workspace/sim && npm run dev"
|
||||
alias build="cd /workspace/sim && npm run build"
|
||||
alias start="cd /workspace/sim && npm run start"
|
||||
alias lint="cd /workspace/sim && npm run lint"
|
||||
alias test="cd /workspace/sim && npm run test"
|
||||
EOF
|
||||
|
||||
# Source the .bashrc to make aliases available immediately
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8d606e58cce98604696a4abcf3ae1ebde6f9f31ac72bb0d44e2444cc39f26030
|
||||
size 360
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f3eb4d1f62924c09d481a0563a84b158c66eb2feb3431cfdb3e6760aab4d661d
|
||||
size 356
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cecb594e8fa65831654fc95e96db9f1249e09c52810c6fbb2b428280aac22158
|
||||
size 354
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a52d0510d0f8c75e27852156ec6f7791f0d8ed65fc58fcc368dd1de0a60a1d74
|
||||
size 350
|
||||
@@ -3,7 +3,7 @@
|
||||
Thank you for your interest in contributing to Sim Studio! Our goal is to provide developers with a powerful, user-friendly platform for building, testing, and optimizing agentic workflows. We welcome contributions in all forms—from bug fixes and design improvements to brand-new features.
|
||||
|
||||
> **Project Overview:**
|
||||
> Sim Studio is built with Next.js (app router), ReactFlow, Zustand, Shadcn, and Tailwind CSS. Please ensure your contributions follow our best practices for clarity, maintainability, and consistency.
|
||||
> Sim Studio is a monorepo containing the main application (`sim/`) and documentation (`docs/`). The main application is built with Next.js (app router), ReactFlow, Zustand, Shadcn, and Tailwind CSS. Please ensure your contributions follow our best practices for clarity, maintainability, and consistency.
|
||||
|
||||
---
|
||||
|
||||
@@ -189,6 +189,8 @@ Dev Containers provide a consistent and easy-to-use development environment:
|
||||
- Open the project in VS Code
|
||||
- When prompted, click "Reopen in Container" (or press F1 and select "Remote-Containers: Reopen in Container")
|
||||
- Wait for the container to build and initialize
|
||||
- The development environment will be set up in the `sim/` directory
|
||||
|
||||
3. **Start Developing:**
|
||||
|
||||
- All dependencies and configurations are automatically set up
|
||||
@@ -206,7 +208,7 @@ If you prefer not to use Docker or Dev Containers:
|
||||
1. **Clone the Repository:**
|
||||
```bash
|
||||
git clone https://github.com/<your-username>/sim.git
|
||||
cd sim
|
||||
cd sim/sim
|
||||
```
|
||||
2. **Install Dependencies:**
|
||||
|
||||
@@ -251,26 +253,26 @@ Sim Studio is built in a modular fashion where blocks and tools extend the platf
|
||||
|
||||
### Where to Add Your Code
|
||||
|
||||
- **Blocks:** Create your new block file under the `/blocks/blocks` directory.
|
||||
- **Tools:** Create your new tool file under the `/tools` directory.
|
||||
- **Blocks:** Create your new block file under the `/sim/blocks/blocks` directory.
|
||||
- **Tools:** Create your new tool file under the `/sim/tools` directory.
|
||||
|
||||
In addition, you will need to update the registries:
|
||||
|
||||
- **Block Registry:** Update the blocks index (usually `/blocks/index.ts`) to include your new block.
|
||||
- **Tool Registry:** Update the tools registry (`/tools/index.ts`) to add your new tool.
|
||||
- **Block Registry:** Update the blocks index (usually `/sim/blocks/index.ts`) to include your new block.
|
||||
- **Tool Registry:** Update the tools registry (`/sim/tools/index.ts`) to add your new tool.
|
||||
|
||||
### How to Create a New Block
|
||||
|
||||
1. **Create a New File:**
|
||||
Create a file for your block (e.g., `newBlock.ts`) in the `/blocks/blocks` directory.
|
||||
Create a file for your block (e.g., `newBlock.ts`) in the `/sim/blocks/blocks` directory.
|
||||
|
||||
2. **Create a New Icon:**
|
||||
Create a new icon for your block in the `/components/icons.tsx` file.
|
||||
Create a new icon for your block in the `/sim/components/icons.tsx` file.
|
||||
|
||||
3. **Define the Block Configuration:**
|
||||
Your block should export a constant of type `BlockConfig`. For example:
|
||||
|
||||
```typescript:blocks/blocks/newBlock.ts
|
||||
```typescript:/sim/blocks/blocks/newBlock.ts
|
||||
import { SomeIcon } from '@/components/icons'
|
||||
import { BlockConfig } from '../types'
|
||||
|
||||
@@ -322,9 +324,9 @@ In addition, you will need to update the registries:
|
||||
```
|
||||
|
||||
4. **Register Your Block:**
|
||||
Import and add your block to the blocks registry (`blocks/index.ts`) in the appropriate index file so it appears in the workflow builder.
|
||||
Import and add your block to the blocks registry (`/sim/blocks/index.ts`) in the appropriate index file so it appears in the workflow builder.
|
||||
|
||||
```typescript:blocks/index.ts
|
||||
```typescript:/sim/blocks/index.ts
|
||||
import { NewBlock } from './blocks/newBlock'
|
||||
|
||||
export const blocks = [
|
||||
@@ -344,7 +346,7 @@ In addition, you will need to update the registries:
|
||||
### How to Create a New Tool
|
||||
|
||||
1. **Create a New Directory:**
|
||||
For tools with multiple related functions, create a directory under `/tools` (e.g., `/tools/newService`).
|
||||
For tools with multiple related functions, create a directory under `/sim/tools` (e.g., `/sim/tools/newService`).
|
||||
|
||||
2. **Create Tool Files:**
|
||||
Create files for your tool functionality (e.g., `read.ts`, `write.ts`) in your tool directory.
|
||||
@@ -352,7 +354,7 @@ In addition, you will need to update the registries:
|
||||
3. **Create an Index File:**
|
||||
Create an `index.ts` file in your tool directory that imports and exports all tools with appropriate prefixes:
|
||||
|
||||
```typescript:tools/newService/index.ts
|
||||
```typescript:/sim/tools/newService/index.ts
|
||||
import { readTool } from './read'
|
||||
import { writeTool } from './write'
|
||||
|
||||
@@ -363,7 +365,7 @@ In addition, you will need to update the registries:
|
||||
4. **Define the Tool Configuration:**
|
||||
Your tool should export a constant of type `ToolConfig`. For example:
|
||||
|
||||
```typescript:tools/newService/read.ts
|
||||
```typescript:/sim/tools/newService/read.ts
|
||||
import { ToolConfig, ToolResponse } from '../types'
|
||||
|
||||
interface NewToolParams {
|
||||
@@ -422,9 +424,9 @@ In addition, you will need to update the registries:
|
||||
```
|
||||
|
||||
5. **Register Your Tool:**
|
||||
Update the tools registry in `/tools/index.ts` to include your new tool. Import from your tool's index.ts file:
|
||||
Update the tools registry in `/sim/tools/index.ts` to include your new tool. Import from your tool's index.ts file:
|
||||
|
||||
```typescript:tools/index.ts
|
||||
```typescript:/sim/tools/index.ts
|
||||
import { newServiceReadTool, newServiceWriteTool } from './newService'
|
||||
// ... other imports
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files
|
||||
COPY package.json package-lock.json ./
|
||||
# Copy package files from sim directory
|
||||
COPY sim/package.json sim/package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
# Copy everything else (for build)
|
||||
COPY . .
|
||||
# Copy sim directory contents
|
||||
COPY sim/ ./
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ git clone https://github.com/YOUR_USERNAME/sim.git
|
||||
cd sim
|
||||
|
||||
# Create environment file
|
||||
cp .env.example .env
|
||||
cp sim/.env.example sim/.env
|
||||
|
||||
# Start the Docker environment
|
||||
docker compose up -d
|
||||
@@ -62,7 +62,8 @@ After running these commands:
|
||||
2. Install the [Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
|
||||
3. Open the project in your editor
|
||||
4. Click "Reopen in Container" when prompted
|
||||
5. Run `npm run dev` in the terminal
|
||||
5. The environment will automatically be set up in the `sim` directory
|
||||
6. Run `npm run dev` in the terminal or use the `sim-start` alias
|
||||
|
||||
### Option 3: Manual Setup
|
||||
|
||||
@@ -71,7 +72,7 @@ After running these commands:
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone https://github.com/YOUR_USERNAME/sim.git
|
||||
cd sim
|
||||
cd sim/sim
|
||||
|
||||
# Install dependencies
|
||||
npm install
|
||||
|
||||
@@ -8,7 +8,7 @@ services:
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- .:/app
|
||||
- ./sim:/app
|
||||
- /app/node_modules
|
||||
- /app/.next
|
||||
environment:
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0c36ff1e237cbde797d005f6cb7d740f883efda7e5f724c2fbb60d9208f9c2e0
|
||||
size 412
|
||||
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared'
|
||||
|
||||
/**
|
||||
* Shared layout configurations
|
||||
*
|
||||
* you can customise layouts individually from:
|
||||
* Home Layout: app/(home)/layout.tsx
|
||||
* Docs Layout: app/docs/layout.tsx
|
||||
*/
|
||||
export const baseOptions: BaseLayoutProps = {
|
||||
nav: {
|
||||
title: (
|
||||
<>
|
||||
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" aria-label="Logo">
|
||||
<circle cx={12} cy={12} r={12} fill="currentColor" />
|
||||
</svg>
|
||||
My App
|
||||
</>
|
||||
),
|
||||
},
|
||||
links: [
|
||||
{
|
||||
text: 'Documentation',
|
||||
url: '/docs',
|
||||
active: 'nested-url',
|
||||
},
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user