Changed file structure to implement the frontend properly and created frontend template
This commit is contained in:
parent
feceab03b1
commit
32c0ffd715
41 changed files with 3784 additions and 0 deletions
21
backend/src/schemas/auth.js
Normal file
21
backend/src/schemas/auth.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
const Ajv = require("ajv");
|
||||
const ajv = new Ajv();
|
||||
|
||||
// --- Schemas ---
|
||||
|
||||
const AuthUserSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
email: { type: 'string', format: 'email' },
|
||||
password: { type: 'string', minLength: 3, maxLength: 30 },
|
||||
},
|
||||
required: ['email', 'password'],
|
||||
additionalProperties: false
|
||||
};
|
||||
|
||||
const validateAuthUserData = ajv.compile(AuthUserSchema);
|
||||
|
||||
|
||||
// --- Exports ---
|
||||
|
||||
module.exports = { validateAuthUserData, validateAuthNodeData };
|
||||
21
backend/src/schemas/mod.js
Normal file
21
backend/src/schemas/mod.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
const Ajv = require("ajv");
|
||||
const ajv = new Ajv();
|
||||
|
||||
// --- Schemas ---
|
||||
//TODO
|
||||
|
||||
const newModSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
name: { type: 'string'},
|
||||
},
|
||||
required: ['name'],
|
||||
additionalProperties: false
|
||||
};
|
||||
|
||||
const validateNewModData = ajv.compile(newModSchema);
|
||||
|
||||
|
||||
// --- Exports ---
|
||||
|
||||
module.exports = { validateNewModData };
|
||||
21
backend/src/schemas/modpack.js
Normal file
21
backend/src/schemas/modpack.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
const Ajv = require("ajv");
|
||||
const ajv = new Ajv();
|
||||
|
||||
// --- Schemas ---
|
||||
//TODO
|
||||
|
||||
const newModpackSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
name: { type: 'string'},
|
||||
},
|
||||
required: ['name'],
|
||||
additionalProperties: false
|
||||
};
|
||||
|
||||
const validateNewModpackData = ajv.compile(newModpackSchema);
|
||||
|
||||
|
||||
// --- Exports ---
|
||||
|
||||
module.exports = { validateNewModpackData };
|
||||
23
backend/src/schemas/user.js
Normal file
23
backend/src/schemas/user.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
const Ajv = require("ajv");
|
||||
const ajv = new Ajv();
|
||||
|
||||
// --- Schemas ---
|
||||
//TODO
|
||||
|
||||
const newUserSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
email: { type: 'string', format: 'email' },
|
||||
name: { type: 'string' },
|
||||
password: { type: 'string', minLength: 3, maxLength: 30 },
|
||||
},
|
||||
required: ['name', 'email', 'password'],
|
||||
additionalProperties: false
|
||||
};
|
||||
|
||||
const validateNewUserData = ajv.compile(newUserSchema);
|
||||
|
||||
|
||||
// --- Exports ---
|
||||
|
||||
module.exports = { validateNewUserData };
|
||||
Loading…
Add table
Add a link
Reference in a new issue