Skip to content

Commit e152b14

Browse files
committed
Update README.md
1 parent 6afab2e commit e152b14

File tree

1 file changed

+95
-40
lines changed

1 file changed

+95
-40
lines changed

README.md

Lines changed: 95 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ dotnet watch
6868
- **ASP.NET Core Identity** - Complete authentication & authorization system
6969
- **Entity Framework Core** - For Identity data management
7070
- **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)
7272

7373
## Major Features
7474

@@ -92,7 +92,7 @@ dotnet watch
9292
- Command pattern for job execution
9393
- Email sending via background jobs
9494
- 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)
9696

9797
### 4. Developer Experience
9898
- **Admin UI** at `/admin-ui` for App management
@@ -186,6 +186,7 @@ npm run test:ui # Run tests with UI
186186
npm run test:run # Run tests once
187187
```
188188

189+
189190
## Configuration
190191

191192
### Key Configuration Files
@@ -266,6 +267,73 @@ npx add-in ef-postgres
266267
npx add-in db-identity
267268
```
268269

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+
269337
## Deployment
270338

271339
### Docker + Kamal
@@ -316,58 +384,45 @@ These are inferred from the GitHub Action context and don't need to be configure
316384
- **GitHub Container Registry** integration
317385
- **Volume persistence** for App_Data including any SQLite database
318386

387+
## AI-Assisted Development with CLAUDE.md
319388

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

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

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

342-
> Command can be run anywhere within your Solution
395+
### What's Included
343396

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

346-
```bash
347-
npm run migrate
348-
```
399+
- **Project Architecture Overview** - Technology stack, design patterns, and key architectural decisions
400+
- **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
349406

350-
#### Making changes after first migration
407+
### Extending with Project-Specific Details
351408

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

354-
```bash
355-
npm run rerun:last
356-
```
411+
### Benefits
357412

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
359418

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
361420

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

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?
367424
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.
371426

372427
## Ideal Use Cases
373428

0 commit comments

Comments
 (0)