# URBN Dental Upper Management - Shared Hosting Deploy

Domain: `dash.cyberdesign.co`

## Requirements

- Node.js 20.9+ or Node.js 22
- npm
- Ability to run a Node.js app with startup file `app.js`
- Persistent files enabled for:
  - `prisma/urbn-production.db`
  - `public/uploads`

## Environment Variables

Use these on the server:

```bash
DATABASE_URL="file:./prisma/urbn-production.db"
SESSION_SECRET="replace-this-with-a-random-secret-minimum-32-characters"
NODE_ENV="production"
```

Optional, only before first seed:

```bash
SEED_ADMIN_EMAIL="admin@urbndental.local"
SEED_ADMIN_PASSWORD="replace-this-before-running-seed"
```

## Build Commands

Run from the app folder:

```bash
npm install
npx prisma generate
npx prisma migrate deploy
npm run build
```

Only on the first deploy, create the initial admin and seed data:

```bash
npm run prisma:seed
```

## Start Command

For cPanel/Node app style hosting:

```bash
node app.js
```

If the hosting panel asks for startup file, use:

```text
app.js
```

If the hosting panel asks for app URL/path, point it to:

```text
dash.cyberdesign.co
```

## After Upload

1. Set environment variables.
2. Run `npm install`.
3. Run `npx prisma migrate deploy`.
4. Run `npx prisma generate`.
5. Run `npm run build`.
6. Run `npm run prisma:seed` only once.
7. Start/restart the Node.js app.

## Important

- Do not delete `prisma/urbn-production.db` after users start testing.
- Do not delete `public/uploads`; it stores uploaded logos, locations, and staff images.
- If a deploy overwrites the whole folder, back up these first:
  - `prisma/urbn-production.db`
  - `public/uploads`
