diff options
| author | IwanIDev <iwan@iwani.dev> | 2026-03-20 13:39:53 +0000 |
|---|---|---|
| committer | IwanIDev <iwan@iwani.dev> | 2026-03-20 13:39:53 +0000 |
| commit | 719a1e81d5af5c872f79f11f462e4b30211f80b7 (patch) | |
| tree | 5f6a3380481c2c853f0b646ea644515114377466 /README.md | |
| parent | a706dcf6a9b91ef2c3d1e1d28449b9b8e0e8187d (diff) | |
Add local development support with Docker for Drupal and configure API proxy
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -21,6 +21,11 @@ Available variables: - `VITE_DRUPAL_API_PREFIX` (optional) – defaults to `/jsonapi` - `VITE_DRUPAL_AUTH_TOKEN` (optional) – bearer token used by the HTTP client +For local development with the included Drupal stack (CORS-safe via Vite proxy), use: + +- `VITE_DRUPAL_BASE_URL=http://localhost:5173` +- `VITE_DRUPAL_API_PREFIX=/drupal-api/jsonapi` + ## Client utilities - Typed env config: `src/config/env.ts` @@ -47,6 +52,32 @@ bun install bun run dev ``` +## Local Drupal server (for testing) + +Start local Drupal + MariaDB: + +```bash +docker compose -f docker-compose.local.yml up -d +``` + +Then open Drupal installer: + +- `http://localhost:8081` + +After installation: + +1. Enable JSON:API module in Drupal (if not already enabled). +2. Create at least one Article content item. +3. Keep frontend env values on proxy mode (`http://localhost:5173` + `/drupal-api/jsonapi`). + +Run frontend: + +```bash +bun run dev +``` + +Your React app requests `/drupal-api/...` on the Vite dev server, and Vite proxies to Drupal at `http://localhost:8081`, avoiding browser CORS issues. + ## Docker build and run Pass Drupal variables at build time (Vite injects `VITE_*` during build): |
