# DriveLux Motors — Fresh Installation Guide

## Requirements
- Node.js 22 LTS or newer
- Internet access for dependency installation
- A Supabase project for hosted authentication/database features
- Bun is recommended because the project includes `bun.lock`; npm is supported as a fallback

## Windows
1. Extract the entire ZIP to a writable folder (do not run it from inside the ZIP viewer).
2. Double-click `install.bat`.
3. Open `.env` and replace the example values with the credentials from your Supabase project.
4. In the project folder, run `npm run dev` (or `bun run dev` if using Bun).
5. Open the local URL printed by the development server.

## Linux, macOS, or Replit shell
1. Extract the ZIP and open a terminal in the `car-dealer-shop` directory.
2. Run `chmod +x install.sh && ./install.sh`.
3. Configure `.env` with your Supabase project values.
4. Run `npm run dev` or `bun run dev`.

## Production build
- Install dependencies first.
- Run `npm run build` or `bun run build`.
- Run `npm run preview` or `bun run preview` to preview the built app locally.

## Environment configuration
The ZIP intentionally excludes any existing `.env` file or private credentials. The installer copies `.env.example` to `.env` only if `.env` does not already exist. Fill in all required values using your own Supabase project:

- `SUPABASE_PROJECT_ID`
- `SUPABASE_PUBLISHABLE_KEY`
- `SUPABASE_URL`
- `VITE_SUPABASE_PROJECT_ID`
- `VITE_SUPABASE_PUBLISHABLE_KEY`
- `VITE_SUPABASE_URL`

Never commit or share `.env` with real credentials.

## Database and launch checklist
- Review the migrations in `drizzle/migrations/` and apply the required schema/migrations to the intended database before relying on persisted data.
- Confirm Supabase authentication and database policies are configured for your project.
- Replace demonstration vehicle inventory with verified listings and real pricing.
- Checkout currently submits an order request; online payment processing requires a separately configured payment provider.
- Run `npm run build` and test inventory browsing, vehicle detail pages, cart/checkout, sign-in, and any protected admin routes before production deployment.

## Troubleshooting
- If the install fails, check Node.js version (`node -v`) and network access, then retry with `bun install --frozen-lockfile` or `npm install`.
- If Supabase features fail, verify the `.env` values and restart the dev server after changing them.
- If a production build fails, retain the full terminal error output to diagnose the exact dependency or source issue.
