A B2X (Business-to-Consumer) sample React web app for Salesforce Experience Cloud. Demonstrates property listings, maintenance requests, and a dashboard with an app shell designed for external-facing deployment. Built with React, Vite, TypeScript, and Tailwind/shadcn.
| `force-app/main/default/sites/` | Salesforce site |
## Getting started
Navigate to the web app and install dependencies:
```bash
cd force-app/main/default/webapplications/appreactsampleb2x
npm install
npm run dev
```
Opens at http://localhost:5173 by default. For build and test instructions, see the [web app README](force-app/main/default/webapplications/appreactsampleb2x/README.md).
## Deploy
### Deploy everything (metadata + Experience Cloud site + web app)
```bash
cd force-app/main/default/webapplications/appreactsampleb2x && npm install && npm run build && cd -
sf project deploy start --source-dir force-app --target-org <alias>
```
### Deploy the web app only
```bash
cd force-app/main/default/webapplications/appreactsampleb2x && npm install && npm run build && cd -
sf project deploy start --source-dir force-app/main/default/webapplications --target-org <alias>
```
### Deploy metadata only (objects, layouts, permission sets, Apex classes)
sf data import tree --plan force-app/main/default/data/data-plan.json --target-org <alias>
```
## Using setup-cli.mjs
When this app is built (e.g. from the monorepo or from a published package), a `setup-cli.mjs` script is included at the project root. It runs the full setup in one go: login (if needed), deploy metadata, assign the `Property_Management_Access` permission set, prepare and import sample data, fetch GraphQL schema and run codegen, build the web app, and optionally start the dev server.
Run from the **project root** (the directory that contains `force-app/`, `sfdx-project.json`, and `setup-cli.mjs`):
The `sfdx-project.json` file contains useful configuration information for your project. See [Salesforce DX Project Configuration](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_config.htm) in the _Salesforce DX Developer Guide_ for details about this file.