diff --git a/README.md b/README.md index 810362d..98d79db 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,27 @@ This tool provides an intuitive drag-and-drop interface that empowers developers DL-Playground Demo +--- + +## Getting Started + +To get the application running locally, follow these steps. + +### 1. Clone the Repository + +```bash +git clone https://github.com/your-username/DL-Playground.git +cd DL-Playground +``` + +### 2. Run the setup script (Docker required) + +```bash +chmod +x setup.sh +./setup.sh +``` + +The frontend will be available at `http://localhost:7000`. Open this URL in your browser to start using the playground! --- @@ -54,33 +75,6 @@ This tool provides an intuitive drag-and-drop interface that empowers developers --- -## Getting Started - -To get the application running locally, follow these steps. - -### 1. Clone the Repository - -```bash -git clone https://github.com/your-username/DL-Playground.git -cd DL-Playground -``` - -### 2. Build the Torchlens image - -```bash -docker build -t torchlens-worker:latest ./backend/ -``` - -### 3. Build docker compose - -```bash -docker compose up -d --build -``` - -The frontend will be available at `http://localhost:7000`. Open this URL in your browser to start using the playground! - ---- - ## How to Use 1. **Open the Application**: Navigate to the frontend URL in your browser. diff --git a/frontend/src/FlowEditor.tsx b/frontend/src/FlowEditor.tsx index e5b6eaf..c65125d 100644 --- a/frontend/src/FlowEditor.tsx +++ b/frontend/src/FlowEditor.tsx @@ -109,7 +109,8 @@ function FlowContent() { reader.onload = ev => { try { const parsed = JSON.parse(String(ev.target?.result)); - + setNodes(parsed.nodes); + setEdges(parsed.edges); } catch (err) { console.error("Failed to import graph", err); alert("Failed to import graph JSON."); diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..0bc1c8b --- /dev/null +++ b/setup.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e + +IMAGE_NAME="torchlens-worker:latest" + +echo "Pulling latest changes from main..." +git pull origin main + +echo "Checking if Docker image '$IMAGE_NAME' exists..." + +if [[ "$(docker images -q $IMAGE_NAME 2> /dev/null)" == "" ]]; then + echo "Image not found. Building Docker image..." + docker build -t $IMAGE_NAME ./backend/ +else + echo "Image already exists. Skipping build." +fi + +echo "Starting Docker Compose..." +docker compose up -d --build + +echo "Setup complete!"