#!/bin/bash echo "Starting MVP setup for Proto-Peanut System (Go-based)" # Create directory structure mkdir -p proto_peanut_mvp/{server,client,logs,tools,weaviate,node_red} cd proto_peanut_mvp # Step 1: Install Go if not installed echo "Checking for Go installation..." if ! [ -x "$(command -v go)" ]; then echo 'Error: Go is not installed. Installing Go...' wget https://golang.org/dl/go1.19.4.linux-amd64.tar.gz tar -xvf go1.19.4.linux-amd64.tar.gz sudo mv go /usr/local export GOROOT=/usr/local/go export PATH=$GOPATH/bin:$GOROOT/bin:$PATH echo 'Go installed successfully.' else echo 'Go is already installed.' fi # Step 2: Set up Go module for the server echo "Setting up Go server..." cd server go mod init proto_peanut_server go get -u github.com/gin-gonic/gin go get github.com/weaviate/weaviate-go-client/v4/weaviate go get github.com/sirupsen/logrus # Step 3: Create the Go server cat > main.go < lastKnownId { newMessages = append(newMessages, msg) } } return newMessages } // Initialize Weaviate func initWeaviate() *weaviate.Client { config := weaviate.Config{ Scheme: "http", Host: "localhost:8080", } client := weaviate.New(config) return client } EOL # Step 4: Install Docker and Set up Weaviate (run in Docker container) echo "Setting up Weaviate using Docker..." cd ../weaviate cat > docker-compose.yml < chatbot_gradio.py < start_node_red.sh < run_mvp.sh <