Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Feb 8, 2025
1 parent 653b8aa commit 611888d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion MyApp/_pages/autoquery/okai-db.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Generate CRUD APIs and UIs from existing DBs
title: Generate CRUD APIs and UIs for existing DBs
---

A core piece of functionality in the [Text to Blazor CRUD App](/autoquery/text-to-blazor) feature is distilling an AI Prompt into TypeScript classes that can be [further customized](/autoquery/okai-models#customize-data-models)
Expand Down
18 changes: 9 additions & 9 deletions MyApp/_pages/autoquery/okai-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Generate CRUD APIs + UI

## AI powered Rapid App Development Workflow

The `okai` npm tool works similar to the online [Text to Blazor App](/autoquery/text-to-blazor) generator
The `okai` npm tool works similar to the online [Text to Blazor App](https://servicestack.net/text-to-blazor) creator
except it's a local tool that can add additional functionality to an existing project:

<ascii-cinema src="/img/pages/okai/okai-prompt-jobs.cast"
Expand All @@ -22,11 +22,11 @@ selected feature which you'll see after selecting the LLM Data Models you want t
```sh
Selected 'deepseek-r1:70b' data models

Saved: /home/mythz/src/MyApp/MyApp.ServiceModel/Jobs.d.ts
Saved: /home/mythz/src/MyApp/MyApp.ServiceModel/Jobs.cs
Saved: /home/mythz/src/MyApp/wwwroot/admin/sections/Jobs.mjs
Saved: /home/mythz/src/MyApp/wwwroot/admin/sections/index.mjs
Saved: /home/mythz/src/MyApp/Migrations/Migration1001.cs
Saved: /projects/MyApp/MyApp.ServiceModel/Jobs.d.ts
Saved: /projects/MyApp/MyApp.ServiceModel/Jobs.cs
Saved: /projects/MyApp/wwwroot/admin/sections/Jobs.mjs
Saved: /projects/MyApp/wwwroot/admin/sections/index.mjs
Saved: /projects/MyApp/Migrations/Migration1001.cs

Run 'dotnet run --AppTasks=migrate' to apply new migration and create tables

Expand Down Expand Up @@ -328,7 +328,7 @@ Which will regenerate its:
- DB Migration: [MyApp/Migrations/Migration1000.cs](https://github.com/NetCoreTemplates/blazor-admin/blob/main/MyApp/Migrations/Migration1000.cs)
- Admin UI: [/wwwroot/admin/sections/Bookings.mjs](https://github.com/NetCoreTemplates/blazor-admin/blob/main/MyApp/wwwroot/admin/sections/Bookings.mjs)

What files will be generated is controlled in the `Config` section:
What files will be generated is controlled by its `Config` section:

```ts
export type Config = {
Expand All @@ -342,7 +342,7 @@ export type Config = {
So if you no longer want the code regeneration to update the DB Migration for it, you can just remove it
from the Config.
## Customize Data Models
## Rerunning Code Generation
The data models defined in the TypeScript Declaration file e.g. `Bookings.d.ts` is what drives the
generation of the Data Models, APIs, DB Migrations and Admin UIs.
Expand Down Expand Up @@ -419,7 +419,7 @@ export class Booking extends AuditBase {
}
```

Which uses the `DateOnly` and `decimal` .NET Types to generate:
Which uses the `DateOnly` and `decimal` .NET Types in its code generation:

```csharp
public class Booking : AuditBase
Expand Down
6 changes: 2 additions & 4 deletions MyApp/_pages/autoquery/text-to-blazor.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Whilst the result is a working CRUD App, the approach taken is very different fr
which uses AI to generate the entire App that ends up with a whole new code-base developers didn't write
which they'd now need to maintain.

Instead AI is only used to generate the initial Data Models within a **TypeScript Declaration file**
Instead AI is only used to **generate the initial Data Models** within a **TypeScript Declaration file**
which we've found is the best format supported by AI models that's also the best typed DSL for defining
data models with minimal syntax that's easy for humans to read and write.

Expand All @@ -41,9 +41,7 @@ generated Blazor Vue CRUD App:

### Blazor Vue App

**UI + Admin** - Creates a new [blazor-vue](https://blazor-vue.web-templates.io) template that's ideal
for Internet or public facing Apps, sporting a full-featured public facing UI for a Web App's
users whilst enabling a back-office CRUD UI for Admin Users to manage their App's data.
**UI + Admin** - Creates a new [blazor-vue](https://blazor-vue.web-templates.io) template, ideal for Internet or public facing Apps which sports a full-featured content rich UI for a Web App's users whilst providing a back-office Admin UI for Admin Users to manage the App's data.

![](/img/pages/okai/okai-blazor-vue.webp)

Expand Down
14 changes: 14 additions & 0 deletions MyApp/wwwroot/pages/autoquery/okai-models.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import AudioPlayer from "../podcasts/AudioPlayer.mjs"
import AsciiCinema from '../components/AsciiCinema.mjs'

export default {
install(app) {
},
components: {
AudioPlayer,
AsciiCinema,
},
setup() {
return { }
}
}

0 comments on commit 611888d

Please sign in to comment.