Quick start
Method 1: Use scaffolding (recommended)
VextJS provides the vext create command to create a runnable project. The default template proves the one-route model immediately: / renders React through res.render(), /api/hello returns JSON, and both use the generated example service. Choose API-only when no page runtime is needed.
After creation is complete:
Visit http://localhost:3000 for the server-rendered starter and http://localhost:3000/docs for live API documentation. The backend API routes are available at /api/hello and /api/health.
Method 2: Manual creation
1. Initialize project
2. Configure package.json
VextJS requires "type": "module", and the project uses the ESM module format.
3. Create directory structure
4. Write configuration
If you need to use other Adapters (such as Hono), first install the corresponding package and then configure:
4.1 Optional: Add src/config/bootstrap.ts
If some configuration must be read from the remote end during startup and needs to be merged before config is frozen, you can add src/config/bootstrap.ts:
Suitable for: database, Nacos startup configuration, key patch.
Not suitable for: preload scenarios such as APM / OpenTelemetry that need to be executed earlier.
5. Write routing
6. Write services (optional)
Use services in routes:
7. Start
Frontend pages live under src/frontend/pages/**. Vext generates the browser entry, page registry, layout registry, and HTML injection code automatically. For a manual project, create at least src/frontend/pages/index.tsx, src/frontend/pages/_document.html, and src/frontend/styles/index.css, or start from the default vext create template.
The default full-stack template opens with an SSR Vext runtime launchpad that makes the route → service → SSR → browser-runtime path visible. Its header exposes both the Vext Guide and the generated app's local API documentation at /docs; the secondary action opens the Vext Guide. It enables openapi.enabled: true by default, so the local documentation entry works in development and production. It deliberately includes only real starter code: it does not create a root README or placeholder README files. Its AppShell uses the transparent public/vext-mark.svg; public/favicon.svg is the contrast-safe favicon variant built from the same V geometry. Add optional convention directories only when you add their source files.
Project structure
After scaffolding or manual creation, your project structure should look like this:
VextJS will automatically scan src/routes/, src/services/, src/config/, src/middlewares/, src/plugins/, src/locales/, src/preload/, src/frontend/, and public/ without manual registration. The initial scaffold creates only the directories with starter content; the optional convention directories are scanned whenever you create them. Project-root preload/ remains a warned migration fallback only. Route file names are mapped to URL prefixes:
src/config/local.example.ts and src/config/bootstrap.example.ts are sample files generated by the scaffolding. When you need to enable local overlay or startup provider, copy them as local.ts / bootstrap.ts respectively. If src/config/bootstrap.ts exists, it will be executed after default/env/local is merged and before CLI override, and the patch returned by the provider will be included in the final configuration link.
Access OpenAPI documentation
The default fullstack-react configuration already enables openapi.enabled: true. In an API-only project, or if you have turned it off, enable it before starting the project:
- Vext Docs Documentation:
http://localhost:3000/docs - OpenAPI JSON:
http://localhost:3000/openapi.json
CLI command overview
Development mode hot reload
vext dev provides a three-layer hot reload strategy and automatically selects the optimal method:
Next step
- Understand Project Structure conventions
- Configure the Frontend guide
- Learn the three-part definition of routing
- Explore middleware and plugins
- View the Configuration options