@kyro-cms/core 0.9.0 → 0.9.2

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.
Files changed (265) hide show
  1. package/README.md +55 -593
  2. package/dist/{WebhookService-AefJfqX0.d.cts → WebhookService-BKszZlG0.d.cts} +1 -1
  3. package/dist/{WebhookService-118ZTFis.d.ts → WebhookService-Ccf1j-IN.d.ts} +1 -1
  4. package/dist/api-handler-graphql.cjs +44 -0
  5. package/dist/api-handler-graphql.cjs.map +1 -0
  6. package/dist/api-handler-graphql.d.cts +6 -0
  7. package/dist/api-handler-graphql.d.ts +6 -0
  8. package/dist/api-handler-graphql.js +41 -0
  9. package/dist/api-handler-graphql.js.map +1 -0
  10. package/dist/api-handler-trpc.cjs +38 -0
  11. package/dist/api-handler-trpc.cjs.map +1 -0
  12. package/dist/api-handler-trpc.d.cts +5 -0
  13. package/dist/api-handler-trpc.d.ts +5 -0
  14. package/dist/api-handler-trpc.js +36 -0
  15. package/dist/api-handler-trpc.js.map +1 -0
  16. package/dist/api-handler.cjs +33 -99
  17. package/dist/api-handler.cjs.map +1 -1
  18. package/dist/api-handler.d.cts +2 -1
  19. package/dist/api-handler.d.ts +2 -1
  20. package/dist/api-handler.js +21 -97
  21. package/dist/api-handler.js.map +1 -1
  22. package/dist/{tenant-B1YB0Jy8.d.ts → base-CIuXkrH4.d.cts} +7 -15
  23. package/dist/{tenant-Cpeveji6.d.cts → base-fFo4lqER.d.ts} +7 -15
  24. package/dist/bootstrap-3PV3GJ3S.js +7 -0
  25. package/dist/{bootstrap-JCML6NFO.js.map → bootstrap-3PV3GJ3S.js.map} +1 -1
  26. package/dist/bootstrap-4CELFLJO.cjs +32 -0
  27. package/dist/{bootstrap-AKAUP6F6.cjs.map → bootstrap-4CELFLJO.cjs.map} +1 -1
  28. package/dist/{chunk-VJT6P4N6.cjs → chunk-3HR772HI.cjs} +199 -32
  29. package/dist/chunk-3HR772HI.cjs.map +1 -0
  30. package/dist/chunk-3KTWGODI.cjs +178 -0
  31. package/dist/chunk-3KTWGODI.cjs.map +1 -0
  32. package/dist/{chunk-QXIQWPAP.js → chunk-3UK5XBVJ.js} +4 -134
  33. package/dist/chunk-3UK5XBVJ.js.map +1 -0
  34. package/dist/{chunk-FXYP2HA6.js → chunk-4AO3A3JM.js} +48 -4
  35. package/dist/chunk-4AO3A3JM.js.map +1 -0
  36. package/dist/{chunk-Z6ZWNWWR.js → chunk-4CV4JOE5.js} +3 -9
  37. package/dist/{chunk-Z6ZWNWWR.js.map → chunk-4CV4JOE5.js.map} +1 -1
  38. package/dist/chunk-4M7X5HAB.cjs +173 -0
  39. package/dist/chunk-4M7X5HAB.cjs.map +1 -0
  40. package/dist/chunk-53NYVYVX.js +3243 -0
  41. package/dist/chunk-53NYVYVX.js.map +1 -0
  42. package/dist/{chunk-35U3FROB.js → chunk-5H3MWQJS.js} +714 -184
  43. package/dist/chunk-5H3MWQJS.js.map +1 -0
  44. package/dist/{chunk-YVUJBEXE.cjs → chunk-5PMQQFRE.cjs} +16 -7
  45. package/dist/chunk-5PMQQFRE.cjs.map +1 -0
  46. package/dist/{chunk-57P6MJKC.js → chunk-6UNONDW7.js} +94 -10
  47. package/dist/chunk-6UNONDW7.js.map +1 -0
  48. package/dist/{chunk-Y3N7UUDO.js → chunk-7OGPN7MP.js} +5 -2
  49. package/dist/chunk-7OGPN7MP.js.map +1 -0
  50. package/dist/{chunk-2OL4O2TH.cjs → chunk-7OS7TX2Q.cjs} +68 -62
  51. package/dist/chunk-7OS7TX2Q.cjs.map +1 -0
  52. package/dist/{chunk-3TPQ2BU6.js → chunk-BYBMTIMT.js} +2 -6
  53. package/dist/chunk-BYBMTIMT.js.map +1 -0
  54. package/dist/{chunk-ES5HNFFT.js → chunk-CF7OL6HR.js} +4 -2
  55. package/dist/chunk-CF7OL6HR.js.map +1 -0
  56. package/dist/chunk-CJONKRHJ.js +162 -0
  57. package/dist/chunk-CJONKRHJ.js.map +1 -0
  58. package/dist/{chunk-OHVB4AJ7.js → chunk-CJX74IYK.js} +24 -18
  59. package/dist/chunk-CJX74IYK.js.map +1 -0
  60. package/dist/{chunk-5KVM3WEY.cjs → chunk-CNKT4PME.cjs} +1592 -868
  61. package/dist/chunk-CNKT4PME.cjs.map +1 -0
  62. package/dist/{chunk-G7VZBCD6.cjs → chunk-CZLDE2OZ.cjs} +2 -9
  63. package/dist/{chunk-G7VZBCD6.cjs.map → chunk-CZLDE2OZ.cjs.map} +1 -1
  64. package/dist/{chunk-WQBRWOQT.cjs → chunk-DPA3KWPY.cjs} +4 -3
  65. package/dist/chunk-DPA3KWPY.cjs.map +1 -0
  66. package/dist/{chunk-LINKCEG4.cjs → chunk-E2763JUP.cjs} +726 -196
  67. package/dist/chunk-E2763JUP.cjs.map +1 -0
  68. package/dist/chunk-E5UJBLQ7.js +220 -0
  69. package/dist/chunk-E5UJBLQ7.js.map +1 -0
  70. package/dist/{chunk-DVD5P72E.cjs → chunk-EEJUFDMF.cjs} +2 -6
  71. package/dist/chunk-EEJUFDMF.cjs.map +1 -0
  72. package/dist/chunk-FSKONGCX.cjs +253 -0
  73. package/dist/chunk-FSKONGCX.cjs.map +1 -0
  74. package/dist/{chunk-Y3QQN7PN.js → chunk-GAAHG2Z4.js} +13 -4
  75. package/dist/chunk-GAAHG2Z4.js.map +1 -0
  76. package/dist/chunk-GAOXD3XT.js +175 -0
  77. package/dist/chunk-GAOXD3XT.js.map +1 -0
  78. package/dist/{chunk-SA7NSSIQ.cjs → chunk-GUUB5EAG.cjs} +13 -187
  79. package/dist/chunk-GUUB5EAG.cjs.map +1 -0
  80. package/dist/{chunk-4DA7QPLA.cjs → chunk-GXFOGU7N.cjs} +5 -2
  81. package/dist/chunk-GXFOGU7N.cjs.map +1 -0
  82. package/dist/{chunk-I7HHI6QV.cjs → chunk-IDVRRRAK.cjs} +17 -9
  83. package/dist/chunk-IDVRRRAK.cjs.map +1 -0
  84. package/dist/{chunk-HXRD4B37.js → chunk-IPTZM3VE.js} +1423 -704
  85. package/dist/chunk-IPTZM3VE.js.map +1 -0
  86. package/dist/chunk-KC2GDBLS.cjs +84 -0
  87. package/dist/chunk-KC2GDBLS.cjs.map +1 -0
  88. package/dist/{chunk-QUW2RZTM.cjs → chunk-L46ROHUS.cjs} +51 -7
  89. package/dist/chunk-L46ROHUS.cjs.map +1 -0
  90. package/dist/chunk-L4EZKIEX.js +185 -0
  91. package/dist/chunk-L4EZKIEX.js.map +1 -0
  92. package/dist/{chunk-REK7AYOC.js → chunk-L5UKKZQN.js} +199 -32
  93. package/dist/chunk-L5UKKZQN.js.map +1 -0
  94. package/dist/chunk-NKPKR5BW.cjs +188 -0
  95. package/dist/chunk-NKPKR5BW.cjs.map +1 -0
  96. package/dist/chunk-NWUEVLQT.cjs +99 -0
  97. package/dist/chunk-NWUEVLQT.cjs.map +1 -0
  98. package/dist/{chunk-3AJE4SEG.js → chunk-OHC6UHFY.js} +208 -76
  99. package/dist/chunk-OHC6UHFY.js.map +1 -0
  100. package/dist/chunk-PHJRNPHY.cjs +3291 -0
  101. package/dist/chunk-PHJRNPHY.cjs.map +1 -0
  102. package/dist/{chunk-DXHRBMGB.js → chunk-PQ72Z6WC.js} +67 -112
  103. package/dist/chunk-PQ72Z6WC.js.map +1 -0
  104. package/dist/{chunk-K7JPTH3G.cjs → chunk-PV2I2KMI.cjs} +214 -82
  105. package/dist/chunk-PV2I2KMI.cjs.map +1 -0
  106. package/dist/{chunk-PDYFVNUX.cjs → chunk-Q23GAMLE.cjs} +71 -116
  107. package/dist/chunk-Q23GAMLE.cjs.map +1 -0
  108. package/dist/{chunk-H727JIG7.js → chunk-Q72BOAPK.js} +16 -8
  109. package/dist/chunk-Q72BOAPK.js.map +1 -0
  110. package/dist/{chunk-IBG6V56E.cjs → chunk-QFLB4EIJ.cjs} +2 -139
  111. package/dist/chunk-QFLB4EIJ.cjs.map +1 -0
  112. package/dist/{chunk-2KVHZE6O.cjs → chunk-RFFSZSCL.cjs} +282 -190
  113. package/dist/chunk-RFFSZSCL.cjs.map +1 -0
  114. package/dist/{chunk-V3LKPM3O.cjs → chunk-SHTTJMLT.cjs} +4 -2
  115. package/dist/chunk-SHTTJMLT.cjs.map +1 -0
  116. package/dist/{chunk-WOWUL7ZY.js → chunk-UUDTPZX6.js} +5 -4
  117. package/dist/chunk-UUDTPZX6.js.map +1 -0
  118. package/dist/{chunk-QPPDLRNR.js → chunk-V7KZQIZ6.js} +277 -185
  119. package/dist/chunk-V7KZQIZ6.js.map +1 -0
  120. package/dist/{chunk-3ZFYL34R.js → chunk-WXVB364T.js} +12 -185
  121. package/dist/chunk-WXVB364T.js.map +1 -0
  122. package/dist/chunk-XEB7PH2E.js +81 -0
  123. package/dist/chunk-XEB7PH2E.js.map +1 -0
  124. package/dist/{chunk-IA6AU5PI.cjs → chunk-Y7AQK4R4.cjs} +94 -10
  125. package/dist/chunk-Y7AQK4R4.cjs.map +1 -0
  126. package/dist/chunk-YFAVQQTU.js +92 -0
  127. package/dist/chunk-YFAVQQTU.js.map +1 -0
  128. package/dist/cli/index.cjs +6 -6
  129. package/dist/cli/index.cjs.map +1 -1
  130. package/dist/cli/index.js +6 -6
  131. package/dist/cli/index.js.map +1 -1
  132. package/dist/client.cjs +4 -4
  133. package/dist/client.d.cts +3 -3
  134. package/dist/client.d.ts +3 -3
  135. package/dist/client.js +2 -2
  136. package/dist/drizzle/index.cjs +15 -14
  137. package/dist/drizzle/index.d.cts +10 -14
  138. package/dist/drizzle/index.d.ts +10 -14
  139. package/dist/drizzle/index.js +6 -5
  140. package/dist/fields/index.cjs +22 -38
  141. package/dist/fields/index.d.cts +2 -22
  142. package/dist/fields/index.d.ts +2 -22
  143. package/dist/fields/index.js +2 -2
  144. package/dist/graphql/index.cjs +6 -5
  145. package/dist/graphql/index.d.cts +5 -3
  146. package/dist/graphql/index.d.ts +5 -3
  147. package/dist/graphql/index.js +4 -3
  148. package/dist/index-BKta3cBH.d.cts +277 -0
  149. package/dist/index-ClOqnkTO.d.ts +277 -0
  150. package/dist/index.cjs +310 -168
  151. package/dist/index.cjs.map +1 -1
  152. package/dist/index.d.cts +130 -211
  153. package/dist/index.d.ts +130 -211
  154. package/dist/index.js +174 -35
  155. package/dist/index.js.map +1 -1
  156. package/dist/integration.cjs +3 -3
  157. package/dist/integration.js +2 -2
  158. package/dist/media-7WDX4BDJ.js +4 -0
  159. package/dist/{media-GPPTZ43E.js.map → media-7WDX4BDJ.js.map} +1 -1
  160. package/dist/{media-XNTUFJZR.cjs → media-TUSLVRQ6.cjs} +3 -3
  161. package/dist/{media-XNTUFJZR.cjs.map → media-TUSLVRQ6.cjs.map} +1 -1
  162. package/dist/mongo-auth-adapter-GT4S7SCU.cjs +17 -0
  163. package/dist/{mongo-auth-adapter-NHHUJHVH.cjs.map → mongo-auth-adapter-GT4S7SCU.cjs.map} +1 -1
  164. package/dist/mongo-auth-adapter-M7VV4LNB.js +4 -0
  165. package/dist/{mongo-auth-adapter-NJQUUCTP.js.map → mongo-auth-adapter-M7VV4LNB.js.map} +1 -1
  166. package/dist/mongodb/index.cjs +9 -8
  167. package/dist/mongodb/index.d.cts +6 -13
  168. package/dist/mongodb/index.d.ts +6 -13
  169. package/dist/mongodb/index.js +5 -4
  170. package/dist/postgres-auth-adapter-AFAPISH7.js +5 -0
  171. package/dist/{postgres-auth-adapter-3T2NKTSE.js.map → postgres-auth-adapter-AFAPISH7.js.map} +1 -1
  172. package/dist/postgres-auth-adapter-SFDTLONT.cjs +14 -0
  173. package/dist/{postgres-auth-adapter-7IEENCKQ.cjs.map → postgres-auth-adapter-SFDTLONT.cjs.map} +1 -1
  174. package/dist/redis-adapter-UQX4EE3B.cjs +13 -0
  175. package/dist/{redis-adapter-D2E2S3GB.cjs.map → redis-adapter-UQX4EE3B.cjs.map} +1 -1
  176. package/dist/redis-adapter-XALOGWY3.js +4 -0
  177. package/dist/{redis-adapter-VQXD7ESY.js.map → redis-adapter-XALOGWY3.js.map} +1 -1
  178. package/dist/rest/index.cjs +16 -15
  179. package/dist/rest/index.d.cts +4 -4
  180. package/dist/rest/index.d.ts +4 -4
  181. package/dist/rest/index.js +14 -13
  182. package/dist/{schema-37SE2F4B.cjs → schema-6QL3USNB.cjs} +15 -15
  183. package/dist/{schema-37SE2F4B.cjs.map → schema-6QL3USNB.cjs.map} +1 -1
  184. package/dist/{schema-5PHL5IVB.js → schema-FNNWEAAW.js} +4 -4
  185. package/dist/{schema-5PHL5IVB.js.map → schema-FNNWEAAW.js.map} +1 -1
  186. package/dist/sqlite-adapter-AQB5TCGV.cjs +13 -0
  187. package/dist/{sqlite-adapter-LVK5PS4T.cjs.map → sqlite-adapter-AQB5TCGV.cjs.map} +1 -1
  188. package/dist/sqlite-adapter-N5H6IM2X.js +4 -0
  189. package/dist/{sqlite-adapter-TR3U3W6Q.js.map → sqlite-adapter-N5H6IM2X.js.map} +1 -1
  190. package/dist/templates/index.cjs +134 -32
  191. package/dist/templates/index.d.cts +52 -9
  192. package/dist/templates/index.d.ts +52 -9
  193. package/dist/templates/index.js +4 -2
  194. package/dist/trpc/index.cjs +14 -13
  195. package/dist/trpc/index.d.cts +55 -49
  196. package/dist/trpc/index.d.ts +55 -49
  197. package/dist/trpc/index.js +5 -4
  198. package/dist/{types-D6ZLRGbH.d.cts → types-CpjuXbe7.d.cts} +2 -0
  199. package/dist/{types-D6ZLRGbH.d.ts → types-CpjuXbe7.d.ts} +2 -0
  200. package/dist/{types-VtjUxIMp.d.cts → types-DeSApf9T.d.cts} +36 -14
  201. package/dist/{types-VtjUxIMp.d.ts → types-DeSApf9T.d.ts} +36 -14
  202. package/dist/{types-J3R9nVsZ.d.cts → types-Dgzlftb7.d.ts} +32 -28
  203. package/dist/{types-Bs1up4yP.d.ts → types-Ds0tCA3L.d.cts} +32 -28
  204. package/dist/ws/index.cjs +6 -6
  205. package/dist/ws/index.js +2 -2
  206. package/package.json +22 -4
  207. package/dist/bootstrap-AKAUP6F6.cjs +0 -32
  208. package/dist/bootstrap-JCML6NFO.js +0 -7
  209. package/dist/chunk-2KVHZE6O.cjs.map +0 -1
  210. package/dist/chunk-2OL4O2TH.cjs.map +0 -1
  211. package/dist/chunk-35U3FROB.js.map +0 -1
  212. package/dist/chunk-3AJE4SEG.js.map +0 -1
  213. package/dist/chunk-3J4MFTI3.js +0 -3872
  214. package/dist/chunk-3J4MFTI3.js.map +0 -1
  215. package/dist/chunk-3TPQ2BU6.js.map +0 -1
  216. package/dist/chunk-3ZFYL34R.js.map +0 -1
  217. package/dist/chunk-4DA7QPLA.cjs.map +0 -1
  218. package/dist/chunk-57P6MJKC.js.map +0 -1
  219. package/dist/chunk-5KVM3WEY.cjs.map +0 -1
  220. package/dist/chunk-6IMPH6WV.cjs +0 -3897
  221. package/dist/chunk-6IMPH6WV.cjs.map +0 -1
  222. package/dist/chunk-ATBOUGQP.cjs +0 -513
  223. package/dist/chunk-ATBOUGQP.cjs.map +0 -1
  224. package/dist/chunk-DVD5P72E.cjs.map +0 -1
  225. package/dist/chunk-DXHRBMGB.js.map +0 -1
  226. package/dist/chunk-ES5HNFFT.js.map +0 -1
  227. package/dist/chunk-FXYP2HA6.js.map +0 -1
  228. package/dist/chunk-H727JIG7.js.map +0 -1
  229. package/dist/chunk-HXRD4B37.js.map +0 -1
  230. package/dist/chunk-I7HHI6QV.cjs.map +0 -1
  231. package/dist/chunk-IA6AU5PI.cjs.map +0 -1
  232. package/dist/chunk-IBG6V56E.cjs.map +0 -1
  233. package/dist/chunk-K7JPTH3G.cjs.map +0 -1
  234. package/dist/chunk-LINKCEG4.cjs.map +0 -1
  235. package/dist/chunk-OHVB4AJ7.js.map +0 -1
  236. package/dist/chunk-PDYFVNUX.cjs.map +0 -1
  237. package/dist/chunk-Q23JB3KL.js +0 -488
  238. package/dist/chunk-Q23JB3KL.js.map +0 -1
  239. package/dist/chunk-QPPDLRNR.js.map +0 -1
  240. package/dist/chunk-QUW2RZTM.cjs.map +0 -1
  241. package/dist/chunk-QXIQWPAP.js.map +0 -1
  242. package/dist/chunk-R3XIBBAW.cjs +0 -34
  243. package/dist/chunk-R3XIBBAW.cjs.map +0 -1
  244. package/dist/chunk-REK7AYOC.js.map +0 -1
  245. package/dist/chunk-SA7NSSIQ.cjs.map +0 -1
  246. package/dist/chunk-SDMNUYVU.js +0 -30
  247. package/dist/chunk-SDMNUYVU.js.map +0 -1
  248. package/dist/chunk-V3LKPM3O.cjs.map +0 -1
  249. package/dist/chunk-VJT6P4N6.cjs.map +0 -1
  250. package/dist/chunk-WOWUL7ZY.js.map +0 -1
  251. package/dist/chunk-WQBRWOQT.cjs.map +0 -1
  252. package/dist/chunk-Y3N7UUDO.js.map +0 -1
  253. package/dist/chunk-Y3QQN7PN.js.map +0 -1
  254. package/dist/chunk-YVUJBEXE.cjs.map +0 -1
  255. package/dist/index-CLp-DRKA.d.ts +0 -64
  256. package/dist/index-DfO7G4kN.d.cts +0 -64
  257. package/dist/media-GPPTZ43E.js +0 -4
  258. package/dist/mongo-auth-adapter-NHHUJHVH.cjs +0 -17
  259. package/dist/mongo-auth-adapter-NJQUUCTP.js +0 -4
  260. package/dist/postgres-auth-adapter-3T2NKTSE.js +0 -5
  261. package/dist/postgres-auth-adapter-7IEENCKQ.cjs +0 -14
  262. package/dist/redis-adapter-D2E2S3GB.cjs +0 -13
  263. package/dist/redis-adapter-VQXD7ESY.js +0 -4
  264. package/dist/sqlite-adapter-LVK5PS4T.cjs +0 -13
  265. package/dist/sqlite-adapter-TR3U3W6Q.js +0 -4
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <div align="center">
4
4
 
