create-mantiq 0.7.0 → 0.7.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 (220) hide show
  1. package/package.json +2 -1
  2. package/skeleton/.env.example +64 -0
  3. package/skeleton/README.md +46 -0
  4. package/skeleton/app/Console/Commands/.gitkeep +0 -0
  5. package/skeleton/app/Enums/UserStatus.ts +7 -0
  6. package/skeleton/app/Http/Controllers/HomeController.ts +78 -0
  7. package/skeleton/app/Http/Middleware/.gitkeep +0 -0
  8. package/skeleton/app/Models/User.ts +7 -0
  9. package/skeleton/app/Providers/AppServiceProvider.ts +25 -0
  10. package/skeleton/app/Providers/DatabaseServiceProvider.ts +17 -0
  11. package/skeleton/bootstrap/.gitkeep +0 -0
  12. package/skeleton/config/ai.ts +51 -0
  13. package/skeleton/config/app.ts +108 -0
  14. package/skeleton/config/auth.ts +51 -0
  15. package/skeleton/config/broadcasting.ts +93 -0
  16. package/skeleton/config/cache.ts +61 -0
  17. package/skeleton/config/cors.ts +77 -0
  18. package/skeleton/config/database.ts +120 -0
  19. package/skeleton/config/filesystem.ts +58 -0
  20. package/skeleton/config/hashing.ts +47 -0
  21. package/skeleton/config/heartbeat.ts +112 -0
  22. package/skeleton/config/logging.ts +58 -0
  23. package/skeleton/config/mail.ts +93 -0
  24. package/skeleton/config/notify.ts +141 -0
  25. package/skeleton/config/queue.ts +59 -0
  26. package/skeleton/config/search.ts +96 -0
  27. package/skeleton/config/services.ts +110 -0
  28. package/skeleton/config/session.ts +84 -0
  29. package/skeleton/config/vite.ts +33 -0
  30. package/skeleton/database/factories/.gitkeep +0 -0
  31. package/skeleton/database/migrations/001_create_users_table.ts +19 -0
  32. package/skeleton/database/migrations/002_create_personal_access_tokens_table.ts +22 -0
  33. package/skeleton/database/seeders/DatabaseSeeder.ts +7 -0
  34. package/skeleton/index.ts +20 -0
  35. package/skeleton/mantiq.ts +8 -0
  36. package/skeleton/package.json +34 -0
  37. package/skeleton/public/.gitkeep +0 -0
  38. package/skeleton/routes/api.ts +8 -0
  39. package/skeleton/routes/channels.ts +23 -0
  40. package/skeleton/routes/console.ts +24 -0
  41. package/skeleton/routes/web.ts +6 -0
  42. package/skeleton/storage/cache/.gitkeep +0 -0
  43. package/skeleton/storage/framework/.gitkeep +0 -0
  44. package/skeleton/tests/feature/api.test.ts +14 -0
  45. package/skeleton/tests/feature/home.test.ts +17 -0
  46. package/skeleton/tests/unit/example.test.ts +11 -0
  47. package/skeleton/tsconfig.json +27 -0
  48. package/src/index.ts +289 -25
  49. package/src/templates.ts +141 -945
  50. package/src/terminal.ts +64 -0
  51. package/stubs/api-only/routes/api.ts.stub +24 -0
  52. package/stubs/api-only/tests/feature/token-auth.test.ts.stub +69 -0
  53. package/stubs/auth/api/app/Http/Controllers/ApiAuthController.ts.stub +57 -0
  54. package/stubs/auth/api/routes/api.ts.stub +24 -0
  55. package/stubs/auth/api/tests/feature/token-auth.test.ts.stub +69 -0
  56. package/stubs/auth/shared/app/Http/Requests/LoginRequest.ts.stub +10 -0
  57. package/stubs/auth/shared/app/Http/Requests/RegisterRequest.ts.stub +11 -0
  58. package/stubs/auth/web/app/Http/Controllers/AuthController.ts.stub +43 -0
  59. package/stubs/auth/web/app/Http/Controllers/PageController.ts.stub +66 -0
  60. package/stubs/auth/web/routes/web.ts.stub +25 -0
  61. package/stubs/auth/web/svelte/src/App.svelte.stub +77 -0
  62. package/stubs/auth/web/svelte/src/pages.ts.stub +17 -0
  63. package/stubs/auth/web/tests/feature/auth.test.ts.stub +69 -0
  64. package/stubs/auth/web/vue/src/App.vue.stub +74 -0
  65. package/stubs/auth/web/vue/src/pages.ts.stub +17 -0
  66. package/stubs/manifest.json +630 -2
  67. package/stubs/noauth/app/Http/Controllers/PageController.ts.stub +41 -0
  68. package/stubs/noauth/app/Models/User.ts.stub +5 -0
  69. package/stubs/noauth/database/migrations/001_create_users_table.ts.stub +17 -0
  70. package/stubs/noauth/routes/api.ts.stub +16 -0
  71. package/stubs/noauth/routes/web.ts.stub +15 -0
  72. package/stubs/noauth/svelte/src/App.svelte.stub +68 -0
  73. package/stubs/noauth/svelte/src/pages.ts.stub +7 -0
  74. package/stubs/noauth/vue/src/App.vue.stub +62 -0
  75. package/stubs/noauth/vue/src/pages.ts.stub +7 -0
  76. package/stubs/react/src/App.tsx.stub +4 -2
  77. package/stubs/react/src/components/layout/search-dialog.tsx.stub +2 -2
  78. package/stubs/react/src/components/layout/sidebar-data.ts.stub +2 -2
  79. package/stubs/react/src/lib/api.ts.stub +30 -6
  80. package/stubs/react/src/pages/Login.tsx.stub +3 -3
  81. package/stubs/react/src/pages/users/dialogs.tsx.stub +7 -26
  82. package/stubs/react/vite.config.ts.stub +26 -3
  83. package/stubs/shared/app/Http/Controllers/ApiAuthController.ts.stub +57 -0
  84. package/stubs/shared/app/Http/Controllers/AuthController.ts.stub +14 -38
  85. package/stubs/shared/app/Http/Controllers/PageController.ts.stub +3 -3
  86. package/stubs/shared/app/Http/Controllers/UserController.ts.stub +61 -0
  87. package/stubs/shared/app/Http/Requests/LoginRequest.ts.stub +10 -0
  88. package/stubs/shared/app/Http/Requests/RegisterRequest.ts.stub +11 -0
  89. package/stubs/shared/app/Http/Requests/StoreUserRequest.ts.stub +11 -0
  90. package/stubs/shared/app/Http/Requests/UpdateUserRequest.ts.stub +11 -0
  91. package/stubs/shared/config/app.ts.stub +36 -0
  92. package/stubs/shared/config/vite.ts.stub +8 -0
  93. package/stubs/shared/database/factories/UserFactory.ts.stub +4 -6
  94. package/stubs/shared/routes/api.ts.stub +12 -102
  95. package/stubs/shared/routes/web.ts.stub +5 -3
  96. package/stubs/shared/tests/feature/auth.test.ts.stub +69 -0
  97. package/stubs/shared/tests/feature/users.test.ts.stub +90 -0
  98. package/stubs/svelte/src/App.svelte.stub +1 -1
  99. package/stubs/svelte/src/lib/api.ts.stub +30 -6
  100. package/stubs/svelte/src/main.ts.stub +3 -1
  101. package/stubs/svelte/src/pages/Login.svelte.stub +3 -3
  102. package/stubs/svelte/vite.config.ts.stub +20 -1
  103. package/stubs/tailwind-only/react/src/components/layout/app-sidebar.tsx.stub +68 -0
  104. package/stubs/tailwind-only/react/src/components/layout/authenticated-layout.tsx.stub +57 -0
  105. package/stubs/tailwind-only/react/src/components/layout/header.tsx.stub +52 -0
  106. package/stubs/tailwind-only/react/src/components/layout/main.tsx.stub +21 -0
  107. package/stubs/tailwind-only/react/src/components/layout/nav-group.tsx.stub +185 -0
  108. package/stubs/tailwind-only/react/src/components/layout/nav-user.tsx.stub +106 -0
  109. package/stubs/tailwind-only/react/src/components/layout/sidebar-data.ts.stub +58 -0
  110. package/stubs/tailwind-only/react/src/components/layout/theme-toggle.tsx.stub +36 -0
  111. package/stubs/tailwind-only/react/src/components/layout/top-nav.tsx.stub +72 -0
  112. package/stubs/tailwind-only/react/src/lib/utils.ts.stub +6 -0
  113. package/stubs/tailwind-only/react/src/pages/Dashboard.tsx.stub +205 -0
  114. package/stubs/tailwind-only/react/src/pages/Login.tsx.stub +122 -0
  115. package/stubs/tailwind-only/react/src/pages/Register.tsx.stub +137 -0
  116. package/stubs/tailwind-only/react/src/pages/Users.tsx.stub +426 -0
  117. package/stubs/tailwind-only/react/src/pages/account/layout.tsx.stub +64 -0
  118. package/stubs/tailwind-only/react/src/pages/account/preferences.tsx.stub +80 -0
  119. package/stubs/tailwind-only/react/src/pages/account/profile.tsx.stub +67 -0
  120. package/stubs/tailwind-only/react/src/pages/account/security.tsx.stub +91 -0
  121. package/stubs/tailwind-only/react/src/style.css.stub +14 -0
  122. package/stubs/tailwind-only/svelte/src/lib/components/layout/app-sidebar.svelte.stub +104 -0
  123. package/stubs/tailwind-only/svelte/src/lib/components/layout/authenticated-layout.svelte.stub +51 -0
  124. package/stubs/tailwind-only/svelte/src/lib/components/layout/header.svelte.stub +66 -0
  125. package/stubs/tailwind-only/svelte/src/lib/components/layout/main.svelte.stub +26 -0
  126. package/stubs/tailwind-only/svelte/src/lib/components/layout/nav-group.svelte.stub +131 -0
  127. package/stubs/tailwind-only/svelte/src/lib/components/layout/nav-user.svelte.stub +104 -0
  128. package/stubs/tailwind-only/svelte/src/lib/components/layout/sidebar-data.ts.stub +57 -0
  129. package/stubs/tailwind-only/svelte/src/lib/components/layout/theme-toggle.svelte.stub +28 -0
  130. package/stubs/tailwind-only/svelte/src/lib/components/layout/top-nav.svelte.stub +99 -0
  131. package/stubs/tailwind-only/svelte/src/lib/utils.ts.stub +6 -0
  132. package/stubs/tailwind-only/svelte/src/pages/Dashboard.svelte.stub +192 -0
  133. package/stubs/tailwind-only/svelte/src/pages/Login.svelte.stub +120 -0
  134. package/stubs/tailwind-only/svelte/src/pages/Register.svelte.stub +134 -0
  135. package/stubs/tailwind-only/svelte/src/pages/Users.svelte.stub +293 -0
  136. package/stubs/tailwind-only/svelte/src/pages/account/Layout.svelte.stub +61 -0
  137. package/stubs/tailwind-only/svelte/src/pages/account/Preferences.svelte.stub +81 -0
  138. package/stubs/tailwind-only/svelte/src/pages/account/Profile.svelte.stub +76 -0
  139. package/stubs/tailwind-only/svelte/src/pages/account/Security.svelte.stub +140 -0
  140. package/stubs/tailwind-only/svelte/src/style.css.stub +127 -0
  141. package/stubs/tailwind-only/vue/src/components/layout/AppSidebar.vue.stub +60 -0
  142. package/stubs/tailwind-only/vue/src/components/layout/AuthenticatedLayout.vue.stub +73 -0
  143. package/stubs/tailwind-only/vue/src/components/layout/Header.vue.stub +54 -0
  144. package/stubs/tailwind-only/vue/src/components/layout/Main.vue.stub +22 -0
  145. package/stubs/tailwind-only/vue/src/components/layout/NavGroup.vue.stub +107 -0
  146. package/stubs/tailwind-only/vue/src/components/layout/NavUser.vue.stub +104 -0
  147. package/stubs/tailwind-only/vue/src/components/layout/ThemeToggle.vue.stub +28 -0
  148. package/stubs/tailwind-only/vue/src/components/layout/TopNav.vue.stub +86 -0
  149. package/stubs/tailwind-only/vue/src/components/layout/sidebar-data.ts.stub +57 -0
  150. package/stubs/tailwind-only/vue/src/lib/utils.ts.stub +7 -0
  151. package/stubs/tailwind-only/vue/src/pages/Dashboard.vue.stub +195 -0
  152. package/stubs/tailwind-only/vue/src/pages/Login.vue.stub +121 -0
  153. package/stubs/tailwind-only/vue/src/pages/Register.vue.stub +137 -0
  154. package/stubs/tailwind-only/vue/src/pages/Users.vue.stub +401 -0
  155. package/stubs/tailwind-only/vue/src/pages/account/Layout.vue.stub +56 -0
  156. package/stubs/tailwind-only/vue/src/pages/account/Preferences.vue.stub +81 -0
  157. package/stubs/tailwind-only/vue/src/pages/account/Profile.vue.stub +69 -0
  158. package/stubs/tailwind-only/vue/src/pages/account/Security.vue.stub +85 -0
  159. package/stubs/tailwind-only/vue/src/style.css.stub +26 -0
  160. package/stubs/themes/corporate/react/src/components/layout/app-sidebar.tsx.stub +74 -0
  161. package/stubs/themes/corporate/react/src/components/layout/authenticated-layout.tsx.stub +42 -0
  162. package/stubs/themes/corporate/react/src/pages/Dashboard.tsx.stub +310 -0
  163. package/stubs/themes/corporate/react/src/pages/Login.tsx.stub +122 -0
  164. package/stubs/themes/corporate/react/src/pages/Register.tsx.stub +144 -0
  165. package/stubs/themes/corporate/react/src/style.css.stub +135 -0
  166. package/stubs/themes/corporate/svelte/src/pages/Dashboard.svelte.stub +271 -0
  167. package/stubs/themes/corporate/svelte/src/pages/Login.svelte.stub +117 -0
  168. package/stubs/themes/corporate/svelte/src/pages/Register.svelte.stub +138 -0
  169. package/stubs/themes/corporate/svelte/src/style.css.stub +134 -0
  170. package/stubs/themes/corporate/vue/src/pages/Dashboard.vue.stub +325 -0
  171. package/stubs/themes/corporate/vue/src/pages/Login.vue.stub +118 -0
  172. package/stubs/themes/corporate/vue/src/pages/Register.vue.stub +139 -0
  173. package/stubs/themes/corporate/vue/src/style.css.stub +134 -0
  174. package/stubs/themes/minimal/react/src/components/layout/app-sidebar.tsx.stub +68 -0
  175. package/stubs/themes/minimal/react/src/components/layout/authenticated-layout.tsx.stub +42 -0
  176. package/stubs/themes/minimal/react/src/pages/Dashboard.tsx.stub +166 -0
  177. package/stubs/themes/minimal/react/src/pages/Login.tsx.stub +95 -0
  178. package/stubs/themes/minimal/react/src/pages/Register.tsx.stub +73 -0
  179. package/stubs/themes/minimal/react/src/style.css.stub +142 -0
  180. package/stubs/themes/minimal/svelte/src/pages/Dashboard.svelte.stub +149 -0
  181. package/stubs/themes/minimal/svelte/src/pages/Login.svelte.stub +90 -0
  182. package/stubs/themes/minimal/svelte/src/pages/Register.svelte.stub +70 -0
  183. package/stubs/themes/minimal/svelte/src/style.css.stub +142 -0
  184. package/stubs/themes/minimal/vue/src/pages/Dashboard.vue.stub +163 -0
  185. package/stubs/themes/minimal/vue/src/pages/Login.vue.stub +91 -0
  186. package/stubs/themes/minimal/vue/src/pages/Register.vue.stub +73 -0
  187. package/stubs/themes/minimal/vue/src/style.css.stub +142 -0
  188. package/stubs/themes/starter/react/src/components/layout/app-sidebar.tsx.stub +74 -0
  189. package/stubs/themes/starter/react/src/components/layout/authenticated-layout.tsx.stub +42 -0
  190. package/stubs/themes/starter/react/src/pages/Dashboard.tsx.stub +236 -0
  191. package/stubs/themes/starter/react/src/pages/Login.tsx.stub +131 -0
  192. package/stubs/themes/starter/react/src/pages/Register.tsx.stub +145 -0
  193. package/stubs/themes/starter/react/src/style.css.stub +141 -0
  194. package/stubs/themes/starter/svelte/src/pages/Dashboard.svelte.stub +212 -0
  195. package/stubs/themes/starter/svelte/src/pages/Login.svelte.stub +126 -0
  196. package/stubs/themes/starter/svelte/src/pages/Register.svelte.stub +139 -0
  197. package/stubs/themes/starter/svelte/src/style.css.stub +141 -0
  198. package/stubs/themes/starter/vue/src/pages/Dashboard.vue.stub +228 -0
  199. package/stubs/themes/starter/vue/src/pages/Login.vue.stub +127 -0
  200. package/stubs/themes/starter/vue/src/pages/Register.vue.stub +140 -0
  201. package/stubs/themes/starter/vue/src/style.css.stub +141 -0
  202. package/stubs/themes/workspace/react/src/components/layout/app-sidebar.tsx.stub +97 -0
  203. package/stubs/themes/workspace/react/src/components/layout/authenticated-layout.tsx.stub +42 -0
  204. package/stubs/themes/workspace/react/src/pages/Dashboard.tsx.stub +304 -0
  205. package/stubs/themes/workspace/react/src/pages/Login.tsx.stub +131 -0
  206. package/stubs/themes/workspace/react/src/pages/Register.tsx.stub +82 -0
  207. package/stubs/themes/workspace/react/src/style.css.stub +138 -0
  208. package/stubs/themes/workspace/svelte/src/pages/Dashboard.svelte.stub +215 -0
  209. package/stubs/themes/workspace/svelte/src/pages/Login.svelte.stub +124 -0
  210. package/stubs/themes/workspace/svelte/src/pages/Register.svelte.stub +76 -0
  211. package/stubs/themes/workspace/svelte/src/style.css.stub +134 -0
  212. package/stubs/themes/workspace/vue/src/pages/Dashboard.vue.stub +220 -0
  213. package/stubs/themes/workspace/vue/src/pages/Login.vue.stub +128 -0
  214. package/stubs/themes/workspace/vue/src/pages/Register.vue.stub +80 -0
  215. package/stubs/themes/workspace/vue/src/style.css.stub +134 -0
  216. package/stubs/vue/src/App.vue.stub +2 -1
  217. package/stubs/vue/src/lib/api.ts.stub +30 -6
  218. package/stubs/vue/src/main.ts.stub +3 -1
  219. package/stubs/vue/src/pages/Login.vue.stub +3 -3
  220. package/stubs/vue/vite.config.ts.stub +20 -1
