> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scriptonia.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# installation

# System Requirements

## Required

* Node.js — 18.x or 20.x (LTS recommended)
* npm — 9+ (or yarn / pnpm)
* PostgreSQL — 14+
* Git — For cloning the repository
* OS — Windows, macOS, or Linux

## Optional (for full flow)

* Phantom or another Solana wallet (for crypto payments)
* Helius or another Solana RPC (recommended for payments)

***

# Installation Methods

## Method 1: Clone and npm (recommended)

```
git clone <repository-url>
cd scriptonia
npm install
```

* postinstall runs prisma generate
* DATABASE\_URL can be unset at install time

## Method 2: After clone — database and run

```
cp env.example .env
# Edit .env: set DATABASE_URL and at least one AI key (see Environment setup & Configuration)

npx prisma migrate dev
npm run dev
```

App:\
[http://localhost:3000](http://localhost:3000)

***

# Production build

```
npm run build
npm start
```

For production:

* Run `npx prisma migrate deploy`
* Do not use prisma migrate dev
* Ensure all required env vars are set in the deployment environment

***

# Environment Setup

## 1. Copy the example file

```
cp env.example .env
```

## 2. Edit .env

* Fill in your values
* Never commit .env to version control

## 3. Minimum for Idea → Intent → Platform

* DATABASE\_URL
* One of:
  * OPENAI\_API\_KEY
  * OPENROUTER\_API\_KEY\_GROK4
  * OPENROUTER\_API\_KEY\_QWEN3
  * OPENROUTER\_API\_KEY\_GEMINI2\_5

## 4. For Payment → Execution → Completion

### Solana

* HELIUS\_RPC\_URL or NEXT\_PUBLIC\_SOLANA\_RPC\_URL
* TREASURY\_WALLET
* NEXT\_PUBLIC\_SCRIPT\_TOKEN\_MINT
* NEXT\_PUBLIC\_REOWN\_PROJECT\_ID (optional, for AppKit)

### Dodo

* DODO\_API\_KEY
* DODO\_WEBHOOK\_SECRET
* DODO\_PRODUCT\_ID
* NEXT\_PUBLIC\_APP\_URL

## 5. For GitHub push on Completion

* GITHUB\_CLIENT\_ID
* GITHUB\_CLIENT\_SECRET
* GITHUB\_CALLBACK\_URL

***

# Configuration

## Database (required)

```
DATABASE_URL="postgresql://USER:PASSWORD@HOST:5432/DATABASE?schema=public"
```

### Local

```
postgresql://postgres:postgres@localhost:5432/scriptonia
```

### Supabase

* Project → Settings → Database → Connection string (URI)

### Neon / Railway

* Connection string from dashboard

***

## AI (required for Idea, Intent, Platform, Execution)

### Option A — OpenRouter (Grok, Qwen, Gemini)

```
OPENROUTER_BASE_URL=https://openrouter.ai/api/v1/chat/completions
DEFAULT_MODEL=GROK
```

* At least one OPENROUTER\_API\_KEY\_\* is required
* See OPENROUTER\_[SETUP.md](http://SETUP.md) for model IDs

### Option B — OpenAI

```
OPENAI_API_KEY=
```

***

## Solana (crypto payments)

```
NEXT_PUBLIC_SOLANA_NETWORK=devnet
NEXT_PUBLIC_SOLANA_RPC_URL=
NEXT_PUBLIC_SCRIPT_TOKEN_MINT=
TREASURY_WALLET=
```

* Use mainnet and mainnet RPC for production

***

## Reown AppKit (wallet UI)

```
NEXT_PUBLIC_REOWN_PROJECT_ID=
```

From:\
[https://dashboard.reown.com](https://dashboard.reown.com)

***

## Dodo (card / UPI payments)

```
DODO_API_KEY=
DODO_WEBHOOK_SECRET=
DODO_PRODUCT_ID=
NEXT_PUBLIC_APP_URL=
```

From:\
[https://dashboard.dodopayments.com](https://dashboard.dodopayments.com)

Webhook URL:

```
https://your-domain/api/dodo/webhook
```

For local testing:

* Use a tunnel (e.g. ngrok)
* Set NEXT\_PUBLIC\_APP\_URL accordingly

***

## GitHub (repo creation and upload)

```
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_CALLBACK_URL=
```

Create an OAuth App at:\
[https://github.com/settings/developers](https://github.com/settings/developers)

For production:

```
https://your-domain/api/github/callback
```

***

## Pricing (optional)

```
UNIFIED_PRICE_SCRIPT=10000
UNIFIED_PRICE_USD=4
```

***

## Other (optional)

```
NEXT_PUBLIC_SITE_URL=http://localhost:3000
DEBUG=true
LOG_LEVEL=INFO
```

***

# Verification

## 1. Database

```
npx prisma migrate dev
```

(or migrate deploy in production) completes without errors

```
npx prisma studio
```

(optional) opens and shows tables

## 2. App

```
npm run dev
```

Open:\
[http://localhost:3000](http://localhost:3000)

* Home page loads

## 3. Idea (/)

* Enter an idea
* Submit
* Analysis and clarifying questions appear

## 4. Intent (/intent)

* Answer the questions
* Refined requirements appear

## 5. Platform (/platform)

* Platform options with cost and timeline appear

## 6. Payment (/payment)

* Solana: Wallet connect (Phantom / AppKit) works
* Dodo: “Buy with Card” appears and redirects to Dodo Checkout

## 7. Execution & Completion

After successful payment:

* Execution runs
* Completion shows summary and ZIP download