5
- **Astro-Native Headless CMS with Multi-Database Adapters, Multi-Protocol APIs, and Multi-Vendor Support**
5
+ **Astro-native headless CMS with multi-database adapters, multi-protocol APIs, and an admin dashboard built-in.**
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/@kyro-cms/core.svg)](https://www.npmjs.com/package/@kyro-cms/core)
8
8
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -12,54 +12,47 @@
12
12
 
13
13
  ---
14
14
 
15
- ## Why Kyro?
15
+ ## What Kyro Gives You
16
16
 
17
- Kyro is built for **Astro** from the ground up. Unlike other CMS solutions that bolt on Astro support, Kyro is architected to leverage Astro's islands architecture, server output modes, and performance-first approach.
17
+ Kyro turns a single TypeScript config into a full CMS backend for Astro, including:
18
18
 
19
- ### Key Features
20
-
21
- - **Zero-Config Development** - SQLite by default for instant setup, no external dependencies
22
- - **Multi-Database** - SQLite (dev), PostgreSQL, MongoDB via unified adapter interface
23
- - **Multi-Protocol API** - REST, GraphQL, tRPC, and WebSocket from a single config
24
- - **Multi-Vendor** - Built-in tenant scoping and row-level access control
25
- - **E-Commerce Ready** - Products, orders, customers, inventory, coupons out of the box
26
- - **Plugin System** - Extend with SEO, analytics, reviews, and more
27
- - **Any Styling** - Tailwind, CSS Modules, Styled Components, or plain CSS
19
+ - **REST, GraphQL, tRPC, and WebSocket APIs** from the same collection schema
20
+ - **Local SQLite development** plus production-ready PostgreSQL and MongoDB adapters
21
+ - **Auto-generated admin UI** with forms, media, auth, and drafts
22
+ - **End-to-end type safety** powered by Zod and TypeScript
23
+ - **Plugin-friendly architecture** for custom hooks, fields, and dashboard extensions
28
24
 
29
25
  ---
30
26
 
31
27
  ## Quick Start
32
28
 
33
- ### Option 1: Create New Project (Recommended)
29
+ ### Create a new Kyro project
34
30
 
35
31
  ```bash
36
- npm create kyro@latest
32
+ pnpm create kyro@latest my-project
33
+ cd my-project
34
+ pnpm install
35
+ pnpm dev
37
36
  ```
38
37
 
39
- This launches an interactive wizard that asks:
38
+ Open:
40
39
 
41
- - Project name
42
- - Database (SQLite, PostgreSQL, MongoDB)
43
- - API protocols (REST, GraphQL, tRPC, WebSocket)
44
- - Styling (Tailwind, CSS Modules, Styled Components, None)
45
- - Authentication (JWT)
46
- - Versioning/Drafts
47
- - Admin dashboard
48
- - Starting template (Minimal, Blog, E-commerce)
40
+ - `http://localhost:4321` — public site
41
+ - `http://localhost:4321/admin` admin dashboard
49
42
 
50
- ### Option 2: Add to Existing Project
43
+ ### Add Kyro to an existing project
51
44
 
52
45
  ```bash
53
- npm install @kyro-cms/core
46
+ pnpm install @kyro-cms/core
54
47
  ```
55
48
 
56
49
  ```typescript
57
50
  // kyro.config.ts
58
- import { defineConfig, localAdapter } from "@kyro-cms/core";
51
+ import { defineConfig, createLocalAdapter } from "@kyro-cms/core";
59
52
 
60
53
  export default defineConfig({
61
54
  name: "my-app",
62
- adapter: localAdapter({ path: "./data.db" }),
55
+ adapter: createLocalAdapter({ path: "./data.db" }),
63
56
  collections: {
64
57
  posts: {
65
58
  slug: "posts",
@@ -72,73 +65,59 @@ export default defineConfig({
72
65
  ],
73
66
  },
74
67
  },
75
- api: {
76
- rest: true,
77
- graphql: true,
78
- },
79
68
  });
80
69
  ```
81
70
 
82
71
  ---
83
72
 
84
- ## Database Adapters
73
+ ## Why Kyro
85
74
 
86
- ### SQLite (Default for Development)
75
+ Kyro is designed for Astro-first content applications:
87
76
 
88
- ```typescript
89
- import { localAdapter } from "@kyro-cms/core";
77
+ - **Fast dev setup:** zero-config local SQLite support
78
+ - **Unified API surface:** one schema powers REST, GraphQL, tRPC, and WebSockets
79
+ - **Production-ready:** swap adapters without rewriting collections
80
+ - **Admin experience:** auto-generated UIs, auth, RBAC, and draft workflows
90
81
 
91
- const adapter = localAdapter({
92
- path: "./data.db", // or ':memory:' for in-memory
93
- });
94
- ```
82
+ ---
95
83
 
96
- Perfect for development and small projects. Zero configuration required - no external services needed.
84
+ ## Core Concepts
97
85
 
98
- ### PostgreSQL (Production)
86
+ ### Database adapters
99
87
 
100
- ```typescript
101
- import { drizzleAdapter } from "@kyro-cms/core";
88
+ Kyro uses a shared adapter layer so the same collection schema works across:
102
89
 
103
- const adapter = drizzleAdapter({
104
- connectionString: process.env.DATABASE_URL,
105
- });
106
- ```
90
+ - **SQLite** instant local development
91
+ - **PostgreSQL** — production SQL with Drizzle
92
+ - **MongoDB** — flexible document storage
107
93
 
108
- ### MongoDB (Flexible Schemas)
94
+ ### API protocols
109
95
 
110
- ```typescript
111
- import { mongoAdapter } from "@kyro-cms/core";
96
+ Use multiple protocols at once, depending on your app needs:
112
97
 
113
- const adapter = mongoAdapter({
114
- connectionString: process.env.MONGODB_URI,
115
- });
116
- ```
98
+ - **REST** for simple CRUD and integration compatibility
99
+ - **GraphQL** for nested queries and schema introspection
100
+ - **tRPC** for fully type-safe client-server calls
101
+ - **WebSocket** for real-time subscriptions and live updates
117
102
 
118
- ---
103
+ ### Astro-safe exports
119
104
 
120
- ## API Protocols
105
+ Kyro preserves Astro compatibility with two entrypoints:
121
106
 
122
- Kyro exposes your data through multiple protocols simultaneously.
107
+ - `@kyro-cms/core` server-only backend logic, adapters, auth, and APIs
108
+ - `@kyro-cms/core/client` — browser-safe client utilities, types, and UI helpers
123
109
 
124
- ### REST API
110
+ ---
111
+
112
+ ## Example usage
113
+
114
+ ### REST
125
115
 
126
116
  ```bash
127
- # List documents
128
117
  GET /api/posts
129
-
130
- # Get single document
131
118
  GET /api/posts/:id
132
-
133
- # Create document
134
119
  POST /api/posts
135
- { "title": "Hello World" }
136
-
137
- # Update document
138
120
  PATCH /api/posts/:id
139
- { "title": "Updated Title" }
140
-
141
- # Delete document
142
121
  DELETE /api/posts/:id
143
122
  ```
144
123
 
@@ -155,542 +134,25 @@ query {
155
134
  totalDocs
156
135
  }
157
136
  }
