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
@@ -71,7 +71,7 @@ This template uses a consistent architecture across all environments where the .
71
71
-**ASP.NET Core Identity** - Complete authentication & authorization system
72
72
-**Entity Framework Core** - For Identity data management
73
73
-**OrmLite** - ServiceStack's fast, lightweight Typed ORM for application data
74
-
-**SQLite** - Default database (easily upgradable to PostgreSQL/SQL Server/MySQL)
74
+
-**SQLite** - Default database - [Upgrade to PostgreSQL/SQL Server/MySQL](#upgrading-to-enterprise-database)
75
75
76
76
## Major Features
77
77
@@ -95,7 +95,7 @@ This template uses a consistent architecture across all environments where the .
95
95
- Command pattern for job execution
96
96
- Email sending via background jobs
97
97
- Recurring job scheduling support
98
-
-Upgradable to `DatabaseJobsFeature` for enterprise RDBMS
98
+
-Uses monthly rolling Sqlite databases by default - [Upgrade to PostgreSQL/SQL Server/MySQL](#upgrading-to-enterprise-database)
99
99
100
100
### 4. Developer Experience
101
101
-**Admin UI** at `/admin-ui` for App management
@@ -193,6 +193,7 @@ npm run test:run # Run tests once
193
193
dotnet test
194
194
```
195
195
196
+
196
197
## Configuration
197
198
198
199
### Key Configuration Files
@@ -273,6 +274,73 @@ npx add-in ef-postgres
273
274
npx add-in db-identity
274
275
```
275
276
277
+
## AutoQuery CRUD Dev Workflow
278
+
279
+
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.
280
+
281
+
### Cheat Sheet
282
+
283
+
### Create a new Table
284
+
285
+
Create a new Table use `init <Table>`, e.g:
286
+
287
+
```bash
288
+
npx okai init Table
289
+
```
290
+
291
+
This will generate an empty `MyApp.ServiceModel/<Table>.d.ts` file along with stub AutoQuery APIs and DB Migration implementations.
292
+
293
+
### Use AI to generate the TypeScript Data Model
294
+
295
+
Or to get you started quickly you can also use AI to generate the initial TypeScript Data Model with:
296
+
297
+
```bash
298
+
npx okai "Table to store Customer Stripe Subscriptions"
299
+
```
300
+
301
+
This launches a TUI that invokes ServiceStack's okai API to fire multiple concurrent requests to frontier cloud
302
+
and OSS models to generate the TypeScript Data Models required to implement this feature.
303
+
You'll be able to browse and choose which of the AI Models you prefer which you can accept by pressing `a`
304
+
to `(a) accept`. These are the data models [Claude Sonnet 4.5 generated](https://servicestack.net/text-to-blazor?id=1764337230546) for this prompt.
305
+
306
+
#### Regenerate AutoQuery APIs and DB Migrations
307
+
308
+
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:
309
+
310
+
```bash
311
+
npx okai Table.d.ts
312
+
```
313
+
314
+
> Command can be run anywhere within your Solution
315
+
316
+
After you're happy with your Data Model you can run DB Migrations to run the DB Migration and create your RDBMS Table:
317
+
318
+
```bash
319
+
npm run migrate
320
+
```
321
+
322
+
#### Making changes after first migration
323
+
324
+
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:
325
+
326
+
```bash
327
+
npm run rerun:last
328
+
```
329
+
330
+
#### Removing a Data Model and all generated code
331
+
332
+
If you changed your mind and want to get rid of the RDBMS Table you can revert the last migration:
333
+
334
+
```bash
335
+
npm run revert:last
336
+
```
337
+
338
+
Which will drop the table and then you can get rid of the AutoQuery APIs, DB Migrations and TypeScript Data model with:
339
+
340
+
```bash
341
+
npx okai rm Transaction.d.ts
342
+
```
343
+
276
344
## Deployment
277
345
278
346
### Docker + Kamal
@@ -323,58 +391,45 @@ These are inferred from the GitHub Action context and don't need to be configure
323
391
-**GitHub Container Registry** integration
324
392
-**Volume persistence** for App_Data including any SQLite database
325
393
394
+
## AI-Assisted Development with CLAUDE.md
326
395
327
-
## AutoQuery CRUD Dev Workflow
328
-
329
-
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.
330
-
331
-
### Cheat Sheet
332
-
333
-
Create a new Table use `init <Table>`, e.g:
334
-
335
-
```bash
336
-
npx okai init Table
337
-
```
338
-
339
-
This will generate an empty `MyApp.ServiceModel/<Table>.d.ts` file along with stub AutoQuery APIs and DB Migration implementations.
340
-
341
-
#### Regenerate AutoQuery APIs and DB Migrations
396
+
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.
342
397
343
-
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:
398
+
### What is CLAUDE.md?
344
399
345
-
```bash
346
-
npx okai Table.d.ts
347
-
```
400
+
`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.
348
401
349
-
> Command can be run anywhere within your Solution
402
+
### What's Included
350
403
351
-
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
408
+
-**ServiceStack Conventions** - DTO patterns, Service implementation, AutoQuery, Authentication, and Validation
409
+
-**API Integration** - TypeScript DTO generation, API client usage, component patterns, and form handling
410
+
-**Database Patterns** - OrmLite setup, migrations, and data access patterns
411
+
-**Common Development Tasks** - Step-by-step guides for adding APIs, implementing features, and extending functionality
412
+
-**Testing & Deployment** - Test patterns and deployment workflows
356
413
357
-
#### Making changes after first migration
414
+
###Extending with Project-Specific Details
358
415
359
-
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:
416
+
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.
360
417
361
-
```bash
362
-
npm run rerun:last
363
-
```
418
+
### Benefits
364
419
365
-
#### Removing a Data Model and all generated code
420
+
-**Faster Onboarding** - New developers (and AI assistants) understand project conventions immediately
421
+
-**Consistent Code Generation** - AI tools generate code following your project's patterns
422
+
-**Better Context** - AI assistants can reference specific ServiceStack patterns and conventions
423
+
-**Reduced Errors** - Clear documentation of framework-specific conventions
424
+
-**Living Documentation** - Keep it updated as your project evolves
366
425
367
-
If you changed your mind and want to get rid of the RDBMS Table you can revert the last migration:
426
+
### How to Use
368
427
369
-
```bash
370
-
npm run revert:last
371
-
```
428
+
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:
372
429
373
-
Which will drop the table and then you can get rid of the AutoQuery APIs, DB Migrations and TypeScript Data model with:
430
+
> Using my project's AGENTS.md, can you help me add a new AutoQuery API for managing Products?
374
431
375
-
```bash
376
-
npx okai rm Transaction.d.ts
377
-
```
432
+
The AI will understand your App's ServiceStack conventions, React setup, and project structure, providing more accurate and contextual assistance.
0 commit comments