odac 1.0.1 → 1.2.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.
Files changed (143) hide show
  1. package/.agent/rules/coding.md +27 -0
  2. package/.agent/rules/memory.md +33 -0
  3. package/.agent/rules/project.md +30 -0
  4. package/.agent/rules/workflow.md +16 -0
  5. package/.github/workflows/auto-pr-description.yml +3 -1
  6. package/.github/workflows/release.yml +42 -1
  7. package/.github/workflows/test-coverage.yml +6 -5
  8. package/.github/workflows/test-publish.yml +36 -0
  9. package/.husky/pre-commit +10 -0
  10. package/.husky/pre-push +13 -0
  11. package/.releaserc.js +3 -3
  12. package/CHANGELOG.md +184 -0
  13. package/README.md +53 -34
  14. package/bin/odac.js +181 -49
  15. package/client/odac.js +878 -995
  16. package/docs/backend/01-overview/03-development-server.md +39 -46
  17. package/docs/backend/02-structure/01-typical-project-layout.md +59 -25
  18. package/docs/backend/03-config/00-configuration-overview.md +15 -6
  19. package/docs/backend/03-config/01-database-connection.md +3 -3
  20. package/docs/backend/03-config/02-static-route-mapping-optional.md +1 -1
  21. package/docs/backend/03-config/03-request-timeout.md +1 -1
  22. package/docs/backend/03-config/04-environment-variables.md +4 -4
  23. package/docs/backend/03-config/05-early-hints.md +2 -2
  24. package/docs/backend/04-routing/02-controller-less-view-routes.md +9 -3
  25. package/docs/backend/04-routing/03-api-and-data-routes.md +18 -0
  26. package/docs/backend/04-routing/07-cron-jobs.md +17 -1
  27. package/docs/backend/04-routing/09-websocket.md +29 -0
  28. package/docs/backend/05-controllers/01-how-to-build-a-controller.md +48 -3
  29. package/docs/backend/05-controllers/02-your-trusty-odac-assistant.md +2 -0
  30. package/docs/backend/05-controllers/03-controller-classes.md +61 -55
  31. package/docs/backend/05-forms/01-custom-forms.md +103 -95
  32. package/docs/backend/05-forms/02-automatic-database-insert.md +21 -21
  33. package/docs/backend/06-request-and-response/01-the-request-object-what-is-the-user-asking-for.md +17 -0
  34. package/docs/backend/07-views/02-rendering-a-view.md +1 -1
  35. package/docs/backend/07-views/03-variables.md +5 -5
  36. package/docs/backend/07-views/04-request-data.md +1 -1
  37. package/docs/backend/07-views/08-backend-javascript.md +1 -1
  38. package/docs/backend/07-views/10-styling-and-tailwind.md +93 -0
  39. package/docs/backend/08-database/01-getting-started.md +100 -0
  40. package/docs/backend/08-database/02-basics.md +136 -0
  41. package/docs/backend/08-database/03-advanced.md +84 -0
  42. package/docs/backend/08-database/04-migrations.md +48 -0
  43. package/docs/backend/09-validation/01-the-validator-service.md +1 -0
  44. package/docs/backend/10-authentication/03-register.md +9 -2
  45. package/docs/backend/10-authentication/04-odac-register-forms.md +48 -48
  46. package/docs/backend/10-authentication/05-session-management.md +16 -2
  47. package/docs/backend/10-authentication/06-odac-login-forms.md +50 -50
  48. package/docs/backend/10-authentication/07-magic-links.md +134 -0
  49. package/docs/backend/11-mail/01-the-mail-service.md +118 -28
  50. package/docs/backend/12-streaming/01-streaming-overview.md +2 -2
  51. package/docs/backend/13-utilities/01-odac-var.md +7 -7
  52. package/docs/backend/13-utilities/02-ipc.md +73 -0
  53. package/docs/frontend/01-overview/01-introduction.md +5 -1
  54. package/docs/frontend/02-ajax-navigation/01-quick-start.md +1 -1
  55. package/docs/index.json +21 -125
  56. package/eslint.config.mjs +5 -47
  57. package/jest.config.js +1 -1
  58. package/package.json +16 -7
  59. package/src/Auth.js +414 -121
  60. package/src/Config.js +12 -7
  61. package/src/Database.js +188 -0
  62. package/src/Env.js +3 -1
  63. package/src/Ipc.js +337 -0
  64. package/src/Lang.js +9 -2
  65. package/src/Mail.js +408 -37
  66. package/src/Odac.js +105 -40
  67. package/src/Request.js +71 -49
  68. package/src/Route/Cron.js +62 -18
  69. package/src/Route/Internal.js +215 -12
  70. package/src/Route/Middleware.js +7 -2
  71. package/src/Route.js +372 -109
  72. package/src/Server.js +118 -12
  73. package/src/Storage.js +169 -0
  74. package/src/Token.js +6 -4
  75. package/src/Validator.js +95 -3
  76. package/src/Var.js +22 -6
  77. package/src/View/EarlyHints.js +43 -33
  78. package/src/View/Form.js +210 -28
  79. package/src/View.js +108 -7
  80. package/src/WebSocket.js +18 -3
  81. package/template/odac.json +5 -0
  82. package/template/package.json +3 -1
  83. package/template/route/www.js +12 -10
  84. package/template/view/content/home.html +3 -3
  85. package/template/view/head/main.html +2 -2
  86. package/test/Client.test.js +168 -0
  87. package/test/Config.test.js +112 -0
  88. package/test/Lang.test.js +92 -0
  89. package/test/Odac.test.js +86 -0
  90. package/test/{framework/middleware.test.js → Route/Middleware.test.js} +2 -2
  91. package/test/{framework/Route.test.js → Route.test.js} +1 -1
  92. package/test/{framework/View → View}/EarlyHints.test.js +1 -1
  93. package/test/{framework/WebSocket.test.js → WebSocket.test.js} +2 -2
  94. package/test/scripts/check-coverage.js +4 -4
  95. package/docs/backend/08-database/01-database-connection.md +0 -99
  96. package/docs/backend/08-database/02-using-mysql.md +0 -322
  97. package/src/Mysql.js +0 -575
  98. package/template/config.json +0 -5
  99. package/test/cli/Cli.test.js +0 -36
  100. package/test/core/Candy.test.js +0 -234
  101. package/test/core/Commands.test.js +0 -538
  102. package/test/core/Config.test.js +0 -1432
  103. package/test/core/Lang.test.js +0 -250
  104. package/test/core/Process.test.js +0 -156
  105. package/test/server/Api.test.js +0 -647
  106. package/test/server/DNS.test.js +0 -2050
  107. package/test/server/DNS.test.js.bak +0 -2084
  108. package/test/server/Hub.test.js +0 -497
  109. package/test/server/Log.test.js +0 -73
  110. package/test/server/Mail.account.test_.js +0 -460
  111. package/test/server/Mail.init.test_.js +0 -411
  112. package/test/server/Mail.test_.js +0 -1340
  113. package/test/server/SSL.test_.js +0 -1491
  114. package/test/server/Server.test.js +0 -765
  115. package/test/server/Service.test_.js +0 -1127
  116. package/test/server/Subdomain.test.js +0 -440
  117. package/test/server/Web/Firewall.test.js +0 -175
  118. package/test/server/Web/Proxy.test.js +0 -397
  119. package/test/server/Web.test.js +0 -1494
  120. package/test/server/__mocks__/acme-client.js +0 -17
  121. package/test/server/__mocks__/bcrypt.js +0 -50
  122. package/test/server/__mocks__/child_process.js +0 -389
  123. package/test/server/__mocks__/crypto.js +0 -432
  124. package/test/server/__mocks__/fs.js +0 -450
  125. package/test/server/__mocks__/globalOdac.js +0 -227
  126. package/test/server/__mocks__/http.js +0 -575
  127. package/test/server/__mocks__/https.js +0 -272
  128. package/test/server/__mocks__/index.js +0 -249
  129. package/test/server/__mocks__/mail/server.js +0 -100
  130. package/test/server/__mocks__/mail/smtp.js +0 -31
  131. package/test/server/__mocks__/mailparser.js +0 -81
  132. package/test/server/__mocks__/net.js +0 -369
  133. package/test/server/__mocks__/node-forge.js +0 -328
  134. package/test/server/__mocks__/os.js +0 -320
  135. package/test/server/__mocks__/path.js +0 -291
  136. package/test/server/__mocks__/selfsigned.js +0 -8
  137. package/test/server/__mocks__/server/src/mail/server.js +0 -100
  138. package/test/server/__mocks__/server/src/mail/smtp.js +0 -31
  139. package/test/server/__mocks__/smtp-server.js +0 -106
  140. package/test/server/__mocks__/sqlite3.js +0 -394
  141. package/test/server/__mocks__/testFactories.js +0 -299
  142. package/test/server/__mocks__/testHelpers.js +0 -363
  143. package/test/server/__mocks__/tls.js +0 -229