@@ -0,0 +1,77 @@
1
+ import { env } from '@mantiq/core'
2
+
3
+ export default {
4
+
5
+ /*
6
+ |--------------------------------------------------------------------------
7
+ | Allowed Origins
8
+ |--------------------------------------------------------------------------
9
+ |
10
+ | The origin(s) that are allowed to make cross-origin requests. Defaults
11
+ | to the APP_URL for same-origin SPA requests. Use '*' for public APIs,
12
+ | or an array for multiple specific origins.
13
+ |
14
+ */
15
+ origin: env('CORS_ORIGIN', env('APP_URL', 'http://localhost:3000')),
16
+
17
+ /*
18
+ |--------------------------------------------------------------------------
19
+ | Allowed HTTP Methods
20
+ |--------------------------------------------------------------------------
21
+ |
22
+ | The HTTP methods that are allowed in CORS requests.
23
+ |
24
+ */
25
+ methods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'],
26
+
27
+ /*
28
+ |--------------------------------------------------------------------------
29
+ | Allowed Headers
30
+ |--------------------------------------------------------------------------
31
+ |
32
+ | The HTTP headers that the client is allowed to send in CORS requests.
33
+ | X-XSRF-TOKEN is required for CSRF protection in SPA applications.
34
+ |
35
+ */
36
+ allowedHeaders: [
37
+ 'Content-Type',
38
+ 'Authorization',
39
+ 'X-Requested-With',
40
+ 'X-CSRF-TOKEN',
41
+ 'X-XSRF-TOKEN',
42
+ 'X-Mantiq',
43
+ ],
44
+
45
+ /*
46
+ |--------------------------------------------------------------------------
47
+ | Exposed Headers
48
+ |--------------------------------------------------------------------------
49
+ |
50
+ | Headers that the browser is allowed to read from the response.
51
+ |
52
+ */
53
+ exposedHeaders: ['X-Heartbeat'],
54
+
55
+ /*
56
+ |--------------------------------------------------------------------------
57
+ | Credentials
58
+ |--------------------------------------------------------------------------
59
+ |
60
+ | Whether to include credentials (cookies, Authorization header) in
61
+ | cross-origin requests. Must be true for session-based SPA auth.
62
+ | When true, origin cannot be '*'.
63
+ |
64
+ */
65
+ credentials: true,
66
+
67
+ /*
68
+ |--------------------------------------------------------------------------
69
+ | Preflight Max Age
70
+ |--------------------------------------------------------------------------
71
+ |
72
+ | How long (in seconds) the browser should cache the preflight response.
73
+ | Reduces the number of OPTIONS requests for repeated CORS calls.
74
+ |
75
+ */
76
+ maxAge: 7200,
77
+ }
@@ -0,0 +1,120 @@
1
+ import { env } from '@mantiq/core'
2
+
3
+ export default {
4
+
5
+ /*
6
+ |--------------------------------------------------------------------------
7
+ | Default Database Connection
8
+ |--------------------------------------------------------------------------
9
+ |
10
+ | The database connection used by default for all database operations.
11
+ | This corresponds to one of the connections defined below. You can
12
+ | switch connections at runtime with db().connection('name').
13
+ |
14
+ */
15
+ default: env('DB_CONNECTION', 'sqlite'),
16
+
17
+ /*
18
+ |--------------------------------------------------------------------------
19
+ | Database Connections
20
+ |--------------------------------------------------------------------------
21
+ |
22
+ | Here are each of the database connections set up for your application.
23
+ | SQLite is pre-configured and requires no external services. Add
24
+ | additional connections for PostgreSQL, MySQL, MSSQL, or MongoDB.
25
+ |
26
+ | Supported drivers: 'sqlite', 'postgres', 'mysql', 'mssql', 'mongodb'
27
+ |
28
+ */
29
+ connections: {
30
+ sqlite: {
31
+ driver: 'sqlite' as const,
32
+ // ':memory:' for in-memory, or a file path
33
+ database: env('DB_DATABASE', import.meta.dir + '/../database/database.sqlite'),
34
+ },
35
+
36
+ // postgres: {
37
+ // driver: 'postgres' as const,
38
+ // host: env('DB_HOST', '127.0.0.1'),
39
+ // port: Number(env('DB_PORT', '5432')),
40
+ // database: env('DB_DATABASE', 'mantiq'),
41
+ // user: env('DB_USERNAME', 'postgres'),
42
+ // password: env('DB_PASSWORD', ''),
43
+ // ssl: env('DB_SSL', 'false') === 'true',
44
+ // pool: {
45
+ // min: Number(env('DB_POOL_MIN', '2')),
46
+ // max: Number(env('DB_POOL_MAX', '10')),
47
+ // },
48
+ // // Read/write splitting — route reads to replicas
49
+ // // read: {
50
+ // // host: [env('DB_READ_HOST_1', '127.0.0.1'), env('DB_READ_HOST_2', '127.0.0.1')],
51
+ // // },
52
+ // // write: {
53
+ // // host: env('DB_WRITE_HOST', '127.0.0.1'),
54
+ // // },
55
+ // },
56
+
57
+ // mysql: {
58
+ // driver: 'mysql' as const,
59
+ // host: env('DB_HOST', '127.0.0.1'),
60
+ // port: Number(env('DB_PORT', '3306')),
61
+ // database: env('DB_DATABASE', 'mantiq'),
62
+ // user: env('DB_USERNAME', 'root'),
63
+ // password: env('DB_PASSWORD', ''),
64
+ // pool: {
65
+ // min: Number(env('DB_POOL_MIN', '2')),
66
+ // max: Number(env('DB_POOL_MAX', '10')),
67
+ // },
68
+ // // Read/write splitting — route reads to replicas
69
+ // // read: {
70
+ // // host: [env('DB_READ_HOST_1', '127.0.0.1'), env('DB_READ_HOST_2', '127.0.0.1')],
71
+ // // },
72
+ // // write: {
73
+ // // host: env('DB_WRITE_HOST', '127.0.0.1'),
74
+ // // },
75
+ // },
76
+
77
+ // mariadb: {
78
+ // driver: 'mysql' as const, // MariaDB uses the MySQL driver
79
+ // host: env('DB_HOST', '127.0.0.1'),
80
+ // port: Number(env('DB_PORT', '3306')),
81
+ // database: env('DB_DATABASE', 'mantiq'),
82
+ // user: env('DB_USERNAME', 'root'),
83
+ // password: env('DB_PASSWORD', ''),
84
+ // pool: {
85
+ // min: Number(env('DB_POOL_MIN', '2')),
86
+ // max: Number(env('DB_POOL_MAX', '10')),
87
+ // },
88
+ // // read: { host: [env('DB_READ_HOST_1', '127.0.0.1')] },
89
+ // // write: { host: env('DB_WRITE_HOST', '127.0.0.1') },
90
+ // },
91
+
92
+ // mssql: {
93
+ // driver: 'mssql' as const,
94
+ // host: env('DB_HOST', '127.0.0.1'),
95
+ // port: Number(env('DB_PORT', '1433')),
96
+ // database: env('DB_DATABASE', 'mantiq'),
97
+ // user: env('DB_USERNAME', 'sa'),
98
+ // password: env('DB_PASSWORD', ''),
99
+ // encrypt: env('DB_ENCRYPT', 'true') === 'true',
100
+ // trustServerCertificate: env('DB_TRUST_CERT', 'false') === 'true',
101
+ // pool: {
102
+ // min: Number(env('DB_POOL_MIN', '2')),
103
+ // max: Number(env('DB_POOL_MAX', '10')),
104
+ // },
105
+ // // read: { host: [env('DB_READ_HOST_1', '127.0.0.1')] },
106
+ // // write: { host: env('DB_WRITE_HOST', '127.0.0.1') },
107
+ // },
108
+
109
+ // mongodb: {
110
+ // driver: 'mongodb' as const,
111
+ // uri: env('MONGODB_URL', 'mongodb://127.0.0.1:27017'),
112
+ // database: env('DB_DATABASE', 'mantiq'),
113
+ // options: {
114
+ // // Any MongoClient options: retryWrites, w, etc.
115
+ // },
116
+ // // Read preference for replicas
117
+ // // readPreference: 'secondaryPreferred',
118
+ // },
119
+ },
120
+ }
@@ -0,0 +1,58 @@
1
+ import { env } from '@mantiq/core'
2
+
3
+ export default {
4
+
5
+ /*
6
+ |--------------------------------------------------------------------------
7
+ | Default Filesystem Disk
8
+ |--------------------------------------------------------------------------
9
+ |
10
+ | The default filesystem disk used by the storage() helper and all
11
+ | file operations. You may use any of the disks defined below.
12
+ |
13
+ */
14
+ default: env('FILESYSTEM_DISK', 'local'),
15
+
16
+ /*
17
+ |--------------------------------------------------------------------------
18
+ | Filesystem Disks
19
+ |--------------------------------------------------------------------------
20
+ |
21
+ | Here you may configure as many filesystem "disks" as you wish. Each
22
+ | disk represents a particular storage driver and location.
23
+ |
24
+ | Supported drivers: 'local', 's3', 'gcs', 'r2', 'azure', 'ftp', 'sftp'
25
+ |
26
+ */
27
+ disks: {
28
+ // Private storage — not web-accessible (uploads, temp files, exports)
29
+ local: {
30
+ driver: 'local' as const,
31
+ root: import.meta.dir + '/../storage/app',
32
+ },
33
+
34
+ // Public storage — web-accessible via /storage URL
35
+ // Run: bun mantiq storage:link
36
+ public: {
37
+ driver: 'local' as const,
38
+ root: import.meta.dir + '/../storage/app/public',
39
+ visibility: 'public' as const,
40
+ },
41
+
42
+ // s3: {
43
+ // driver: 's3' as const,
44
+ // bucket: env('AWS_BUCKET', ''),
45
+ // region: env('AWS_REGION', 'us-east-1'),
46
+ // accessKeyId: env('AWS_ACCESS_KEY_ID', ''),
47
+ // secretAccessKey: env('AWS_SECRET_ACCESS_KEY', ''),
48
+ // },
49
+
50
+ // r2: {
51
+ // driver: 'r2' as const,
52
+ // accountId: env('CLOUDFLARE_ACCOUNT_ID', ''),
53
+ // bucket: env('R2_BUCKET', ''),
54
+ // accessKeyId: env('R2_ACCESS_KEY_ID', ''),
55
+ // secretAccessKey: env('R2_SECRET_ACCESS_KEY', ''),
56
+ // },
57
+ },
58
+ }
@@ -0,0 +1,47 @@
1
+ import { env } from '@mantiq/core'
2
+
3
+ export default {
4
+
5
+ /*
6
+ |--------------------------------------------------------------------------
7
+ | Default Hash Driver
8
+ |--------------------------------------------------------------------------
9
+ |
10
+ | This option controls the default hash driver used for hashing
11
+ | passwords and other values. Bcrypt is the recommended default.
12
+ |
13
+ | Supported: 'bcrypt', 'argon2'
14
+ |
15
+ */
16
+ driver: env('HASH_DRIVER', 'bcrypt'),
17
+
18
+ /*
19
+ |--------------------------------------------------------------------------
20
+ | Bcrypt Options
21
+ |--------------------------------------------------------------------------
22
+ |
23
+ | Here you may configure the round count used by the Bcrypt hashing
24
+ | algorithm. Higher rounds increase security but also increase the
25
+ | time required to hash a value (10-12 recommended).
26
+ |
27
+ */
28
+ bcrypt: {
29
+ rounds: Number(env('BCRYPT_ROUNDS', '10')),
30
+ },
31
+
32
+ /*
33
+ |--------------------------------------------------------------------------
34
+ | Argon2 Options
35
+ |--------------------------------------------------------------------------
36
+ |
37
+ | Here you may configure the memory cost, time cost, and parallelism
38
+ | used by the Argon2 hashing algorithm. These values control the
39
+ | difficulty of producing a valid hash.
40
+ |
41
+ */
42
+ argon2: {
43
+ memory: 65536, // Memory cost in KiB (64 MB)
44
+ time: 4, // Number of iterations
45
+ parallelism: 1, // Degree of parallelism
46
+ },
47
+ }
@@ -0,0 +1,112 @@
1
+ export default {
2
+
3
+ /*
4
+ |--------------------------------------------------------------------------
5
+ | Heartbeat Enabled
6
+ |--------------------------------------------------------------------------
7
+ |
8
+ | Master switch for the APM & observability system. When disabled, no
9
+ | telemetry is recorded and the dashboard is inaccessible.
10
+ |
11
+ */
12
+ enabled: true,
13
+
14
+ /*
15
+ |--------------------------------------------------------------------------
16
+ | Telemetry Storage
17
+ |--------------------------------------------------------------------------
18
+ |
19
+ | Where Heartbeat stores request traces, queries, exceptions, and other
20
+ | telemetry data. SQLite is zero-config. Retention controls how long
21
+ | entries are kept before automatic pruning.
22
+ |
23
+ */
24
+ storage: {
25
+ driver: 'sqlite' as const,
26
+ path: 'storage/heartbeat/heartbeat.sqlite',
27
+ retention: 86400, // Seconds to keep entries (86400 = 24 hours)
28
+ pruneInterval: 300, // Seconds between prune runs (300 = 5 minutes)
29
+ },
30
+
31
+ /*
32
+ |--------------------------------------------------------------------------
33
+ | Queue Configuration
34
+ |--------------------------------------------------------------------------
35
+ |
36
+ | Controls how telemetry data is flushed to storage. Use 'sync' for
37
+ | immediate writes (simpler) or a queue connection for async (faster).
38
+ |
39
+ */
40
+ queue: {
41
+ connection: 'sync',
42
+ queue: 'heartbeat',
43
+ batchSize: 50, // Entries to flush per batch
44
+ flushInterval: 1000, // Milliseconds between flushes
45
+ },
46
+
47
+ /*
48
+ |--------------------------------------------------------------------------
49
+ | Watchers
50
+ |--------------------------------------------------------------------------
51
+ |
52
+ | Each watcher monitors a specific aspect of your application. Disable
53
+ | individual watchers to reduce telemetry volume or ignore specific
54
+ | classes/routes via the ignore arrays.
55
+ |
56
+ */
57
+ watchers: {
58
+ request: { enabled: true, slow_threshold: 1000, ignore: [] }, // ms
59
+ query: { enabled: true, slow_threshold: 100, detect_n_plus_one: true }, // ms
60
+ exception: { enabled: true, ignore: [] },
61
+ cache: { enabled: true },
62
+ job: { enabled: true },
63
+ event: { enabled: true, ignore: [] },
64
+ model: { enabled: true },
65
+ log: { enabled: true, level: 'debug' },
66
+ schedule: { enabled: true },
67
+ },
68
+
69
+ /*
70
+ |--------------------------------------------------------------------------
71
+ | Distributed Tracing
72
+ |--------------------------------------------------------------------------
73
+ |
74
+ | When enabled, Heartbeat generates trace IDs and propagates them across
75
+ | service boundaries via HTTP headers for end-to-end request tracking.
76
+ |
77
+ */
78
+ tracing: {
79
+ enabled: true,
80
+ propagate: true,
81
+ },
82
+
83
+ /*
84
+ |--------------------------------------------------------------------------
85
+ | Sampling
86
+ |--------------------------------------------------------------------------
87
+ |
88
+ | In high-traffic environments, record only a fraction of requests to
89
+ | reduce storage and performance overhead. Errors are always recorded
90
+ | regardless of the sampling rate.
91
+ |
92
+ */
93
+ sampling: {
94
+ rate: 1.0, // 1.0 = 100%, 0.1 = 10%
95
+ always_sample_errors: true,
96
+ },
97
+
98
+ /*
99
+ |--------------------------------------------------------------------------
100
+ | Dashboard
101
+ |--------------------------------------------------------------------------
102
+ |
103
+ | The built-in web dashboard for viewing recorded telemetry. Protect it
104
+ | with middleware in production (e.g., ['auth'] to require login).
105
+ |
106
+ */
107
+ dashboard: {
108
+ enabled: true,
109
+ path: '/_heartbeat',
110
+ middleware: [],
111
+ },
112
+ }
@@ -0,0 +1,58 @@
1
+ import { env } from '@mantiq/core'
2
+
3
+ export default {
4
+
5
+ /*
6
+ |--------------------------------------------------------------------------
7
+ | Default Log Channel
8
+ |--------------------------------------------------------------------------
9
+ |
10
+ | This option defines the default log channel that gets used when writing
11
+ | messages to the logs. The "stack" channel sends to multiple channels
12
+ | simultaneously (e.g., console + daily file).
13
+ |
14
+ */
15
+ default: env('LOG_CHANNEL', 'stack'),
16
+
17
+ /*
18
+ |--------------------------------------------------------------------------
19
+ | Log Channels
20
+ |--------------------------------------------------------------------------
21
+ |
22
+ | Here you may configure the log channels for your application. Each
23
+ | channel represents a specific destination for log messages.
24
+ |
25
+ | Supported drivers: 'stack', 'console', 'file', 'daily'
26
+ | Log levels: 'emergency', 'alert', 'critical', 'error',
27
+ | 'warning', 'notice', 'info', 'debug'
28
+ |
29
+ */
30
+ channels: {
31
+ // Sends messages to multiple channels at once
32
+ stack: {
33
+ driver: 'stack' as const,
34
+ channels: ['console', 'daily'],
35
+ },
36
+
37
+ // Writes to stdout — ideal for development and container deployments
38
+ console: {
39
+ driver: 'console' as const,
40
+ level: 'debug' as const,
41
+ },
42
+
43
+ // Rotates log files daily — automatically cleans up old files
44
+ daily: {
45
+ driver: 'daily' as const,
46
+ path: 'storage/logs/mantiq.log',
47
+ level: 'debug' as const,
48
+ days: 14, // Number of days to retain
49
+ },
50
+
51
+ // Single log file — no rotation
52
+ file: {
53
+ driver: 'file' as const,
54
+ path: 'storage/logs/mantiq.log',
55
+ level: 'debug' as const,
56
+ },
57
+ },
58
+ }
@@ -0,0 +1,93 @@
1
+ import { env } from '@mantiq/core'
2
+
3
+ export default {
4
+
5
+ /*
6
+ |--------------------------------------------------------------------------
7
+ | Default Mailer
8
+ |--------------------------------------------------------------------------
9
+ |
10
+ | This option controls the default mailer used to send emails. The "log"
11
+ | mailer writes email content to your log file — safe for development.
12
+ |
13
+ | Supported: 'smtp', 'resend', 'sendgrid', 'mailgun', 'postmark',
14
+ | 'ses', 'log', 'array'
15
+ |
16
+ */
17
+ default: env('MAIL_MAILER', 'log'),
18
+
19
+ /*
20
+ |--------------------------------------------------------------------------
21
+ | Global "From" Address
22
+ |--------------------------------------------------------------------------
23
+ |
24
+ | The default sender address used when a mailable doesn't specify its own.
25
+ | All emails sent by your application will use this address unless
26
+ | explicitly overridden.
27
+ |
28
+ */
29
+ from: {
30
+ address: env('MAIL_FROM_ADDRESS', 'hello@example.com'),
31
+ name: env('MAIL_FROM_NAME', 'MantiqJS'),
32
+ },
33
+
34
+ /*
35
+ |--------------------------------------------------------------------------
36
+ | Mailer Configurations
37
+ |--------------------------------------------------------------------------
38
+ |
39
+ | Here you may configure all of the mailers used by your application.
40
+ | Each mailer uses a specific transport driver and credentials.
41
+ |
42
+ */
43
+ mailers: {
44
+ // Standard SMTP — works with any SMTP server (Mailtrap, Gmail, etc.)
45
+ smtp: {
46
+ driver: 'smtp' as const,
47
+ host: env('MAIL_HOST', 'localhost'),
48
+ port: Number(env('MAIL_PORT', '587')),
49
+ username: env('MAIL_USERNAME', ''),
50
+ password: env('MAIL_PASSWORD', ''),
51
+ encryption: env('MAIL_ENCRYPTION', 'starttls') as 'tls' | 'starttls' | 'none',
52
+ },
53
+
54
+ // Resend — modern email API (https://resend.com)
55
+ resend: {
56
+ driver: 'resend' as const,
57
+ apiKey: env('RESEND_API_KEY', ''),
58
+ },
59
+
60
+ // SendGrid (https://sendgrid.com)
61
+ sendgrid: {
62
+ driver: 'sendgrid' as const,
63
+ apiKey: env('SENDGRID_API_KEY', ''),
64
+ },
65
+
66
+ // Mailgun (https://mailgun.com)
67
+ mailgun: {
68
+ driver: 'mailgun' as const,
69
+ apiKey: env('MAILGUN_API_KEY', ''),
70
+ domain: env('MAILGUN_DOMAIN', ''),
71
+ },
72
+
73
+ // Postmark (https://postmarkapp.com)
74
+ postmark: {
75
+ driver: 'postmark' as const,
76
+ serverToken: env('POSTMARK_TOKEN', ''),
77
+ },
78
+
79
+ // Amazon SES
80
+ ses: {
81
+ driver: 'ses' as const,
82
+ region: env('AWS_REGION', 'us-east-1'),
83
+ accessKeyId: env('AWS_ACCESS_KEY_ID', ''),
84
+ secretAccessKey: env('AWS_SECRET_ACCESS_KEY', ''),
85
+ },
86
+
87
+ // Writes email content to log file (development)
88
+ log: { driver: 'log' as const },
89
+
90
+ // Stores emails in memory (unit testing)
91
+ array: { driver: 'array' as const },
92
+ },
93
+ }