You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -74,6 +74,7 @@ These components are ideal for rapidly building backend management interfaces, f
74
74
75
75
We're introducing three production-ready React templates, each optimized for different use cases:
76
76
77
+
77
78
<react-template
78
79
name="react-vite"
79
80
description="A lightweight foundation built with React + Vite + TypeScript + Tailwind CSS—the ideal blank slate starting point for AI-generated UIs."></react-template>
@@ -89,7 +90,7 @@ We're introducing three production-ready React templates, each optimized for dif
89
90
90
91
## Comprehensive React Component Library
91
92
92
-
All three templates leverage our new [React Component Gallery](https://react.servicestack.net)—a high-fidelity port of our proven [Vue Component Library](/vue/) and [Blazor Component Library](https://blazor.servicestack.net). This comprehensive collection provides everything needed to build highly productive, modern and responsive web applications.
93
+
All three templates leverage our new [React Component Gallery](https://react.servicestack.net)—a high-fidelity port of our proven [Vue Component Library](https://docs.servicestack.net/vue/) and [Blazor Component Library](https://blazor.servicestack.net). This comprehensive collection provides everything needed to build highly productive, modern and responsive web applications.
@@ -107,6 +108,180 @@ Switch to Dark Mode to see how all components looks in Dark Mode:
107
108
108
109
ServiceStack's first-class React support positions your applications at the forefront of AI-assisted development. With declarative APIs, complete type safety, and minimal boilerplate, you can leverage AI code generation with confidence while maintaining the quality and maintainability your production systems demand.
109
110
111
+
## TypeScript Data Models
112
+
113
+
As AI Models are not as adept at generating C# APIs or Migrations yet, they excel at generating TypeScript code, which our
114
+
[TypeScript Data Models](https://docs.servicestack.net/autoquery/okai-models) feature can take advantage of by generating all the C# AutoQuery CRUD APIs and DB Migrations needing to support it.
We'll quickly cover the common dev workflow for this feature.
137
+
138
+
To create a new Table use `init <Table>`, e.g:
139
+
140
+
:::copy
141
+
npx okai init Transaction
142
+
:::
143
+
144
+
This will generate an empty `MyApp.ServiceModel/<Table>.d.ts` file along with stub AutoQuery APIs and DB Migration implementations.
145
+
146
+
#### Regenerate AutoQuery APIs and DB Migrations
147
+
148
+
After modifying the TypeScript Data Model to include the desired fields, you can re-run the `okai` tool to generate the AutoQuery APIs and DB Migrations
149
+
(which can be run anywhere within your Solution):
150
+
151
+
:::copy
152
+
npx okai Transaction.d.ts
153
+
:::
154
+
155
+
After you're happy with your Data Model you can run DB Migrations to run the DB Migration and create your RDBMS Table:
156
+
157
+
:::copy
158
+
npm run migrate
159
+
:::
160
+
161
+
#### Making changes after first migration
162
+
163
+
If you want to make further changes to your Data Model, you can re-run the `okai` tool to update the AutoQuery APIs and DB Migrations, then run the `rerun:last` npm script to drop and re-run the last migration:
164
+
165
+
:::copy
166
+
npm run rerun:last
167
+
:::
168
+
169
+
#### Removing a Data Model and all generated code
170
+
171
+
If you changed your mind and want to get rid of the RDBMS Table you can revert the last migration:
172
+
173
+
:::copy
174
+
npm run revert:last
175
+
:::
176
+
177
+
Which will drop the table and then you can get rid of the AutoQuery APIs, DB Migrations and TypeScript Data model with:
178
+
179
+
:::copy
180
+
npx okai rm Transaction.d.ts
181
+
:::
182
+
183
+
## AI-First Example
184
+
185
+
There are a number of options for starting with an AI generated Application, with all the Instant AI App Generators like
186
+
[Google's App Studio](https://aistudio.google.com/apps) able to provide a great starting point. Although currently Professional Developers tend to use
187
+
[Cursor](https://cursor.com/), [Claude Code](https://www.claude.com/product/claude-code) or
188
+
[Codex](https://openai.com/codex/) as their day-to-day tools of choice.
189
+
190
+
### Use GitHub Copilot when creating a new Repository
191
+
192
+
If you're using [GitHub Copilot](https://copilot.github.com/) you can also use it to generate a new App
193
+
[from the Vite React template ](https://github.com/new?template_name=react-vite&template_owner=NetCoreTemplates):
For the example, I've started with a useful App that I've never created before, a Budget Planner App, using the prompt:
198
+
199
+
### Budget Planner Prompt
200
+
201
+
```
202
+
- React 19, TypeScript, TailwindCSS v4
203
+
- Persistence in IndexedDB/localStorage
204
+
- Recharts
205
+
- Vitest with React Testing Library
206
+
207
+
## Features
208
+
Dashboard
209
+
- Overview of total income, expenses, and remaining budget
210
+
- Monthly summary chart (line graph)
211
+
- Expense categories (pie chart)
212
+
213
+
Transactions
214
+
- Add/Edit/Delete income or expenses
215
+
- Date filtering/sorting
216
+
217
+
Budgets
218
+
- Set monthly budget goals per category
219
+
- Progress bars for spending vs. budget
220
+
221
+
Reports
222
+
- View past months
223
+
- Export
224
+
```
225
+
226
+
The generated source code for the App was uploaded to: [github.com/mythz/budgets.apps.cafe](https://github.com/mythz/budgets.apps.cafe)
227
+
228
+
### Budgent Planner App
229
+
230
+
After a few minutes Copilot creates a PR with what we asked for, even things that we didn't specify in the prompt but could be inferred from the Project Template like **Dark Mode** support where it made use of the existing `<DarkModeToggle />`.
Input: “Uber to work” → Suggests category: Transport
257
+
258
+
Implementation:
259
+
260
+
Maintain a small local list of common keywords + categories.
261
+
Pre-fill category in the transaction form as the user types in the Description.
262
+
263
+
Which resulted in [this commit](https://github.com/mythz/budgets.apps.cafe/commit/e45a17b8dfd2b5983971554ced3e52ded6fa050e) which sees the feature available in the UI:
Combined with Vite's instant hot-reload, this creates a remarkably fluid development experience where
277
+
we get to watch our prompts materialize into working features in real-time.
278
+
279
+
All this to say that this new development model exists today, and given its significant productivity gains, it's
280
+
very likely to become the future of software development, especially for UIs. Since developers are no longer
281
+
the primary authors of code, our UI choices swing from Developer preferences to UI technologies that AI models
282
+
excel at.
283
+
284
+
So whilst we have a preference for Vue given it's more readable syntax and progressive enhancement capabalities, and whilst .NET ecosystem has a strong bias towards Blazor, we're even more excited for the future of React and are committed to providing the best possible support for it.
0 commit comments