@korajs/server 0.3.3 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -52,6 +52,39 @@ await server.start()
52
52
  | `SqliteServerStore` | Built-in | Small deployments, prototyping |
53
53
  | `PostgresServerStore` | Built-in | Production |
54
54
 
55
+ ## Mixed Auth (Authenticated + Anonymous)
56
+
57
+ For apps where some users are authenticated and others are anonymous:
58
+
59
+ ```typescript
60
+ import { MixedAuthProvider } from '@korajs/server'
61
+
62
+ const server = createKoraServer({
63
+ store: serverStore,
64
+ auth: new MixedAuthProvider({
65
+ primary: authRoutes.toSyncAuthProvider(),
66
+ anonymousScopes: { responses: {} },
67
+ }),
68
+ })
69
+ ```
70
+
71
+ ## Materialized Collections
72
+
73
+ Enable server-side queries on your data:
74
+
75
+ ```typescript
76
+ await store.setSchema(schema)
77
+
78
+ // Query with filters
79
+ const forms = await store.queryCollection('forms', {
80
+ where: { status: 'published' },
81
+ limit: 10,
82
+ })
83
+
84
+ // Count records
85
+ const count = await store.countCollection('responses', { formId: 'abc' })
86
+ ```
87
+
55
88
  ## Configuration
56
89
 
57
90
  ```typescript
@@ -64,6 +97,16 @@ createKoraServer({
64
97
  })
65
98
  ```
66
99
 
100
+ ## Testing
101
+
102
+ Integration tests include **store parity** coverage for `MemoryServerStore` and `SqliteServerStore`. To run the same parity suite against a live PostgreSQL database:
103
+
104
+ ```bash
105
+ DATABASE_URL="postgres://user:pass@localhost:5432/kora_test" pnpm --filter @korajs/server test -- tests/integration/server-store-parity.test.ts
106
+ ```
107
+
108
+ Postgres tests are skipped when `DATABASE_URL` is unset.
109
+
67
110
  ## License
68
111
 
69
112
  MIT