diff --git a/setup-macos.sh b/setup-macos.sh new file mode 100644 index 0000000..1bcd255 --- /dev/null +++ b/setup-macos.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Prompt for environment variables +read -p "Please enter the DATA_ENDPOINT: " DATA_ENDPOINT +read -p "Please enter the NEXT_PUBLIC_MAPBOX_TOKEN: " NEXT_PUBLIC_MAPBOX_TOKEN + +# Create or update the .env file +echo "DATA_ENDPOINT=$DATA_ENDPOINT" > .env +echo "NEXT_PUBLIC_MAPBOX_TOKEN=$NEXT_PUBLIC_MAPBOX_TOKEN" >> .env + +# Check if Node.js is installed +if ! command -v node &> /dev/null +then + echo "Node.js not found, installing..." + curl -o nodejs.pkg https://nodejs.org/dist/v18.17.1/node-v18.17.1.pkg + sudo installer -pkg nodejs.pkg -target / + rm nodejs.pkg +fi + +# Navigate to the application folder +cd "$(dirname "$0")" + +# Install npm dependencies +echo "Installing npm dependencies..." +npm install + +# Run the Next.js development server +echo "Starting Next.js..." +npm run dev \ No newline at end of file diff --git a/setup-windows.bat b/setup-windows.bat new file mode 100644 index 0000000..8b3a5b0 --- /dev/null +++ b/setup-windows.bat @@ -0,0 +1,33 @@ +@echo off +SETLOCAL + +REM Prompt for environment variables +set /p DATA_ENDPOINT=Please enter the DATA_ENDPOINT: +set /p NEXT_PUBLIC_MAPBOX_TOKEN=Please enter the NEXT_PUBLIC_MAPBOX_TOKEN: + +REM Create or update the .env file +echo DATA_ENDPOINT=%DATA_ENDPOINT% > .env +echo NEXT_PUBLIC_MAPBOX_TOKEN=%NEXT_PUBLIC_MAPBOX_TOKEN% >> .env + +REM Check if Node.js is installed +where node >nul 2>&1 +IF %ERRORLEVEL% NEQ 0 ( + echo Installing Node.js... + curl -o nodejs.msi https://nodejs.org/dist/v18.17.1/node-v18.17.1-x64.msi + start /wait msiexec /i nodejs.msi /quiet /norestart + del nodejs.msi +) + +REM Navigate to the application folder +cd /d "%~dp0" + +REM Install npm dependencies +echo Installing npm dependencies... +npm install + +REM Run the Next.js development server +echo Starting Next.js... +npm run dev + +ENDLOCAL +pause \ No newline at end of file