Removed Search-Index and LokiJS, replaced with Mongo + Updated VueJs

This commit is contained in:
NGPixel
2016-10-14 23:31:15 -04:00
parent 99a07d342c
commit 6ea243e8d4
29 changed files with 1002 additions and 819 deletions

54
models/db/entry.js Normal file
View File

@@ -0,0 +1,54 @@
"use strict";
const modb = require('mongoose'),
Promise = require('bluebird'),
_ = require('lodash');
/**
* Entry schema
*
* @type {<Mongoose.Schema>}
*/
var entrySchema = modb.Schema({
_id: String,
title: {
type: String,
required: true,
minlength: 2
},
subtitle: {
type: String,
default: ''
},
parent: {
type: String,
default: ''
},
content: {
type: String,
default: ''
}
},
{
timestamps: {}
});
entrySchema.index({
_id: 'text',
title: 'text',
subtitle: 'text',
content: 'text'
}, {
weights: {
_id: 3,
title: 10,
subtitle: 5,
content: 1
},
name: 'EntriesTextIndex'
});
module.exports = modb.model('Entry', entrySchema);

51
models/db/upl-file.js Normal file
View File

@@ -0,0 +1,51 @@
"use strict";
const modb = require('mongoose'),
Promise = require('bluebird'),
_ = require('lodash');
/**
* Upload File schema
*
* @type {<Mongoose.Schema>}
*/
var uplFileSchema = modb.Schema({
_id: String,
category: {
type: String,
required: true,
default: 'binary'
},
mime: {
type: String,
required: true,
default: 'application/octet-stream'
},
extra: {
type: Object
},
folder: {
type: String,
ref: 'UplFolder'
},
filename: {
type: String,
required: true
},
basename: {
type: String,
required: true
},
filesize: {
type: Number,
required: true
}
},
{
timestamps: {}
});
module.exports = modb.model('UplFile', uplFileSchema);

23
models/db/upl-folder.js Normal file
View File

@@ -0,0 +1,23 @@
"use strict";
const modb = require('mongoose'),
Promise = require('bluebird'),
_ = require('lodash');
/**
* Upload Folder schema
*
* @type {<Mongoose.Schema>}
*/
var uplFolderSchema = modb.Schema({
name: {
type: String
}
},
{
timestamps: {}
});
module.exports = modb.model('UplFolder', uplFolderSchema);

24
models/db/user.js Normal file
View File

@@ -0,0 +1,24 @@
"use strict";
const modb = require('mongoose'),
Promise = require('bluebird'),
_ = require('lodash');
/**
* Region schema
*
* @type {<Mongoose.Schema>}
*/
var userSchema = modb.Schema({
email: {
type: String,
required: true
}
},
{
timestamps: {}
});
module.exports = modb.model('User', userSchema);