Skip to content

Commit e6cbe77

Browse files
committed
Update README.md
1 parent b8c0bdb commit e6cbe77

File tree

1 file changed

+95
-41
lines changed

1 file changed

+95
-41
lines changed

README.md

Lines changed: 95 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ dotnet watch
6666
- **ASP.NET Core Identity** - Complete authentication & authorization system
6767
- **Entity Framework Core** - For Identity data management
6868
- **OrmLite** - ServiceStack's fast, lightweight Typed ORM for application data
69-
- **SQLite** - Default database (easily upgradable to PostgreSQL/SQL Server/MySQL)
69+
- **SQLite** - Default database - [Upgrade to PostgreSQL/SQL Server/MySQL](#upgrading-to-enterprise-database)
7070

7171
## Major Features
7272

@@ -76,7 +76,6 @@ dotnet watch
7676
- Admin users feature for user management at `/admin-ui/users`
7777
- Email confirmation workflow (configurable SMTP)
7878
- Razor Pages for Identity UI (`/Identity` routes)
79-
- Credentials-based authentication
8079

8180
### [2. AutoQuery CRUD](#autoquery-crud-dev-workflow)
8281
- Declarative API development with minimal code
@@ -90,7 +89,7 @@ dotnet watch
9089
- Command pattern for job execution
9190
- Email sending via background jobs
9291
- Recurring job scheduling support
93-
- Upgradable to `DatabaseJobsFeature` for enterprise RDBMS
92+
- Uses monthly rolling Sqlite databases by default - [Upgrade to PostgreSQL/SQL Server/MySQL](#upgrading-to-enterprise-database)
9493

9594
### 4. Developer Experience
9695
- **Admin UI** at `/admin-ui` for App management
@@ -189,6 +188,7 @@ npm run test:run # Run tests once
189188
dotnet test
190189
```
191190

191+
192192
## Configuration
193193

194194
### Key Configuration Files
@@ -269,6 +269,73 @@ npx add-in ef-postgres
269269
npx add-in db-identity
270270
```
271271

272+
## AutoQuery CRUD Dev Workflow
273+
274+
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.
275+
276+
### Cheat Sheet
277+
278+
### Create a new Table
279+
280+
Create a new Table use `init <Table>`, e.g:
281+
282+
```bash
283+
npx okai init Table
284+
```
285+
286+
This will generate an empty `MyApp.ServiceModel/<Table>.d.ts` file along with stub AutoQuery APIs and DB Migration implementations.
287+
288+
### Use AI to generate the TypeScript Data Model
289+
290+
Or to get you started quickly you can also use AI to generate the initial TypeScript Data Model with:
291+
292+
```bash
293+
npx okai "Table to store Customer Stripe Subscriptions"
294+
```
295+
296+
This launches a TUI that invokes ServiceStack's okai API to fire multiple concurrent requests to frontier cloud
297+
and OSS models to generate the TypeScript Data Models required to implement this feature.
298+
You'll be able to browse and choose which of the AI Models you prefer which you can accept by pressing `a`
299+
to `(a) accept`. These are the data models [Claude Sonnet 4.5 generated](https://servicestack.net/text-to-blazor?id=1764337230546) for this prompt.
300+
301+
#### Regenerate AutoQuery APIs and DB Migrations
302+
303+
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:
304+
305+
```bash
306+
npx okai Table.d.ts
307+
```
308+
309+
> Command can be run anywhere within your Solution
310+
311+
After you're happy with your Data Model you can run DB Migrations to run the DB Migration and create your RDBMS Table:
312+
313+
```bash
314+
npm run migrate
315+
```
316+
317+
#### Making changes after first migration
318+
319+
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:
320+
321+
```bash
322+
npm run rerun:last
323+
```
324+
325+
#### Removing a Data Model and all generated code
326+
327+
If you changed your mind and want to get rid of the RDBMS Table you can revert the last migration:
328+
329+
```bash
330+
npm run revert:last
331+
```
332+
333+
Which will drop the table and then you can get rid of the AutoQuery APIs, DB Migrations and TypeScript Data model with:
334+
335+
```bash
336+
npx okai rm Transaction.d.ts
337+
```
338+
272339
## Deployment
273340

274341
### Docker + Kamal
@@ -319,58 +386,45 @@ These are inferred from the GitHub Action context and don't need to be configure
319386
- **GitHub Container Registry** integration
320387
- **Volume persistence** for App_Data including any SQLite database
321388

389+
## AI-Assisted Development with CLAUDE.md
322390

323-
## AutoQuery CRUD Dev Workflow
324-
325-
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.
326-
327-
### Cheat Sheet
328-
329-
Create a new Table use `init <Table>`, e.g:
330-
331-
```bash
332-
npx okai init Table
333-
```
334-
335-
This will generate an empty `MyApp.ServiceModel/<Table>.d.ts` file along with stub AutoQuery APIs and DB Migration implementations.
336-
337-
#### Regenerate AutoQuery APIs and DB Migrations
391+
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.
338392

339-
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:
393+
### What is CLAUDE.md?
340394

341-
```bash
342-
npx okai Table.d.ts
343-
```
395+
`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.
344396

345-
> Command can be run anywhere within your Solution
397+
### What's Included
346398

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

349-
```bash
350-
npm run migrate
351-
```
401+
- **Project Architecture Overview** - Technology stack, design patterns, and key architectural decisions
402+
- **Project Structure** - Gives Claude a map of the codebase
403+
- **ServiceStack Conventions** - DTO patterns, Service implementation, AutoQuery, Authentication, and Validation
404+
- **API Integration** - TypeScript DTO generation, API client usage, component patterns, and form handling
405+
- **Database Patterns** - OrmLite setup, migrations, and data access patterns
406+
- **Common Development Tasks** - Step-by-step guides for adding APIs, implementing features, and extending functionality
407+
- **Testing & Deployment** - Test patterns and deployment workflows
352408

353-
#### Making changes after first migration
409+
### Extending with Project-Specific Details
354410

355-
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:
411+
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.
356412

357-
```bash
358-
npm run rerun:last
359-
```
413+
### Benefits
360414

361-
#### Removing a Data Model and all generated code
415+
- **Faster Onboarding** - New developers (and AI assistants) understand project conventions immediately
416+
- **Consistent Code Generation** - AI tools generate code following your project's patterns
417+
- **Better Context** - AI assistants can reference specific ServiceStack patterns and conventions
418+
- **Reduced Errors** - Clear documentation of framework-specific conventions
419+
- **Living Documentation** - Keep it updated as your project evolves
362420

363-
If you changed your mind and want to get rid of the RDBMS Table you can revert the last migration:
421+
### How to Use
364422

365-
```bash
366-
npm run revert:last
367-
```
423+
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:
368424

369-
Which will drop the table and then you can get rid of the AutoQuery APIs, DB Migrations and TypeScript Data model with:
425+
> Using my project's AGENTS.md, can you help me add a new AutoQuery API for managing Products?
370426
371-
```bash
372-
npx okai rm Transaction.d.ts
373-
```
427+
The AI will understand your App's ServiceStack conventions, React setup, and project structure, providing more accurate and contextual assistance.
374428

375429
## Ideal Use Cases
376430

0 commit comments

Comments
 (0)