Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,24 @@ Die App vereint:

### Lokale Entwicklung

Schnellstart mit Setup-Skript:

```bash
git clone https://github.com/pappensex/YONI-app.git
cd YONI-app
npm install
npm run setup:local
npm run dev
```

Die App ist dann verfügbar unter: **http://localhost:3000**

Alternativ manuell:

```bash
npm install
npm run dev
```

Siehe [YONI_Local_Run_Guide.md](YONI_Local_Run_Guide.md) für Details.

### iPhone-Demo / Testversand
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"fix:content": "node project-ops/launch/fix-content.js",
"validate:notion": "node project-ops/launch/validate-notion-template.js",
"test:notion": "node project-ops/launch/test-validate.js",
"setup:local": "bash scripts/setup-local.sh",
"domains:setup": "bash scripts/setup-domains.sh",
"domains:setup:dry-run": "bash scripts/setup-domains.sh --dry-run"
},
Expand Down
24 changes: 24 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,30 @@ npm run validate:notion

---

### Local Development

#### `setup-local.sh`

Bootstraps a local environment by installing dependencies and preparing
environment variables.

**Usage:**

```bash
# Run the setup helper
./scripts/setup-local.sh

# Or via npm
npm run setup:local
```

The script will:
- Verify Node.js and npm are available
- Copy `.env.example` to `.env.local` if it does not yet exist
- Run `npm install`

---

## Adding New Scripts

When adding new scripts to this directory:
Expand Down
31 changes: 31 additions & 0 deletions scripts/setup-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -euo pipefail

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"

if ! command -v node >/dev/null 2>&1; then
echo "[Error] Node.js is not installed. Please install Node >=18.17.0." >&2
exit 1
fi

if ! command -v npm >/dev/null 2>&1; then
echo "[Error] npm is not installed. Install it before continuing." >&2
exit 1
fi

if [ ! -f .env.local ] && [ -f .env.example ]; then
cp .env.example .env.local
echo "[Info] Created .env.local from .env.example. Update it with your keys."
fi

if [ ! -d node_modules ]; then
echo "[Info] Installing dependencies with npm install..."
else
echo "[Info] node_modules already exists. Running npm install to ensure sync..."
fi

npm install

echo "[Done] Local setup complete. Start the dev server with: npm run dev"
echo " App available at http://localhost:3000 after the server starts."