RS UI is a Laravel + Inertia + React application for browsing partners, collections, and file-system-like paths backed by an external API.
- Laravel (PHP)
- Inertia.js + React + TypeScript
- Vite
- Tailwind CSS + Radix UI primitives
- Pest (PHP tests)
- PHP 8.2+ (the
ddevenvironment provisions PHP 8.4) - Composer
- Node.js 20+
- npm
- ddev — required: all commands in this README and in
CI are run through
ddev, not directly against a host PHP/Node install.
ddev composer install
ddev npm install
cp .env.example .env
ddev php artisan key:generate
ddev php artisan migrate
ddev npm run devIn a second terminal, run:
php artisan serveRS UI is a proxy/UI layer, not a system of record: it holds almost no domain data of its own. Partners, collections, files, and search results all live in an external API ("RSBE"), and RS UI's job is to authenticate against it, shape its responses into typed Inertia props, and render them with React.
- Laravel owns routing, session/auth middleware, request validation, and the HTTP
boundary to RSBE (
app/Services/ExternalApiService.php,app/Services/ExternalApiClient.php,app/Services/ExternalFileDownloader.php). - Inertia.js lets controllers return React page components directly
(
Inertia::render(...)), so there is no separate first-party JSON API/SPA pair to maintain for page navigation (seedocs/adr/0002-inertia-over-separate-spa.md). - React + TypeScript renders the pages/components in
resources/js/. A handful of in-page interactions (search, previews, workflow submission) call small JSON endpoints via the sharedapiFetch/apiFetchTexthelpers inresources/js/lib/api.ts. - The local
userstable exists only so Laravel'sAuthfacade has something to authenticate against once RSBE confirms a login — it is not an independent identity store (seedocs/adr/0001-external-auth-over-laravel-auth.md). - File browsing/preview/download routes proxy RSBE rather than exposing it directly to
the browser (see
docs/adr/0003-proxy-file-system-through-laravel.md).
See docs/adr/ for the full set of architecture decision records and
docs/api-contract.md for every external endpoint RS UI depends on.
Copy .env.example to .env (done automatically by composer create-project, or run
cp .env.example .env yourself) and set at minimum:
| Variable | Purpose |
|---|---|
RS_V1_ENDPOINT |
Base URL of the external RS API (RSBE), e.g. https://rsbe.example.edu/api/v0/. Resolved via config('services.rs.v1.endpoint'). All external requests in app/Services/ are built against this. |
RS_PASSWORD_MIN_LENGTH |
Minimum new-password length enforced on the password settings page (default 15). Must match RSBE's AUTHN_PASSWORD_MIN_LENGTH. |
APP_URL |
Base URL RS UI is served from; used for absolute links and asset generation. |
APP_ENV |
local/production/etc. Set to e2e only when running the E2E suite (scripts/e2e.sh handles this) — it loads .env.e2e instead of .env and must not be used outside that workflow. |
SESSION_DRIVER, SESSION_LIFETIME, SESSION_DOMAIN |
Standard Laravel session config. Note external_auth_expires (see below) independently bounds how long a user stays logged in, regardless of SESSION_LIFETIME. |
RS UI additionally depends on two session values (not .env values) written by
ExternalAuthController::login() after a successful RSBE login:
external_auth_cookie— the RSBEAuthorizationcookie value, forwarded on every authenticated request to RSBE.external_auth_expires— a Unix timestamp from that cookie'sExpiresattribute; once it has passed,CheckExternalAuthExpirationlogs the user out of the local Laravel session too.
See docs/api-contract.md for the full external API contract these values interact
with.
# Frontend dev/build
ddev npm run dev
ddev npm run build
ddev npm run types
ddev npm run lint
ddev npm run formatSee Testing and Static analysis below for backend/quality commands.
PHPStan (via Larastan) runs at level 5 over app/, configured in phpstan.neon. Run it
with composer run analyse (or ddev exec "vendor/bin/phpstan analyse --memory-limit=512M").
The codebase currently passes at level 5 with zero errors; the level can be raised
incrementally as coverage matures.
# PHP (Pest) — full suite
ddev php artisan test
# PHP — a single file
ddev php artisan test tests/Feature/ExternalApiServiceAuthCookieTest.php
# Formatting
vendor/bin/pint --dirty
# End-to-end (Playwright, against a hermetic mock RS API — see tests/e2e/README.md)
ddev npm run test:e2eThere is no JavaScript unit/component test runner installed yet (no Jest/React Testing
Library) — user-facing flows are covered by the Playwright E2E suite instead. See
docs/testing-plan.md for current coverage (PHP + E2E test counts and what each covers)
and remaining gaps, and tests/e2e/README.md for E2E infrastructure details.
.github/workflows/build-release.yml builds and publishes a release whenever a v* tag
is pushed. Manual workflow dispatches require a release tag, which is created at the
selected commit:
- Installs PHP dependencies (
--no-dev) and builds frontend assets (pnpm run build), verifyingpublic/buildexists. - Packages the app into
release.tar.gz(excluding dev-only files) and attaches it to a GitHub Release — tags containingalpha/beta/rc/dev/previeware marked as prereleases. - Triggers a
deploy-devordeploy-prodjob depending on the tag. These jobs are currently placeholders — fill in the actual deploy mechanism for your environment.
See docs/RUNBOOK.md for rollback steps and other operational procedures.
- Blank page / "Unable to locate file in Vite manifest" error — run
ddev npm run build(production) or make sureddev npm run dev/composer run devis running (development). Seedocs/RUNBOOK.mdfor the E2E-specific case (public/hot). - User unexpectedly logged out — expected once
external_auth_expireshas passed; seedocs/RUNBOOK.mdfor how to distinguish this from a cookie-selection regression. - 502/503 or an external-API error page — RSBE is unreachable or erroring; see
docs/RUNBOOK.md→ "The external API is down or returning errors" for diagnostic steps and log queries. - Where to look first —
storage/logs/laravel.log. Application code logs structured context (e.g.partner_id,collection_id,workflow_id,status) rather than free text, sogrepon those keys to isolate an issue.
Core identity management workflows—including user registration, password resets, and email verification—are owned and managed externally by RSBE.
These features are intentionally absent from this application. All user onboarding, account recovery, and verification processes must be handled directly through the RSBE service.
RSUI delegates authorization, roles, and privileges to the external RS API. The API enforces whether an authenticated user may access a partner, collection, path, or workflow; RSUI intentionally does not duplicate those policies locally.
The /fs, /preview, and /download routes proxy the path formats defined by the
external API. Path traversal and normalization protections are enforced by that API
layer, so RSUI must preserve the upstream path contract rather than apply a separate
normalization scheme. RSUI is still responsible for authentication/session middleware,
request validation, and preserving its own routing-prefix transformations.
- Authenticated users enter the dashboard and navigate partners/collections.
- Collection browsing and file preview/download actions call external API-backed endpoints.
- Search pages call
SearchController, which delegates query execution and pagination toExternalApiService. - React pages render via Inertia responses from Laravel controllers.
GET /dashboard— partners indexGET /partners/{partner}— partner detailsGET /collections/{collection}— collection detailsGET /paths/{partner}/{collection}/{path?}— path browsingGET /preview/{path}— file previewGET /download/{path}— file download streamGET /search— search pageGET /api/search— API search endpointGET /api/search/autocomplete— autocomplete endpoint
app/
Http/Controllers/ # Inertia/API controllers
Services/ # External API integration layer
resources/js/
components/ # UI and feature components
pages/ # Inertia page components
hooks/ # Shared React hooks
tests/ # Pest feature/unit tests
- Architecture decision records:
docs/adr/ - External API contract:
docs/api-contract.md - Operational runbook:
docs/RUNBOOK.md - Testing plan and current coverage:
docs/testing-plan.md - E2E test infrastructure:
tests/e2e/README.md - Production-readiness audit and remaining work:
docs/production-readiness-plan.md - Known gaps:
docs/TODO.md - Contributing guide:
CONTRIBUTING.md - Security policy:
SECURITY.md