@@ -4,7 +4,7 @@ The `<odac:register>` component provides a zero-configuration way to create secu
4
4
 
5
5
  ## Quick Start
6
6
 
7
- ### 1. Configure Database (config.json)
7
+ ### 1. Configure Database (odac.json)
8
8
 
9
9
  ```json
10
10
  {
@@ -23,17 +23,17 @@ That's all you need! The `auth` configuration is optional.
23
23
 
24
24
  ```html
25
25
  <odac:register redirect="/dashboard">
26
- <odac:field name="email" type="email" placeholder="Email" unique>
26
+ <odac:input name="email" type="email" placeholder="Email" unique>
27
27
  <odac:validate rule="required|email" message="Please enter a valid email"/>
28
- </odac:field>
28
+ </odac:input>
29
29
 
30
- <odac:field name="username" type="text" placeholder="Username" unique>
30
+ <odac:input name="username" type="text" placeholder="Username" unique>
31
31
  <odac:validate rule="required|minlen:4" message="Username must be at least 4 characters"/>
32
- </odac:field>
32
+ </odac:input>
33
33
 
34
- <odac:field name="password" type="password" placeholder="Password">
34
+ <odac:input name="password" type="password" placeholder="Password">
35
35
  <odac:validate rule="required|minlen:8" message="Password must be at least 8 characters"/>
