(client/server)

Define the base structure their properties, field’s type and default values, for define documents in the database and new Models instances of Kepler objects.
All core schemas is defined in a simple JSON file schemas.js, in the future it would be used JSON Schema as a standard definition of these structures and validation.
Usually in some Kepler plugins these can be extended adding fields, through the schemas option inside the plugin.js.

  • K.schemas.place:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    place: {
    name: '', //place title
    createdAt: '', //new Date() of place insert
    userId: '', //user to created it
    active:0, //visible in map
    indoor:0, //is an indoor place
    loc: [], //coordinates lat,lng
    checkins: [], //users inside place
    hist: [], //recents checkins
    desc: '', //long description
    warn: '', //description of alerts and dangers
    urls: [], //websites url of place
    emails: [], //contanct emails for place
    source: {}, //describe source of data
    }
  • K.schemas.user:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    user: {
    name: '', //display name
    username: '', //username used in urls
    createdAt: '', //new Date() of user insert
    emails: [], //alla emails of user
    profile: {}, //user data
    avatar: '', //user photo
    mood: '', //status mood message, shown in profile
    loginAt: '', //last date of login
    status: '', //visibility online of user(online,offline,await)
    statusDefault: '',
    statusConnection:'',
    gender: '', //gender of user male,female,others
    city: '', //city to live
    lang: 'it', //language
    loc: null, //current gps position
    loclast: null, //lat gps position
    checkin: null, //id Place where I am
    mob:0, //if my device is mobile
    friends: [], //ids users friends
    usersPending: [], //ids users that I send request
    usersReceive: [], //ids users that I receive request
    usersBlocked: [], //ids users that I blocked
    hist: [], //last places visited
    source: {}, //source of registration by single signon
    settings: { //user settings for platform
    map: {
    layer: null,
    center: null //last center of map
    }
    }
    }
  • custom schemas defined by plugin convers:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    schemas: {
    place: {
    convers: [] //id conversations in a place
    },
    user: {
    convers: [] //id conversations to user publics and direct private messages
    },
    conver: { //definion of customo schema for a conversation
    createdAt: null, //date of creation
    title: '', //Topic for the place wall or subject for the private convers
    targetId: '', //if null is a private users convers
    targetType: '', //type of related Kepler object: user, place, event, pois
    userId: '', //author/sender of conversation
    usersIds: [], //users participants
    lastMsg: null //replicate content of last message in the conversation
    },
    converMsg: { //define single message into a conversation
    updatedAt: '', //last modified date
    convId: '', //parent conversation id
    userId: '', //author user id
    body: '' //text content
    }
    }
  • custom schemas defined by plugin geoinfo:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    schemas: {
    place: {
    geoinfo: {
    loc: [], //location reference
    ele: 0, //elevation from the sea level
    esp: 0, //aspect of the terrain model
    prov: '', //province
    near: '', //locality
    com: '', //municipality
    reg: '', //district
    naz: '', //country
    }
    }
    }
  • custom schemas defined by plugin edit:

    1
    2
    3
    4
    5
    6
    7
    8
    schemas: {
    place: {
    userId: null //user creator of place
    },
    user: {
    places: [] //places created by user
    }
    }
Edit on GitHub
Licensed under Creative Commons