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
Copy file name to clipboardExpand all lines: README.md
+95-40Lines changed: 95 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,7 @@ dotnet watch
68
68
-**ASP.NET Core Identity** - Complete authentication & authorization system
69
69
-**Entity Framework Core** - For Identity data management
70
70
-**OrmLite** - ServiceStack's fast, lightweight Typed ORM for application data
71
-
-**SQLite** - Default database (easily upgradable to PostgreSQL/SQL Server/MySQL)
71
+
-**SQLite** - Default database - [Upgrade to PostgreSQL/SQL Server/MySQL](#upgrading-to-enterprise-database)
72
72
73
73
## Major Features
74
74
@@ -92,7 +92,7 @@ dotnet watch
92
92
- Command pattern for job execution
93
93
- Email sending via background jobs
94
94
- Recurring job scheduling support
95
-
-Upgradable to `DatabaseJobsFeature` for enterprise RDBMS
95
+
-Uses monthly rolling Sqlite databases by default - [Upgrade to PostgreSQL/SQL Server/MySQL](#upgrading-to-enterprise-database)
96
96
97
97
### 4. Developer Experience
98
98
-**Admin UI** at `/admin-ui` for App management
@@ -186,6 +186,7 @@ npm run test:ui # Run tests with UI
186
186
npm run test:run # Run tests once
187
187
```
188
188
189
+
189
190
## Configuration
190
191
191
192
### Key Configuration Files
@@ -266,6 +267,73 @@ npx add-in ef-postgres
266
267
npx add-in db-identity
267
268
```
268
269
270
+
## AutoQuery CRUD Dev Workflow
271
+
272
+
For Rapid Development simple [TypeScript Data Models](https://docs.servicestack.net/autoquery/okai-models) can be used to generate C# AutoQuery APIs and DB Migrations.
273
+
274
+
### Cheat Sheet
275
+
276
+
### Create a new Table
277
+
278
+
Create a new Table use `init <Table>`, e.g:
279
+
280
+
```bash
281
+
npx okai init Table
282
+
```
283
+
284
+
This will generate an empty `MyApp.ServiceModel/<Table>.d.ts` file along with stub AutoQuery APIs and DB Migration implementations.
285
+
286
+
### Use AI to generate the TypeScript Data Model
287
+
288
+
Or to get you started quickly you can also use AI to generate the initial TypeScript Data Model with:
289
+
290
+
```bash
291
+
npx okai "Table to store Customer Stripe Subscriptions"
292
+
```
293
+
294
+
This launches a TUI that invokes ServiceStack's okai API to fire multiple concurrent requests to frontier cloud
295
+
and OSS models to generate the TypeScript Data Models required to implement this feature.
296
+
You'll be able to browse and choose which of the AI Models you prefer which you can accept by pressing `a`
297
+
to `(a) accept`. These are the data models [Claude Sonnet 4.5 generated](https://servicestack.net/text-to-blazor?id=1764337230546) for this prompt.
298
+
299
+
#### Regenerate AutoQuery APIs and DB Migrations
300
+
301
+
After modifying the `Table.d.ts` TypeScript Data Model to include the desired fields, re-run the `okai` tool to re-generate the AutoQuery APIs and DB Migrations:
302
+
303
+
```bash
304
+
npx okai Table.d.ts
305
+
```
306
+
307
+
> Command can be run anywhere within your Solution
308
+
309
+
After you're happy with your Data Model you can run DB Migrations to run the DB Migration and create your RDBMS Table:
310
+
311
+
```bash
312
+
npm run migrate
313
+
```
314
+
315
+
#### Making changes after first migration
316
+
317
+
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:
318
+
319
+
```bash
320
+
npm run rerun:last
321
+
```
322
+
323
+
#### Removing a Data Model and all generated code
324
+
325
+
If you changed your mind and want to get rid of the RDBMS Table you can revert the last migration:
326
+
327
+
```bash
328
+
npm run revert:last
329
+
```
330
+
331
+
Which will drop the table and then you can get rid of the AutoQuery APIs, DB Migrations and TypeScript Data model with:
332
+
333
+
```bash
334
+
npx okai rm Transaction.d.ts
335
+
```
336
+
269
337
## Deployment
270
338
271
339
### Docker + Kamal
@@ -316,58 +384,45 @@ These are inferred from the GitHub Action context and don't need to be configure
316
384
-**GitHub Container Registry** integration
317
385
-**Volume persistence** for App_Data including any SQLite database
318
386
387
+
## AI-Assisted Development with CLAUDE.md
319
388
320
-
## AutoQuery CRUD Dev Workflow
321
-
322
-
For Rapid Development simple [TypeScript Data Models](https://docs.servicestack.net/autoquery/okai-models) can be used to generate C# AutoQuery APIs and DB Migrations.
323
-
324
-
### Cheat Sheet
325
-
326
-
Create a new Table use `init <Table>`, e.g:
327
-
328
-
```bash
329
-
npx okai init Table
330
-
```
331
-
332
-
This will generate an empty `MyApp.ServiceModel/<Table>.d.ts` file along with stub AutoQuery APIs and DB Migration implementations.
333
-
334
-
#### Regenerate AutoQuery APIs and DB Migrations
389
+
As part of our objectives of improving developer experience and embracing modern AI-assisted development workflows - all new .NET SPA templates include a comprehensive `AGENTS.md` file designed to optimize AI-assisted development workflows.
335
390
336
-
After modifying the TypeScript Data Model to include the desired fields, re-run the `okai` tool to re-generate the AutoQuery APIs and DB Migrations:
391
+
### What is CLAUDE.md?
337
392
338
-
```bash
339
-
npx okai Table.d.ts
340
-
```
393
+
`CLAUDE.md` and [AGENTS.md](https://agents.md) onboards Claude (and other AI assistants) to your codebase by using a structured documentation file that provides it with complete context about your project's architecture, conventions, and technology choices. This enables more accurate code generation, better suggestions, and faster problem-solving.
341
394
342
-
> Command can be run anywhere within your Solution
395
+
### What's Included
343
396
344
-
After you're happy with your Data Model you can run DB Migrations to run the DB Migration and create your RDBMS Table:
-**Project Structure** - Gives Claude a map of the codebase
401
+
-**ServiceStack Conventions** - DTO patterns, Service implementation, AutoQuery, Authentication, and Validation
402
+
-**API Integration** - TypeScript DTO generation, API client usage, component patterns, and form handling
403
+
-**Database Patterns** - OrmLite setup, migrations, and data access patterns
404
+
-**Common Development Tasks** - Step-by-step guides for adding APIs, implementing features, and extending functionality
405
+
-**Testing & Deployment** - Test patterns and deployment workflows
349
406
350
-
#### Making changes after first migration
407
+
###Extending with Project-Specific Details
351
408
352
-
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:
409
+
The existing `CLAUDE.md` serves as a solid foundation, but for best results, you should extend it with project-specific details like the purpose of the project, key parts and features of the project and any unique conventions you've adopted.
353
410
354
-
```bash
355
-
npm run rerun:last
356
-
```
411
+
### Benefits
357
412
358
-
#### Removing a Data Model and all generated code
413
+
-**Faster Onboarding** - New developers (and AI assistants) understand project conventions immediately
414
+
-**Consistent Code Generation** - AI tools generate code following your project's patterns
415
+
-**Better Context** - AI assistants can reference specific ServiceStack patterns and conventions
416
+
-**Reduced Errors** - Clear documentation of framework-specific conventions
417
+
-**Living Documentation** - Keep it updated as your project evolves
359
418
360
-
If you changed your mind and want to get rid of the RDBMS Table you can revert the last migration:
419
+
### How to Use
361
420
362
-
```bash
363
-
npm run revert:last
364
-
```
421
+
Claude Code and most AI Assistants already support automatically referencing `CLAUDE.md` and `AGENTS.md` files, for others you can just include it in your prompt context when asking for help, e.g:
365
422
366
-
Which will drop the table and then you can get rid of the AutoQuery APIs, DB Migrations and TypeScript Data model with:
423
+
> Using my project's AGENTS.md, can you help me add a new AutoQuery API for managing Products?
367
424
368
-
```bash
369
-
npx okai rm Transaction.d.ts
370
-
```
425
+
The AI will understand your App's ServiceStack conventions, React setup, and project structure, providing more accurate and contextual assistance.
0 commit comments