36
- </odac:field>
36
+ </odac:input>
37
37
 
38
38
  <odac:submit>Create Account</odac:submit>
39
39
  </odac:register>
@@ -94,12 +94,12 @@ Main form container with configuration options:
94
94
 
95
95
  ## Field Types
96
96
 
97
- ### `<odac:field>`
97
+ ### `<odac:input>`
98
98
 
99
99
  Defines an input field with validation rules:
100
100
 
101
101
  ```html
102
- <odac:field
102
+ <odac:input
103
103
  name="email" <!-- Field name (required) -->
104
104
  type="email" <!-- Input type (default: text) -->
105
105
  placeholder="Email" <!-- Placeholder text -->
@@ -107,7 +107,7 @@ Defines an input field with validation rules:
107
107
  unique> <!-- Check uniqueness in database -->
108
108
 
109
109
  <odac:validate rule="required|email" message="Valid email required"/>
110
- </odac:field>
110
+ </odac:input>
111
111
  ```
112
112
 
113
113
  **Attributes:**
@@ -132,19 +132,19 @@ Use the `skip` attribute for fields that should be validated but not saved to th
132
132
 
133
133
  ```html
134
134
  <!-- Password confirmation - validate but don't save -->
135
- <odac:field name="confirm_password" type="password" placeholder="Confirm Password" skip>
135
+ <odac:input name="confirm_password" type="password" placeholder="Confirm Password" skip>
136
136
  <odac:validate rule="required|same:password" message="Passwords must match"/>
137
- </odac:field>
137
+ </odac:input>
138
138
 
139
139
  <!-- Terms acceptance - validate but don't save -->
140
- <odac:field name="terms" type="checkbox" label="I accept the terms" skip>
140
+ <odac:input name="terms" type="checkbox" label="I accept the terms" skip>
141
141
  <odac:validate rule="accepted" message="You must accept the terms"/>
142
- </odac:field>
142
+ </odac:input>
143
143
 
144
144
  <!-- Captcha verification - validate but don't save -->
145
- <odac:field name="captcha" type="text" placeholder="Enter captcha" skip>
145
+ <odac:input name="captcha" type="text" placeholder="Enter captcha" skip>
146
146
  <odac:validate rule="required" message="Please complete the captcha"/>
147
- </odac:field>
147
+ </odac:input>
148
148
  ```
149
149
 
150
150
  **Common Use Cases:**
@@ -213,24 +213,24 @@ Defines validation rules for a field:
213
213
  You can add multiple `<odac:validate>` tags for different error messages:
