json config files
- Dominant language
- JavaScript
- Stars
- 9
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
At the moment it seems that we need three config files:
- type.json define the types used in the plugin
```
["string", "integer", "email", "password",...]
```
These types are mapped to their html rendering tags
This file is private and only used by the abase plugin itself so it should be defined inside the plugin
- user-schema.json, define all the fields of the user stucture
```
{
"email": {"type": "email"},
"password": {"type": "password"},
"username": {"type": "string"},
...
}
```
This file is public and should be accessible by the user of the abase plugin like this she can add/remove fields of the user schema.
- page.json, define the pages and specifically which fields are displayed on a specific page
```
{
"register": {
"path": "/signup",
"type": "signup",
"method": [
"GET",
"POST"
],
"fields": [
{
"field": "email",
"type": "id",
"attributes": {
"name": "email",
"label": "Email: "
}
},
{
"field": "password",
"type": "password",
"attributes": {
"name": "password",
"label": "Password: "
}
}
]
},
"login": {
"path": "/login",
"type": "login",
"method": [
"GET",
"POST"
],
"fields": [
{
"field": "email",
"type": "id",
"attributes": {
"name": "email",
"label": "Email: "
}
},
{
"field": "password",
"type": "password",
"attributes": {
"name": "password",
"label": "Password: "
}
}
]
},
...
}
```
This file is also public and the user of the plugin can edit it.
So when the plugin is loaded for the first time it should:
- [x] load the user schema config (validate, add default fields email and password)
- [ ] load the pages config (validate, add default pages login, signup, list user, detail user, edit user)
- [ ] initialise the database with if it doesn't exist
- [x] create the routes from the pages config and create the handlers of these routes (imple
@eliascodes @shouston3 @jrans @nelsonic does this sound good for you? If yes I'm going to add the load page config feature (see issue #60 ). This means also that the user will need to pass in the option of the plugin the path of this page config file.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.