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:
src/
├── specstar/
│ ├── generated/ # generated types, API clients, resource metadata
│ └── 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.