214
214
 
215
215
  ```html
216
- <odac:field name="username" type="text" unique>
216
+ <odac:input name="username" type="text" unique>
217
217
  <odac:validate rule="required" message="Username is required"/>
218
218
  <odac:validate rule="minlen:4" message="Username must be at least {min} characters"/>
219
219
  <odac:validate rule="maxlen:20" message="Username cannot exceed {max} characters"/>
220
220
  <odac:validate rule="alphanumeric" message="Username can only contain letters and numbers"/>
221
221
  <odac:validate rule="unique" message="Username '{value}' is already taken"/>
222
- </odac:field>
222
+ </odac:input>
223
223
  ```
224
224
 
225
225
  Or combine rules in a single tag:
226
226
 
227
227
  ```html
228
- <odac:field name="username" type="text" unique>
228
+ <odac:input name="username" type="text" unique>
229
229
  <odac:validate
230
230
  rule="required|minlen:4|maxlen:20|alphanumeric"
231
231
  message="Username must be 4-20 alphanumeric characters"/>
232
232
  <odac:validate rule="unique" message="Username '{value}' is already taken"/>
233
- </odac:field>
233
+ </odac:input>
234
234
  ```
235
235
 
236
236
  ## Message Placeholders
@@ -238,17 +238,17 @@ Or combine rules in a single tag:
238
238
  Use placeholders in error messages for dynamic values:
239
239
 
240
240
  ```html
241
- <odac:field name="username" type="text">
241
+ <odac:input name="username" type="text">
242
242
  <odac:validate
243
243
  rule="minlen:4"
244
244
  message="Username '{value}' is too short. Minimum {min} characters required"/>
245
- </odac:field>
245
+ </odac:input>
246
246
 
247
- <odac:field name="age" type="number">
247
+ <odac:input name="age" type="number">
248
248
  <odac:validate
249
249
  rule="min:18|max:120"
250
250
  message="Age must be between {min} and {max} years"/>
251
- </odac:field>
251
+ </odac:input>
252
252
  ```
253
253
 
254
254
  **Available Placeholders:**
@@ -269,9 +269,9 @@ Set values that are processed only on the backend (not visible in HTML):
269
269
  ```html
270
270
  <odac:register redirect="/dashboard">
271
271
  <!-- User input fields -->
272
- <odac:field name="email" type="email" unique>
272
+ <odac:input name="email" type="email" unique>
273
273
  <odac:validate rule="required|email"/>
274
- </odac:field>
274
+ </odac:input>
275
275
 
276
276
  <!-- Backend-only values -->
277
277
  <odac:set name="role" value="user"/>
@@ -309,9 +309,9 @@ Use `compute` attribute for dynamic values:
309
309
  Use `if-empty` to set a default only if the user didn't provide a value:
310
310
 
311
311
  ```html
312
- <odac:field name="country" type="text" placeholder="Country (optional)">
312
+ <odac:input name="country" type="text" placeholder="Country (optional)">
313
313
  <!-- User can optionally fill this -->
314
- </odac:field>
314
+ </odac:input>
315
315
 
316
316
  <odac:set name="country" value="TR" if-empty/>
317
317
  <!-- If user leaves it empty, set to "TR" -->
@@ -342,51 +342,51 @@ Or use content as button text:
342
342
  <odac:register redirect="/dashboard" autologin="true">
343
343
 
344
344
  <!-- Email Field -->
345
- <odac:field name="email" type="email" placeholder="Email Address" unique>
345
+ <odac:input name="email" type="email" placeholder="Email Address" unique>
346
346
  <odac:validate rule="required" message="Email is required"/>
347
347
  <odac:validate rule="email" message="Please enter a valid email address"/>
348
348
  <odac:validate rule="unique" message="The email '{value}' is already registered"/>
349
- </odac:field>
349
+ </odac:input>
350
350
 
351
351
  <!-- Username Field -->
352
- <odac:field name="username" type="text" placeholder="Username" unique>
352
+ <odac:input name="username" type="text" placeholder="Username" unique>
353
353
  <odac:validate rule="required" message="Username is required"/>
354
354
  <odac:validate rule="minlen:4" message="Username must be at least {min} characters"/>
355
355
  <odac:validate rule="maxlen:20" message="Username cannot exceed {max} characters"/>
