Web UI¶
SpecStar can generate a complete React admin application from your backend's OpenAPI schema.
This is useful when you want a working internal tool quickly without building list pages, forms, clients, and revision views by hand.
What the generator gives you¶
From a running SpecStar backend, the web generator can produce:
- TypeScript types from OpenAPI
- API clients for each resource
- list and detail pages
- create and edit forms
- a resource dashboard
- an admin navigation shell
The generated app is a normal React project, so you can keep customizing it after generation.
Requirements¶
Before generating the UI, make sure you have:
- a running SpecStar backend
- the OpenAPI schema available at
/openapi.json - Node.js 18+
pnpmornpm
Quick start¶
1. Install the generator¶
Or with pnpm:
The published package name is
specstar-web-generator, while the command you run after installation isspecstar-web.
2. Create a new frontend project¶
3. Generate code from your backend¶
Make sure your SpecStar API is already running, then fetch its schema:
4. Start the development server¶
Then open:
http://localhost:5173
Typical workflow¶
Use this workflow during development:
- update your SpecStar models in the backend
- restart the backend if needed
- re-run
specstar-web generate --url ... - continue customizing the React app
This keeps the frontend aligned with the latest API schema.
Generated project structure¶
A typical project contains these important areas:
public/ # static assets, including the app logo
src/
├── specstar/
│ ├── generated/ # generated types, API clients, resource metadata, branding
│ └── lib/ # reusable customizable components and customization hooks
└── routes/ # application routes
Edit these files¶
You should customize the tracked files under src/specstar/lib/ and the route layer.
Common customization points include:
resourceCustomization.tsfor field-level overridesclient.tsfor Axios configuration- reusable components for custom layouts and rendering
Avoid editing generated files directly¶
The files under src/specstar/generated/ are overwritten whenever you regenerate from OpenAPI.
If you need stable custom behavior, add it in the tracked customization layer instead.
Integrating into an existing React app¶
If you already have a React project, use the integrate command instead of creating a new app:
This adds the SpecStar-generated pieces without replacing your main project configuration.
Development proxy and API URL¶
The generated frontend typically uses a Vite development proxy.
- in development, API requests can go through
/api - the proxy forwards them to your backend target
- in production, set
VITE_API_URLto the real backend URL
This avoids common CORS issues during local development.
Naming and branding¶
The generated app is your admin console, so it carries your name and logo rather than SpecStar's.
The title shown in the browser tab, on the landing page, and in the admin header is resolved on every generate, from the first of these that is set:
- the
titlefield in.specstarrc.json - the
info.titleof your backend's OpenAPI spec SpecStar Admin, as a fallback
The logo works the same way, via the logo field, defaulting to the SpecStar mark shipped at public/specstar-mark.svg.
Both live in .specstarrc.json at the project root:
A logo value is a URL path served from public/, so "/northwind.svg" means public/northwind.svg. Drop your own file in there and point logo at it.
Because most backends already set a real info.title, you usually get a correctly named console without configuring anything. A backend that never set one reports the stock FastAPI title, which is ignored so it cannot become your app's name.
Both values are written into src/specstar/generated/branding.ts and stamped into index.html — the browser reads the tab name and favicon from the HTML before React starts, so both stay in step. Run generate again after editing .specstarrc.json to apply a change.