add client run instructions

This commit is contained in:
2026-04-19 19:04:13 -06:00
parent 75651a6bd3
commit ebb9b77025

View File

@@ -111,3 +111,83 @@ docker compose up --build -d
```
Starts the API and MySQL together. The web frontend has its own Dockerfile for independent deployment.
## Running the Web App
Requires Node.js 18+.
```sh
cd web
cp .env.example .env.local
npm install
npm run dev
```
Open `http://localhost:3000`. The app proxies API calls to the backend at `http://localhost:8080` by default.
To point at a different backend, edit `BACKEND_URL` and `NEXT_PUBLIC_BACKEND_URL` in `.env.local`.
For a production build:
```sh
npm run build
npm run start
```
## Running the Desktop App (JavaFX)
Requires IntelliJ IDEA and Java 25+.
1. Open the `desktop/` directory in IntelliJ.
2. Copy `connectionpetstore.properties.example` to `connectionpetstore.properties` and edit it to match your database. The defaults expect the dev Docker database:
```
url=jdbc:mysql://127.0.0.1:3306/Petstoredb?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
user=petshop
password=petshop
```
3. Open **View > Tool Windows > Maven** and click **Reload All Maven Projects**.
4. Expand **Plugins > javafx** and double-click **javafx:run**.
Default accounts seeded on first run:
| Role | Username | Password |
|------|----------|----------|
| Admin | `admin` | `admin123` |
| Staff | `staff` | `staff123` |
## Running the Android App
Requires Android Studio and the Android SDK (min API 24).
1. Copy `local.properties.template` to `local.properties` and set `sdk.dir` to your Android SDK path.
2. Configure the backend URLs in `local.properties`:
```properties
# Emulator — 10.0.2.2 maps to the host machine's localhost
petstore.backend.emulatorUrl=http\://10.0.2.2\:8080/
# Physical device — use the host machine's LAN IP
petstore.backend.deviceUrl=http\://192.168.x.x\:8080/
```
3. Open the `android/` directory in Android Studio.
4. Sync Gradle, then run on an emulator or connected device.
## Running the Backend
Requires IntelliJ IDEA and Java 25+.
1. Open the `backend/` directory in IntelliJ.
2. Copy `.env.example` to `.env` and fill in your API keys.
3. Start the database using Docker from IntelliJ's **Services** panel, or from a terminal:
```sh
cd backend
docker compose -f docker-compose.dev.yml up -d
```
4. Run the `BackendApplication` main class from IntelliJ.
The API starts at `http://localhost:8080`. Flyway runs migrations and seeds data automatically on first boot.