# Spaceship setup — Beat My Car Quote

This package is prepared for Spaceship Web Hosting's **Setup Node.js App** tool.

## 1. Create the Node.js application

In Spaceship, open **Hosting Manager**, enter **cPanel**, and choose **Setup Node.js App** under **Exclusive**. Select **Create Application** and use:

- **Node.js version:** 22 or 24
- **Application mode:** Production
- **Application root:** `beatmycarquote`
- **Application URL:** `beatmycarquote.com`
- **Application startup file:** `server.js`

Create the application before uploading the website.

## 2. Upload the package

Open cPanel **File Manager**, then open the application root directory created above. Upload this ZIP there and extract it. `package.json`, `server.js`, and the `app` folder must sit directly inside the application root, not inside an extra nested folder.

## 3. Install and build

Return to **Setup Node.js App** and select **Run NPM Install**.

Then use Spaceship's SSH access, enter the virtual-environment command displayed at the top of the Node.js application page, change into the application root, and run:

```text
npm run build
```

## 4. Add secure environment variables

In the Node.js application settings, add:

```text
NODE_ENV=production
STRIPE_SECRET_KEY=sk_test_replace_me
STRIPE_RESEARCH_FEE_CENTS=5000
STRIPE_CURRENCY=cad
STRIPE_AUTOMATIC_TAX=false
NEXT_PUBLIC_SITE_URL=https://beatmycarquote.com
```

Use a Stripe test key first. Never place the real key in a publicly accessible file.

## 5. Start and test

Save the application settings and choose **Restart**. Visit `https://beatmycarquote.com`, complete the vehicle form, and finish one Stripe test-mode payment.

Only replace the test key with a live or appropriately restricted Stripe key after the test succeeds.

## Before launch

- Confirm CAD is the intended currency.
- Confirm the CAD $50 fee.
- Confirm `hello@beatmycarquote.com` is active.
- Review the refund language in the service terms.
- Confirm Spaceship's FreeSSL is active for the domain.