356
356
  <odac:validate rule="alphanumeric" message="Only letters and numbers allowed"/>
357
357
  <odac:validate rule="unique" message="Username '{value}' is already taken"/>
358
- </odac:field>
358
+ </odac:input>
359
359
 
360
360
  <!-- Password Field -->
361
- <odac:field name="password" type="password" placeholder="Password">
361
+ <odac:input name="password" type="password" placeholder="Password">
362
362
  <odac:validate rule="required" message="Password is required"/>
363
363
  <odac:validate rule="minlen:8" message="Password must be at least {min} characters"/>
364
- </odac:field>
364
+ </odac:input>
365
365
 
366
366
  <!-- Password Confirmation -->
367
- <odac:field name="password_confirm" type="password" placeholder="Confirm Password" skip>
367
+ <odac:input name="password_confirm" type="password" placeholder="Confirm Password" skip>
368
368
  <odac:validate rule="required" message="Please confirm your password"/>
369
369
  <odac:validate rule="same:password" message="Passwords do not match"/>
370
- </odac:field>
370
+ </odac:input>
371
371
 
372
372
  <!-- Full Name -->
373
- <odac:field name="name" type="text" placeholder="Full Name">
373
+ <odac:input name="name" type="text" placeholder="Full Name">
374
374
  <odac:validate rule="required" message="Name is required"/>
375
375
  <odac:validate rule="alphaspace" message="Name can only contain letters and spaces"/>
376
376
  <odac:validate rule="minlen:3" message="Name must be at least {min} characters"/>
377
- </odac:field>
377
+ </odac:input>
378
378
 
379
379
  <!-- Age -->
380
- <odac:field name="age" type="number" placeholder="Age">
380
+ <odac:input name="age" type="number" placeholder="Age">
381
381
  <odac:validate rule="required" message="Age is required"/>
382
382
  <odac:validate rule="min:18" message="You must be at least {min} years old"/>
383
383
  <odac:validate rule="max:120" message="Please enter a valid age"/>
384
- </odac:field>
384
+ </odac:input>
385
385
 
386
386
  <!-- Terms Checkbox -->
387
- <odac:field name="terms" type="checkbox" label="I agree to the terms and conditions" skip>
387
+ <odac:input name="terms" type="checkbox" label="I agree to the terms and conditions" skip>
388
388
  <odac:validate rule="accepted" message="You must accept the terms to continue"/>
389
- </odac:field>
389
+ </odac:input>
390
390
 
391
391
  <!-- Backend-only values -->
392
392
  <odac:set name="role" value="user"/>
@@ -427,9 +427,9 @@ Each form gets a unique token when rendered:
427
427
  Fields marked with `unique` attribute are checked against the database:
428
428
 
429
429
  ```html
430
- <odac:field name="email" type="email" unique>
430
+ <odac:input name="email" type="email" unique>
431
431
  <odac:validate rule="unique" message="Email already exists"/>
432
- </odac:field>
432
+ </odac:input>
433
433
  ```
434
434
 
435
435
  The system automatically queries the auth table to check for duplicates.
@@ -440,9 +440,9 @@ Odac automatically adds HTML5 validation attributes for better UX:
440
440
 
441
441
  ```html
442
442
  <!-- This field -->
443
- <odac:field name="username" type="text">
443
+ <odac:input name="username" type="text">
444
444
  <odac:validate rule="required|minlen:4|maxlen:20|alphanumeric"/>
445
- </odac:field>
445
+ </odac:input>
446
446
 
447
447
  <!-- Generates this HTML -->
448
448
  <input
@@ -653,14 +653,14 @@ Then handle the response in JavaScript if needed (though not required for basic
653
653
 
654
654
  ### Form Not Submitting
655
655
 
656
- - Check that `config.json` has auth configuration
656
+ - Check that `odac.json` has auth configuration
657
657
  - Verify database table exists
658
658
  - Check browser console for JavaScript errors
659
659
 
660
660
  ### Validation Not Working
661
661
 
662
662
  - Ensure validation rules are spelled correctly
663
- - Check that field names match between `<odac:field>` and validation
663
+ - Check that field names match between `<odac:input>` and validation
664
664
  - Verify HTML5 validation isn't blocking submission
665
665
 
666
666
  ### Unique Check Failing
@@ -31,7 +31,7 @@ Sessions use a **sliding window** approach (similar to NextAuth.js):
31
31
 
32
32
  ### Configuration
33
33
 
34
- Configure session behavior in `config.json`:
34
+ Configure session behavior in `odac.json`:
35
35
 
36
36
  ```json
