Skip to content

Commit 13de40b

Browse files
committed
Update README.md
1 parent e89a469 commit 13de40b

1 file changed

Lines changed: 95 additions & 40 deletions

File tree

README.md

Lines changed: 95 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ This template uses a consistent architecture across all environments where the .
7171
- **ASP.NET Core Identity** - Complete authentication & authorization system
7272
- **Entity Framework Core** - For Identity data management
7373
- **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)
7575

7676
## Major Features
7777

@@ -95,7 +95,7 @@ This template uses a consistent architecture across all environments where the .
9595
- Command pattern for job execution
9696
- Email sending via background jobs
9797
- 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)
9999

100100
### 4. Developer Experience
101101
- **Admin UI** at `/admin-ui` for App management
@@ -193,6 +193,7 @@ npm run test:run # Run tests once
193193
dotnet test
194194
```
195195

196+
196197
## Configuration
197198

198199
### Key Configuration Files
@@ -273,6 +274,73 @@ npx add-in ef-postgres
273274
npx add-in db-identity
274275
```
275276

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+
276344
## Deployment
277345

278346
### Docker + Kamal
@@ -323,58 +391,45 @@ These are inferred from the GitHub Action context and don't need to be configure
323391
- **GitHub Container Registry** integration
324392
- **Volume persistence** for App_Data including any SQLite database
325393

394+
## AI-Assisted Development with CLAUDE.md
326395

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.
342397

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?
344399

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.
348401

349-
> Command can be run anywhere within your Solution
402+
### What's Included
350403

351-
After you're happy with your Data Model you can run DB Migrations to run the DB Migration and create your RDBMS Table:
404+
Each template's `AGENTS.md` contains:
352405

353-
```bash
354-
npm run migrate
355-
```
406+
- **Project Architecture Overview** - Technology stack, design patterns, and key architectural decisions
407+
- **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
356413

357-
#### Making changes after first migration
414+
### Extending with Project-Specific Details
358415

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.
360417

361-
```bash
362-
npm run rerun:last
363-
```
418+
### Benefits
364419

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
366425

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
368427

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:
372429

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?
374431
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.
378433

379434
## Ideal Use Cases
380435

0 commit comments

Comments
 (0)