158
-
159
- mutation {
160
- postsCreate(data: { title: "New Post", slug: "new-post" }) {
161
- doc {
162
- id
163
- title
164
- }
165
- }
166
- }
167
137
  ```
168
138
 
169
139
  ### tRPC
170
140
 
171
141
  ```typescript
172
- const client = createTRPCClient({
173
- router: kyro.router,
174
- transformer: superjson,
175
- });
176
-
177
- // Type-safe queries
178
- const posts = await client.posts.find.query({ page: 1 });
179
- const newPost = await client.posts.create.mutate({
180
- title: "Hello",
181
- slug: "hello",
182
- });
183
- ```
184
-
185
- ---
186
-
187
- ## Core Export Splitting (Astro Support)
188
-
189
- To support **Astro's islands architecture** and prevent Node.js-only dependencies (like Redis, bcrypt, or database drivers) from crashing your browser bundle, Kyro Core provides two distinct entrypoints:
190
-
191
- ### 1. `@kyro-cms/core` (Server-Only)
192
-
193
- Use this for backend logic, API routes, database configuration, and authentication adapters. This entrypoint includes all Node.js built-ins.
194
-
195
- ```typescript
196
- import { createKyro, drizzleAdapter, RedisAuthAdapter } from "@kyro-cms/core";
197
- ```
198
-
199
- ### 2. `@kyro-cms/core/client` (Browser-Safe)
200
-
201
- Use this for **Astro components**, React/Vue/Svelte islands, styling, and types. This entrypoint is guaranteed to be free of Node.js dependencies.
202
-
203
- ```typescript
204
- import type { KyroConfig, CollectionConfig } from "@kyro-cms/core/client";
205
- import { defaultLightTheme, generateCSSVariables } from "@kyro-cms/core/client";
206
- ```
207
-
208
- ---
209
-
210
- ### WebSocket (Real-time)
211
-
212
- ```typescript
213
- const ws = new WebSocket("ws://localhost:4321/api/ws");
214
-
215
- ws.send(
216
- JSON.stringify({
217
- type: "subscribe",
218
- collection: "posts",
219
- event: "create",
220
- }),
221
- );
222
-
223
- ws.onmessage = (event) => {
224
- const data = JSON.parse(event.data);
225
- // Handle real-time updates
226
- };
227
- ```
228
-
229
- ---
230
-
231
- ## Field Types
232
-
233
- Kyro supports 21 field types:
234
-
235
- | Type | Description |
236
- | -------------- | -------------------------- |
237
- | `text` | Single-line text input |
238
- | `textarea` | Multi-line text |
239
- | `richtext` | Rich text editor content |
240
- | `markdown` | Markdown content |
241
- | `number` | Numeric values |
242
- | `email` | Email with validation |
243
- | `password` | Hashed password storage |
244
- | `checkbox` | Boolean toggle |
245
- | `date` | Date/time picker |
246
- | `select` | Dropdown selection |
247
- | `radio` | Radio button group |
248
- | `color` | Color picker |
249
- | `json` | JSON data |
250
- | `code` | Code editor content |
251
- | `array` | Repeatable field groups |
252
- | `group` | Nested field groups |
253
- | `relationship` | Link to other documents |
254
- | `upload` | File/media uploads |
255
- | `blocks` | Structured content blocks |
256
- | `row` | Horizontal field layout |
257
- | `collapsible` | Collapsible field sections |
258
- | `tabs` | Tabbed interface |
259
-
260
- ### Example: Complex Fields
261
-
262
- ```typescript
263
- fields: [
264
- { name: "title", type: "text", required: true },
265
-
266
- {
267
- name: "author",
268
- type: "relationship",
269
- relationTo: "users",
270
- required: true,
271
- },
272
-
273
- {
274
- name: "tags",
275
- type: "array",
276
- fields: [
277
- { name: "name", type: "text" },
278
- { name: "slug", type: "text" },
279
- ],
280
- },
281
-
282
- {
283
- name: "metadata",
284
- type: "group",
285
- fields: [
286
- { name: "views", type: "number", defaultValue: 0 },
287
- { name: "featured", type: "checkbox" },
288
- ],
289
- },
290
- ];
291
- ```
292
-
293
- ---
294
-
295
- ## E-Commerce Collections
296
-
297
- Pre-built collections for building online stores:
298
-
299
- ```typescript
300
- import { ecommerceCollections } from "@kyro-cms/core";
301
-
302
- const kyro = createKyro({
303
- adapter: localAdapter({ path: "./store.db" }),
304
- collections: ecommerceCollections,
305
- });
306
-
307
- // Includes:
308
- // - products (with variants, pricing, inventory)
309
- // - categories (hierarchical)
310
- // - customers (with addresses)
311
- // - orders (with items, status tracking)
312
- // - coupons (percentage, fixed, free shipping)
313
- // - store settings (globals)
314
- ```
315
-
316
- ---
317
-
318
- ## Authentication
319
-
320
- Built-in JWT authentication with multiple storage options:
321
-
322
- ```typescript
323
- import { RedisAuthAdapter, SQLiteAuthAdapter } from "@kyro-cms/core";
324
- import { createAuthConfig } from "@kyro-cms/core";
325
-
326
- // Use SQLite for development (zero-config, default)
327
- const adapter = new SQLiteAuthAdapter({ path: "./data.db" });
328
-
329
- // Use Redis for sessions (recommended for production)
330
- const redisAdapter = new RedisAuthAdapter({
331
- url: process.env.REDIS_URL,
332
- tls: process.env.REDIS_TLS === "true",
333
- });
334
-
335
- // Or use PostgreSQL for production
336
- import { PostgresAuthAdapter, createDatabase } from "@kyro-cms/core";
337
-
338
- const { db } = await createDatabase();
339
- const pgAdapter = new PostgresAuthAdapter({ db });
340
-
341
- // Or use env-based config with all features
342
- const authConfig = await createAuthConfig();
343
- const { redis, routes, passwordPolicy, lockout } = authConfig;
344
- ```
345
-
346
- ### Authentication Features
347
-
348
- - **JWT Tokens** - 24h expiry with refresh token support
349
- - **Multiple Storage Options** - SQLite (dev), Redis, PostgreSQL via unified adapter interface
350
- - **Password Policy** - 12+ chars, complexity requirements, history check
351
- - **Account Lockout** - 5 failed attempts → 15 minute lockout
352
- - **Rate Limiting** - Per-IP and per-user limits
353
- - **Audit Logging** - 30-day retention with action tracking
354
-
355
- ### CLI Commands
356
-
357
- ```bash
358
- # Create admin user (first-run bootstrap)
359
- kyro auth bootstrap -e admin@example.com -p "SecurePass123!" -r admin
360
-
361
- # Database setup
362
- kyro db migrate # Run migrations
363
- kyro db push # Push schema to database
364
- kyro db seed # Seed default roles
365
- kyro db studio # Open Drizzle Studio
366
- ```
367
-
368
- ### RBAC Roles (Hierarchy)
369
-
370
- ```
371
- super_admin (100) > admin (90) > editor (70) > author (50) > customer (30) > guest (10)
372
- ```
373
-
374
- ### Environment Variables
375
-
376
- ```bash
377
- # Database
378
- DATABASE_URL=postgresql://user:pass@host:5432/kyro_cms
379
- DATABASE_SSL=false
380
-
381
- # Redis (sessions/cache)
382
- REDIS_URL=redis://localhost:6379
383
- REDIS_TLS=false
384
-
385
- # JWT
386
- JWT_SECRET=your-32-char-secret
387
- JWT_EXPIRES_IN=24h
388
-
389
- # Auth Settings
390
- LOCKOUT_MAX_ATTEMPTS=5
391
- LOCKOUT_DURATION_MINUTES=15
392
- PASSWORD_MIN_LENGTH=12
393
-
394
- # Bootstrap (first-run admin)
395
- KYRO_ADMIN_EMAIL=admin@example.com
396
- KYRO_ADMIN_PASSWORD=SecurePass123!
397
- ```
398
-
399
- ---
400
-
401
- ## Version History & Drafts
402
-
403
- Track document changes with built-in versioning:
404
-
405
- ```typescript
406
- import { createVersionManager } from "@kyro-cms/core";
407
-
408
- const versions = createVersionManager(adapter, {
409
- versioningEnabled: true,
410
- maxVersionsPerDocument: 50,
411
- });
412
-
413
- // Create a new version
414
- const version = await versions.createVersion({
415
- collection: "posts",
416
- documentId: "abc123",
417
- data: { title: "Updated Post" },
418
- status: "draft",
419
- createdBy: "user123",
420
- });
421
-
422
- // Publish
423
- await versions.publishVersion({
424
- collection: "posts",
425
- documentId: "abc123",
426
- versionId: version.id,
427
- publishedBy: "user123",
428
- });
429
- ```
430
-
431
- ---
432
-
433
- ## Admin Dashboard
434
-
435
- Kyro includes a full admin dashboard:
436
-
437
- ```bash
438
- npm install @kyro-cms/admin @kyro-cms/core
439
- ```
440
-
441
- The admin uses local utilities for API calls, date formatting, and validation.
442
-
443
- ```astro
444
- ---
445
- // admin/index.astro
446
- import { Admin } from '@kyro-cms/admin';
447
- import config from '../kyro.config';
448
- ---
449
-
450
- <Admin client:load config={config} />
451
- ```
452
-
453
- Features:
454
-
455
- - Collection browser with filtering and sorting
456
- - Document editor with all field types
457
- - Media library
458
- - Global settings editor
459
- - Dark mode support
460
-
461
- ---
462
-
463
- ## Plugin System
464
-
465
- Extend Kyro with plugins:
466
-
467
- ```typescript
468
- import {
469
- KyroPlugin,
470
- SEOPLugin,
471
- AnalyticsPlugin,
472
- CommentsPlugin,
473
- ReviewsPlugin,
474
- WishlistPlugin
475
- } from '@kyro-cms/core';
476
-
477
- const kyro = createKyro({
478
- adapter: localAdapter(),
479
- collections: [...],
480
- plugins: [
481
- new SEOPLugin({
482
- sitemap: true,
483
- robotsTxt: true,
484
- }),
485
- new AnalyticsPlugin({
486
- providers: ['google', 'plausible'],
487
- }),
488
- new CommentsPlugin(),
489
- new ReviewsPlugin(),
490
- ],
491
- });
492
- ```
493
-
494
- ### Creating Plugins
495
-
496
- ```typescript
497
- import { KyroPlugin } from "@kyro-cms/core";
498
-
499
- class MyPlugin extends KyroPlugin {
500
- name = "my-plugin";
501
-
502
- hooks = {
503
- "collection.beforeCreate": async (args) => {
504
- // Transform data before creation
505
- return { ...args, data: { ...args.data, source: "my-plugin" } };
506
- },
507
-
508
- "document.afterSave": async (args) => {
509
- // Send webhook, log analytics, etc.
510
- await sendWebhook(args);
511
- },
512
- };
513
- }
514
- ```
515
-
516
- ---
517
-
518
- ## Styling System
519
-
520
- Kyro ships with a complete styling system:
521
-
522
- ```typescript
523
- import {
524
- ecommerce2026Theme,
525
- generateCSSVariables,
526
- generateTailwindConfig,
527
- } from "@kyro-cms/core/client";
528
-
529
- // Generate CSS variables
530
- const cssVars = generateCSSVariables(ecommerce2026Theme);
531
-
532
- // Generate Tailwind config
533
- const tailwindConfig = generateTailwindConfig(ecommerce2026Theme);
534
-
535
- // Custom themes
536
- import { createAdminStyling } from "@kyro-cms/core/client";
537
-
538
- const myTheme = createAdminStyling({
539
- primaryColor: "#6366f1",
540
- borderRadius: "medium",
541
- fontFamily: "Inter",
542
- });
543
- ```
544
-
545
- ---
546
-
547
- ## Deployment
548
-
549
- ### Quick Start with Docker
550
-
551
- ```bash
552
- # Start PostgreSQL + Redis
553
- docker compose up -d
554
-
555
- # Push schema to database
556
- npm run db:push
557
-
558
- # Create admin user
559
- kyro auth bootstrap -e admin@example.com -p "SecurePass123!"
560
-
561
- # Start development
562
- npm run dev
563
- ```
564
-
565
- ### Environment Variables Required
566
-
567
- ```bash
568
- # Database (PostgreSQL)
569
- DATABASE_URL=postgresql://postgres:postgres@localhost:5432/kyro_cms
570
- DATABASE_SSL=false
571
-
572
- # Redis (sessions/cache) - supports Redis Cloud
573
- REDIS_URL=redis://localhost:6379
574
- REDIS_TLS=false
575
-
576
- # JWT (required)
577
- JWT_SECRET=change-me-in-production-min-32-chars
142
+ const response = await client.posts.find.query({ page: 1, limit: 10 });
578
143
  ```
579
144
 
580
- ### Vercel
581
-
582
- ```bash
583
- vercel --prod
584
- ```
585
-
586
- Environment variables:
587
-
588
- - `DATABASE_URL` - PostgreSQL connection string
589
- - `JWT_SECRET` - JWT signing secret
590
-
591
- ### Railway
592
-
593
- ```bash
594
- railway up
595
- ```
596
-
597
- ### Docker
598
-
599
- ```bash
600
- cd deployments/docker
601
- docker-compose up -d
602
- ```
603
-
604
- See `deployments/` for complete configuration.
605
-
606
145
  ---
607
146
 
608
- ## Project Structure
147
+ ## Learn more
609
148
 
610
- ```
611
- kyro-cms/
612
- ├── packages/
613
- │ └── create-kyro/ # Project scaffolding CLI
614
- ├── src/
615
- │ ├── index.ts # Main exports
616
- │ ├── createKyro.ts # Factory function
617
- │ ├── registry/ # Config registry & validation
618
- │ ├── fields/ # 21 field type definitions
619
- │ ├── database/ # Adapter implementations
620
- │ │ ├── local/ # SQLite adapter
621
- │ │ ├── drizzle/ # SQL adapters
622
- │ │ └── mongodb/ # MongoDB adapter
623
- │ ├── api/ # Multi-protocol gateway
624
- │ │ ├── rest/ # Hono REST
625
- │ │ ├── graphql/ # GraphQL schema
626
- │ │ ├── trpc/ # tRPC router
627
- │ │ └── ws/ # WebSocket server
628
- │ ├── auth/ # JWT authentication
629
- │ ├── versions/ # Version history
630
- │ ├── plugins/ # Plugin system
631
- │ ├── styling/ # Theming
632
- │ └── cli/ # CLI tools
633
- ├── admin/ # Admin dashboard (Astro)
634
- ├── examples/ # Example configurations
635
- ├── docs/ # Documentation
636
- └── deployments/ # Deployment configs
637
- ```
638
-
639
- ---
640
-
641
- ## CLI Commands
642
-
643
- ```bash
644
- # Initialize a new project
645
- npm create kyro@latest
646
-
647
- # Generate TypeScript types
648
- kyro generate
649
-
650
- # Push schema to database
651
- kyro push
652
-
653
- # Open database studio
654
- kyro studio
655
-
656
- # Check system health
657
- kyro health
658
- ```
659
-
660
- ---
661
-
662
- ## Documentation
663
-
664
- - [Getting Started](docs/getting-started.md)
665
- - [API Reference](docs/api.md)
666
- - [E-Commerce Guide](docs/ecommerce.md)
667
- - [Plugin Development](docs/plugins.md)
668
- - [Deployment Guide](docs/deployment.md)
669
-
670
- ---
671
-
672
- ## Contributing
673
-
674
- Contributions are welcome! Please read our contributing guide before submitting PRs.
675
-
676
- 1. Fork the repository
677
- 2. Create your feature branch (`git checkout -b feature/amazing`)
678
- 3. Commit your changes (`git commit -m 'Add amazing feature'`)
679
- 4. Push to the branch (`git push origin feature/amazing`)
680
- 5. Open a Pull Request
149
+ - `docs/getting-started.md` — setup and first app walkthrough
150
+ - `docs/architecture.md` — how Kyro works under the hood
151
+ - `docs/api.md` — API protocols and usage patterns
152
+ - `docs/database.md` supported adapters and configuration
681
153
 
682
154
  ---
683
155
 
684
156
  ## License
685
157
 
686
- MIT License - see [LICENSE](LICENSE) for details.
687
-
688
- ---
689
-
690
- ## Acknowledgments
691
-
692
- Built with inspiration from:
693
-
694
- - [Payload CMS](https://payloadcms.com/) - The headless CMS that pushed the industry forward
695
- - [Strapi](https://strapi.io/) - Open source headless CMS
696
- - [Sanity](https://www.sanity.io/) - Real-time content infrastructure
158
+ MIT