@awes-io/vue-mc 0.9.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,39 +1,90 @@
1
- # Awes.io Models and Collections Abstract Layer
1
+ # AwesCode UI Models and Collections Abstract Layer
2
2
 
3
3
  Based on [VueMC](https://vuemc.io/)
4
4
 
5
- ## Basic usage
5
+ ## Installation
6
6
 
7
- 1. Ensure you are using [@nuxtjs/axios](https://axios.nuxtjs.org/) in your project
8
- 2. Install the module `yarn add @awes-io/vue-mc`
9
- 3. Now you are ready to build models and collections
10
- 4. Import your `BaseModel` and `BaseCollection` from this package
7
+ ```bash
8
+ yarn add @awes-io/vue-mc
9
+ ```
10
+
11
+ **Requirements:**
12
+ - [@nuxtjs/axios](https://axios.nuxtjs.org/) must be installed in your project
13
+
14
+ ## Quick Start
11
15
 
12
16
  ```javascript
13
17
  import { BaseModel, BaseCollection } from '@awes-io/vue-mc'
14
18
 
19
+ // Define a Model
15
20
  class Todo extends BaseModel {
16
21
  defaults() {
17
22
  return {
18
23
  id: null,
19
- done: true
24
+ title: '',
25
+ done: false
26
+ }
27
+ }
28
+
29
+ routes() {
30
+ return {
31
+ fetch: '/api/todos/{id}',
32
+ save: '/api/todos',
33
+ delete: '/api/todos/{id}'
20
34
  }
21
35
  }
22
36
  }
23
37
 
38
+ // Define a Collection
24
39
  class Todos extends BaseCollection {
25
40
  model() {
26
41
  return Todo
27
42
  }
43
+
44
+ routes() {
45
+ return {
46
+ fetch: '/api/todos'
47
+ }
48
+ }
28
49
  }
29
50
 
30
- export default Todos
51
+ // Usage
52
+ const todos = new Todos()
53
+ await todos.fetch()
31
54
  ```
32
55
 
33
- ## Build before release a new version
56
+ ## Documentation
57
+
58
+ **Comprehensive documentation is available in the [/docs](./docs/) folder:**
59
+
60
+ - **[Getting Started](./docs/index.md)** - Overview and quick start
61
+ - **[Models Guide](./docs/models.md)** - Define and use models
62
+ - **[Collections Guide](./docs/collections.md)** - Manage arrays of models
63
+ - **[Request/Response](./docs/request-response.md)** - HTTP request handling
64
+ - **[Validation](./docs/validation.md)** - Client and server validation
65
+ - **[API Reference](./docs/api-reference.md)** - Complete API documentation
66
+
67
+ ## Key Features
68
+
69
+ - **Models**: Represent individual entities with attributes, validation, and persistence
70
+ - **Collections**: Manage arrays of models with pagination and filtering
71
+ - **Axios Integration**: Built-in HTTP request/response handling via @nuxtjs/axios
72
+ - **Validation**: Client-side and server-side validation support
73
+ - **Reactive**: Fully reactive with Vue.js
74
+ - **Lifecycle Hooks**: Boot, create, fetch, save, delete events
75
+
76
+ ## Development
77
+
78
+ ### Build before release
34
79
 
35
80
  ```bash
36
81
  $ yarn build
37
82
  ```
38
83
 
39
84
  Ensure to write proper commit message according to [Git Commit convention](https://www.conventionalcommits.org/)
85
+
86
+ ## External Resources
87
+
88
+ - [VueMC Official Documentation](https://vuemc.io/)
89
+ - [@nuxtjs/axios Documentation](https://axios.nuxtjs.org/)
90
+ - [AwesCode UI Components](../ui/)