37
37
  {
@@ -127,9 +127,23 @@ const isLoggedIn = await Odac.Auth.check()
127
127
  **Get user info:**
128
128
  ```javascript
129
129
  const user = Odac.Auth.user(null) // Full user object
130
+ const user = Odac.Auth.user(null) // Full user object
130
131
  const email = Odac.Auth.user('email') // Specific field
131
132
  ```
132
133
 
134
+ ### Custom Session Data
135
+
136
+ If you need to store your own data in the session (e.g. shopping cart ID, preferences), use the `Odac.session()` helper:
137
+
138
+ ```javascript
139
+ // Store data
140
+ Odac.session('theme', 'dark')
141
+
142
+ // Retrieve data
143
+ const theme = Odac.session('theme')
144
+ ```
145
+
146
+
133
147
  ### Best Practices
134
148
 
135
149
  1. **Choose appropriate timeouts** based on your app's security needs
@@ -153,7 +167,7 @@ const email = Odac.Auth.user('email') // Specific field
153
167
  - Manually clean old sessions if needed:
154
168
  ```javascript
155
169
  const cutoffDate = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000)
156
- await Odac.Mysql.table('user_tokens')
170
+ await Odac.DB.user_tokens
157
171
  .where('active', '<', cutoffDate)
158
172
  .delete()
159
173
  ```
@@ -4,7 +4,7 @@ The `<odac:login>` component provides a zero-configuration way to create secure
4
4
 
5
5
  ## Quick Start
6
6
 
7
- ### 1. Configure Database (config.json)
7
+ ### 1. Configure Database (odac.json)
8
8
 
9
9
  ```json
10
10
  {
@@ -23,13 +23,13 @@ That's all you need! The `auth` configuration is optional.
23
23
 
24
24
  ```html
25
25
  <odac:login redirect="/dashboard">
26
- <odac:field name="email" type="email" placeholder="Email">
26
+ <odac:input name="email" type="email" placeholder="Email">
27
27
  <odac:validate rule="required|email" message="Please enter a valid email"/>
28
- </odac:field>
28
+ </odac:input>
29
29
 
30
- <odac:field name="password" type="password" placeholder="Password">
30
+ <odac:input name="password" type="password" placeholder="Password">
31
31
  <odac:validate rule="required" message="Password is required"/>
32
- </odac:field>
32
+ </odac:input>
33
33
 
34
34
  <odac:submit>Login</odac:submit>
35
35
  </odac:login>
@@ -79,12 +79,12 @@ Main form container with configuration options:
79
79
 
80
80
  ## Field Types
81
81
 
82
- ### `<odac:field>`
82
+ ### `<odac:input>`
83
83
 
84
84
  Defines an input field with validation rules:
85
85
 
86
86
  ```html
87
- <odac:field
87
+ <odac:input
88
88
  name="email" <!-- Field name (required) -->
89
89
  type="email" <!-- Input type (default: text) -->
90
90
  placeholder="Email" <!-- Placeholder text -->
@@ -93,7 +93,7 @@ Defines an input field with validation rules:
93
93
  id="email-field"> <!-- HTML ID (optional) -->
94
94
 
95
95
  <odac:validate rule="required|email" message="Valid email required"/>
96
- </odac:field>
96
+ </odac:input>
97
97
  ```
98
98
 
99
99
  **Attributes:**
@@ -153,20 +153,20 @@ Defines validation rules for a field:
153
153
  You can add multiple `<odac:validate>` tags for different error messages:
154
154
 
155
155
  ```html
156
- <odac:field name="email" type="email">
156
+ <odac:input name="email" type="email">
157
157
  <odac:validate rule="required" message="Email is required"/>
158
158
  <odac:validate rule="email" message="Please enter a valid email address"/>
159
- </odac:field>
159
+ </odac:input>
160
160
  ```
161
161
 
162
162
  Or combine rules in a single tag:
163
163
 
164
164
  ```html
165
- <odac:field name="email" type="email">
165
+ <odac:input name="email" type="email">
166
166
  <odac:validate
167
167
  rule="required|email"
168
168
  message="Please enter a valid email address"/>
169
- </odac:field>
169
+ </odac:input>
170
170
  ```
171
171
 
172
172
  ## Message Placeholders
@@ -174,11 +174,11 @@ Or combine rules in a single tag:
174
174
  Use placeholders in error messages for dynamic values:
175
175
 
176
176
  ```html
177
- <odac:field name="username" type="text">
177
+ <odac:input name="username" type="text">
178
178
  <odac:validate
179
179
  rule="minlen:4"
180
180
  message="Username '{value}' is too short. Minimum {min} characters required"/>
181
- </odac:field>
181
+ </odac:input>
182
182
  ```
183
183
 
184
184
  **Available Placeholders:**
@@ -218,15 +218,15 @@ Or use content as button text:
218
218
  <odac:login redirect="/dashboard">
219
219
 
220
220
  <!-- Email Field -->
221
- <odac:field name="email" type="email" placeholder="Email Address">
221
+ <odac:input name="email" type="email" placeholder="Email Address">
222
222
  <odac:validate rule="required" message="Email is required"/>
223
223
  <odac:validate rule="email" message="Please enter a valid email address"/>
224
- </odac:field>
224
+ </odac:input>
225
225
 
226
226
  <!-- Password Field -->
227
- <odac:field name="password" type="password" placeholder="Password">
227
+ <odac:input name="password" type="password" placeholder="Password">
228
228
  <odac:validate rule="required" message="Password is required"/>
229
- </odac:field>
229
+ </odac:input>
230
230
 
231
231
  <!-- Submit Button -->
232
232
  <odac:submit text="Login" loading="Logging in..."/>
@@ -240,15 +240,15 @@ Or use content as button text:
240
240
  <odac:login redirect="/dashboard">
241
241
 
242
242
  <!-- Username Field -->
243
- <odac:field name="username" type="text" placeholder="Username">
243
+ <odac:input name="username" type="text" placeholder="Username">
244
244
  <odac:validate rule="required" message="Username is required"/>
245
245
  <odac:validate rule="minlen:4" message="Username must be at least {min} characters"/>
246
- </odac:field>
246
+ </odac:input>
247
247
 
248
248
  <!-- Password Field -->
249
- <odac:field name="password" type="password" placeholder="Password">
249
+ <odac:input name="password" type="password" placeholder="Password">
250
250
  <odac:validate rule="required" message="Password is required"/>
251
- </odac:field>
251
+ </odac:input>
252
252
 
253
253
  <!-- Submit Button -->
254
254
  <odac:submit>Login</odac:submit>
@@ -262,18 +262,18 @@ Or use content as button text:
262
262
  <odac:login redirect="/dashboard">
263
263
 
264
264
  <!-- Email Field -->
265
- <odac:field name="email" type="email" placeholder="Email">
265
+ <odac:input name="email" type="email" placeholder="Email">
266
266
  <odac:validate rule="required|email" message="Please enter a valid email"/>
267
- </odac:field>
267
+ </odac:input>
268
268
 
269
269
  <!-- Password Field -->
270
- <odac:field name="password" type="password" placeholder="Password">
270
+ <odac:input name="password" type="password" placeholder="Password">
271
271
  <odac:validate rule="required" message="Password is required"/>
272
- </odac:field>
272
+ </odac:input>
273
273
 
274
274
  <!-- Remember Me Checkbox -->
275
- <odac:field name="remember" type="checkbox" label="Remember me">
276
- </odac:field>
275
+ <odac:input name="remember" type="checkbox" label="Remember me">
276
+ </odac:input>
277
277
 
278
278
  <!-- Submit Button -->
279
279
  <odac:submit>Login</odac:submit>
@@ -290,30 +290,30 @@ Or use content as button text:
290
290
  <odac:login redirect="/dashboard">
291
291
 
292
292
  <div class="form-group">
293
- <odac:field
293
+ <odac:input
294
294
  name="email"
295
295
  type="email"
296
296
  placeholder="Email Address"
297
297
  class="form-control">
298
298
  <odac:validate rule="required|email" message="Please enter a valid email"/>
299
- </odac:field>
299
+ </odac:input>
300
300
  <span class="odac-form-error" odac-form-error="email"></span>
301
301
  </div>
302
302
 
303
303
  <div class="form-group">
304
- <odac:field
304
+ <odac:input
305
305
  name="password"
306
306
  type="password"
307
307
  placeholder="Password"
308
308
  class="form-control">
309
309
  <odac:validate rule="required" message="Password is required"/>
310
- </odac:field>
310
+ </odac:input>
311
311
  <span class="odac-form-error" odac-form-error="password"></span>
312
312
  </div>
313
313
 
314
314
  <div class="form-group">
315
- <odac:field name="remember" type="checkbox" label="Remember me" class="form-check-input">
316
- </odac:field>
315
+ <odac:input name="remember" type="checkbox" label="Remember me" class="form-check-input">
316
+ </odac:input>
317
317
  </div>
318
318
 
319
319
  <odac:submit class="btn btn-primary btn-block" text="Login" loading="Logging in..."/>
@@ -356,9 +356,9 @@ Odac automatically adds HTML5 validation attributes for better UX:
356
356
 
357
357
  ```html
358
358
  <!-- This field -->
359
- <odac:field name="email" type="email">
359
+ <odac:input name="email" type="email">
360
360
  <odac:validate rule="required|email"/>
361
- </odac:field>
361
+ </odac:input>
362
362
 
363
363
  <!-- Generates this HTML -->
364
364
  <input
@@ -507,12 +507,12 @@ The login form supports multiple authentication methods:
507
507
 
508
508
  ```html
509
509
  <odac:login redirect="/dashboard">
510
- <odac:field name="email" type="email" placeholder="Email">
510
+ <odac:input name="email" type="email" placeholder="Email">
511
511
  <odac:validate rule="required|email"/>
512
- </odac:field>
513
- <odac:field name="password" type="password" placeholder="Password">
512
+ </odac:input>
513
+ <odac:input name="password" type="password" placeholder="Password">
514
514
  <odac:validate rule="required"/>
515
- </odac:field>
515
+ </odac:input>
516
516
  <odac:submit>Login</odac:submit>
517
517
  </odac:login>
518
518
  ```
@@ -521,12 +521,12 @@ The login form supports multiple authentication methods:
521
521
 
522
522
  ```html
523
523
  <odac:login redirect="/dashboard">
524
- <odac:field name="username" type="text" placeholder="Username">
524
+ <odac:input name="username" type="text" placeholder="Username">
525
525
  <odac:validate rule="required"/>
526
- </odac:field>
527
- <odac:field name="password" type="password" placeholder="Password">
526
+ </odac:input>
527
+ <odac:input name="password" type="password" placeholder="Password">
528
528
  <odac:validate rule="required"/>
529
- </odac:field>
529
+ </odac:input>
530
530
  <odac:submit>Login</odac:submit>
531
531
  </odac:login>
532
532
  ```
@@ -535,12 +535,12 @@ The login form supports multiple authentication methods:
535
535
 
536
536
  ```html
537
537
  <odac:login redirect="/dashboard">
538
- <odac:field name="identifier" type="text" placeholder="Email or Username">
538
+ <odac:input name="identifier" type="text" placeholder="Email or Username">
539
539
  <odac:validate rule="required"/>
540
- </odac:field>
541
- <odac:field name="password" type="password" placeholder="Password">
540
+ </odac:input>
541
+ <odac:input name="password" type="password" placeholder="Password">
542
542
  <odac:validate rule="required"/>
543
- </odac:field>
543
+ </odac:input>
544
544
  <odac:submit>Login</odac:submit>
545
545
  </odac:login>
546
546
  ```
@@ -559,7 +559,7 @@ The login form supports multiple authentication methods:
559
559
 
560
560
  ### Form Not Submitting
561
561
 
562
- - Check that `config.json` has MySQL configuration
562
+ - Check that `odac.json` has MySQL configuration
563
563
  - Verify database table exists
564
564
  - Check browser console for JavaScript errors
565
565
  - Ensure CSRF token is valid
@@ -567,7 +567,7 @@ The login form supports multiple authentication methods:
567
567
  ### Validation Not Working
568
568
 
569
569
  - Ensure validation rules are spelled correctly
570
- - Check that field names match between `<odac:field>` and validation
570
+ - Check that field names match between `<odac:input>` and validation
571
571
  - Verify HTML5 validation isn't blocking submission
572
572
 
573
573
  ### Login Failing