dwyl / abase

:house: A (solid) Base for your Web Application.
9 stars 0 forks source link

Preliminary JSON Structure #20

Open jrans opened 7 years ago

jrans commented 7 years ago

Decide on the preliminary JSON structure to instantiate our plugin.

Update: Proposed for now showing off basic features of our plugin:

{  
   "table":"user",
   "fields":{  
      "email":{  
         "type":"string",
         "email":true,
         "required":true
      },
      "username":{  
         "type":"string",
         "min":3,
         "max":20,
         "required":true
      },
      "password":{  
         "type":"string",
         "require":true
      },
      "dob":{  
         "type":"date"
      },
      "gender": {
          "type": "string",
          "values": ["M", "F", "O", "NA"]
      }
   },
   "pages":{  
      "register":{  
         "path":"/signup",
         "edit":true,
         "contents":[  
            "email",
            "username",
            {  
               "field":"password",
               "options":{  
                  "confirmation":true
               }
            }
         ]
      },
      "login":{  
         "edit":true,
         "contents":[  
            "email",
            "password"
         ]
      },
      "deets":{  
         "contents":[  
            "username",
            "name", 
            "gender"
         ]
      }
   }
}
nelsonic commented 7 years ago

@jrans it may be worth saving this as .js so we can include clarifying comments inline ...?

eliasmalik commented 7 years ago

Should have a hash: true field, so we know which cannot be saved as plaintext (h/t @jrans)