Compare commits
22 Commits
feat/freet
...
master
Author | SHA1 | Date | |
---|---|---|---|
1871f3f96a | |||
05be7c4a26 | |||
|
46c8147172 | ||
271f7cab7d | |||
|
50e105b851 | ||
|
da201720c0 | ||
b3fd86da33 | |||
276ef4033b | |||
|
a520692bc5 | ||
|
a327c9caeb | ||
|
9a8fddee3b | ||
149d668bea | |||
|
5d08c4c1c2 | ||
2356259823 | |||
|
872c921a53 | ||
10b5207f9a | |||
2ede62bcd8 | |||
1788f90cde | |||
a37f7ea8a8 | |||
18b63bed21 | |||
707c3be3ec | |||
359a136dbf |
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@ node_modules/
|
|||||||
.env
|
.env
|
||||||
.idea
|
.idea
|
||||||
coverage/
|
coverage/
|
||||||
|
server/log/
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
FROM node:20
|
FROM node:20
|
||||||
|
|
||||||
RUN mkdir -p /usr/src/app/server/
|
RUN mkdir -p /usr/src/app/server/log/
|
||||||
WORKDIR /usr/src/app/
|
WORKDIR /usr/src/app/
|
||||||
|
|
||||||
COPY ./server /usr/src/app/server
|
COPY ./server /usr/src/app/server
|
||||||
|
@ -2,6 +2,7 @@ version: "3"
|
|||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
ms_volume8:
|
ms_volume8:
|
||||||
|
ms_logs:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mongoDb:
|
mongoDb:
|
||||||
@ -15,6 +16,8 @@ services:
|
|||||||
# build: .
|
# build: .
|
||||||
image: bro.js/ms/bh:$TAG
|
image: bro.js/ms/bh:$TAG
|
||||||
restart: always
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ms_logs:/usr/src/app/server/log
|
||||||
ports:
|
ports:
|
||||||
- 8044:8044
|
- 8044:8044
|
||||||
environment:
|
environment:
|
||||||
|
3078
package-lock.json
generated
3078
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
43
package.json
43
package.json
@ -23,33 +23,34 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"homepage": "https://bitbucket.org/online-mentor/multi-stub#readme",
|
"homepage": "https://bitbucket.org/online-mentor/multi-stub#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.7.7",
|
"axios": "^1.7.9",
|
||||||
"bcrypt": "^5.1.0",
|
"bcrypt": "^5.1.1",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.20.3",
|
||||||
"cookie-parser": "^1.4.5",
|
"cookie-parser": "^1.4.7",
|
||||||
"cors": "^2.8.5",
|
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"crypto-js": "^4.1.1",
|
"crypto-js": "^4.2.0",
|
||||||
"dotenv": "^16.3.1",
|
"dotenv": "^16.4.7",
|
||||||
"express": "^4.18.2",
|
"express": "5.0.1",
|
||||||
"express-jwt": "^8.4.1",
|
"express-jwt": "^8.5.1",
|
||||||
"express-session": "^1.17.3",
|
"express-session": "^1.18.1",
|
||||||
"jsdom": "^22.1.0",
|
"jsdom": "^25.0.1",
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^9.0.2",
|
||||||
"mongodb": "^3.6.8",
|
"mongodb": "^6.12.0",
|
||||||
"mongoose": "^8.7.1",
|
"mongoose": "^8.9.2",
|
||||||
|
"morgan": "^1.10.0",
|
||||||
"pbkdf2-password": "^1.2.1",
|
"pbkdf2-password": "^1.2.1",
|
||||||
"socket.io": "^4.7.1",
|
"rotating-file-stream": "^3.2.5",
|
||||||
"uuid": "^9.0.0"
|
"socket.io": "^4.8.1",
|
||||||
|
"uuid": "^11.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^9.12.0",
|
"@eslint/js": "^9.17.0",
|
||||||
"@types/node": "18.17.1",
|
"@types/node": "22.10.2",
|
||||||
"eslint": "^9.12.0",
|
"eslint": "^9.17.0",
|
||||||
"globals": "^15.11.0",
|
"globals": "^15.14.0",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"mockingoose": "^2.16.2",
|
"mockingoose": "^2.16.2",
|
||||||
"nodemon": "3.0.1",
|
"nodemon": "3.1.9",
|
||||||
"supertest": "^7.0.0"
|
"supertest": "^7.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,6 +6,7 @@ module.exports = (err, req, res, next) => {
|
|||||||
success: false, error: 'Токен авторизации не найден',
|
success: false, error: 'Токен авторизации не найден',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
res.status(400).send({
|
res.status(400).send({
|
||||||
success: false, error: err.message || 'Что-то пошло не так',
|
success: false, error: err.message || 'Что-то пошло не так',
|
||||||
})
|
})
|
||||||
|
106
server/index.js
106
server/index.js
@ -1,55 +1,97 @@
|
|||||||
const express = require('express')
|
const express = require("express")
|
||||||
const bodyParser = require('body-parser')
|
const bodyParser = require("body-parser")
|
||||||
const cookieParser = require('cookie-parser')
|
const cookieParser = require("cookie-parser")
|
||||||
const session = require('express-session')
|
const session = require("express-session")
|
||||||
|
const morgan = require("morgan")
|
||||||
|
const path = require("path")
|
||||||
|
const rfs = require("rotating-file-stream")
|
||||||
|
|
||||||
const app = express()
|
const app = express()
|
||||||
const cors = require('cors')
|
require("dotenv").config()
|
||||||
require('dotenv').config()
|
|
||||||
|
|
||||||
exports.app = app
|
exports.app = app
|
||||||
|
|
||||||
const config = require('../.serverrc')
|
const accessLogStream = rfs.createStream("access.log", {
|
||||||
const { setIo } = require('./io')
|
size: "10M",
|
||||||
|
interval: "1d",
|
||||||
|
compress: "gzip",
|
||||||
|
path: path.join(__dirname, "log"),
|
||||||
|
})
|
||||||
|
|
||||||
|
const errorLogStream = rfs.createStream("error.log", {
|
||||||
|
size: "10M",
|
||||||
|
interval: "1d",
|
||||||
|
compress: "gzip",
|
||||||
|
path: path.join(__dirname, "log"),
|
||||||
|
})
|
||||||
|
|
||||||
|
const config = require("../.serverrc")
|
||||||
|
const { setIo } = require("./io")
|
||||||
|
|
||||||
app.use(cookieParser())
|
app.use(cookieParser())
|
||||||
app.options('*', cors())
|
app.use(
|
||||||
app.use(cors())
|
morgan("combined", {
|
||||||
|
stream: accessLogStream,
|
||||||
|
skip: function (req, res) {
|
||||||
|
return res.statusCode >= 400
|
||||||
|
},
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
// log all requests to access.log
|
||||||
|
app.use(
|
||||||
|
morgan("combined", {
|
||||||
|
stream: errorLogStream,
|
||||||
|
skip: function (req, res) {
|
||||||
|
console.log('statusCode', res.statusCode, res.statusCode <= 400)
|
||||||
|
return res.statusCode < 400
|
||||||
|
},
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
const server = setIo(app)
|
const server = setIo(app)
|
||||||
|
|
||||||
const sess = {
|
const sess = {
|
||||||
secret: 'super-secret-key',
|
secret: "super-secret-key",
|
||||||
resave: true,
|
resave: true,
|
||||||
saveUninitialized: true,
|
saveUninitialized: true,
|
||||||
cookie: {
|
cookie: {},
|
||||||
},
|
|
||||||
}
|
}
|
||||||
if (app.get('env') === 'production') {
|
if (app.get("env") === "production") {
|
||||||
app.set('trust proxy', 1)
|
app.set("trust proxy", 1)
|
||||||
sess.cookie.secure = true
|
sess.cookie.secure = true
|
||||||
}
|
}
|
||||||
app.use(session(sess))
|
app.use(session(sess))
|
||||||
|
|
||||||
app.use(bodyParser.json({
|
app.use(
|
||||||
limit: '50mb',
|
bodyParser.json({
|
||||||
}))
|
limit: "50mb",
|
||||||
app.use(bodyParser.urlencoded({
|
})
|
||||||
limit: '50mb',
|
)
|
||||||
|
app.use(
|
||||||
|
bodyParser.urlencoded({
|
||||||
|
limit: "50mb",
|
||||||
extended: true,
|
extended: true,
|
||||||
}))
|
})
|
||||||
app.use(require('./root'))
|
)
|
||||||
|
app.use(require("./root"))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Добавляйте сюда свои routers.
|
* Добавляйте сюда свои routers.
|
||||||
*/
|
*/
|
||||||
app.use('/epja-2024-1', require('./routers/epja-2024-1'))
|
app.use("/kfu-m-24-1", require("./routers/kfu-m-24-1"))
|
||||||
app.use('/todo', require('./routers/todo/routes'))
|
app.use("/epja-2024-1", require("./routers/epja-2024-1"))
|
||||||
app.use('/dogsitters-finder', require('./routers/dogsitters-finder'))
|
app.use("/todo", require("./routers/todo/routes"))
|
||||||
app.use('/kazan-explore', require('./routers/kazan-explore'))
|
app.use("/dogsitters-finder", require("./routers/dogsitters-finder"))
|
||||||
app.use('/edateam', require('./routers/edateam-legacy'))
|
app.use("/kazan-explore", require("./routers/kazan-explore"))
|
||||||
app.use('/dry-wash', require('./routers/dry-wash'))
|
app.use("/edateam", require("./routers/edateam-legacy"))
|
||||||
app.use('/freetracker', require('./routers/freetracker'))
|
app.use("/dry-wash", require("./routers/dry-wash"))
|
||||||
|
app.use("/freetracker", require("./routers/freetracker"))
|
||||||
|
app.use("/dhs-testing", require("./routers/dhs-testing"))
|
||||||
|
app.use("/gamehub", require("./routers/gamehub"))
|
||||||
|
|
||||||
app.use(require('./error'))
|
|
||||||
|
|
||||||
server.listen(config.port, () => console.log(`Listening on http://localhost:${config.port}`))
|
app.use(require("./error"))
|
||||||
|
|
||||||
|
server.listen(config.port, () =>
|
||||||
|
console.log(`Listening on http://localhost:${config.port}`)
|
||||||
|
)
|
||||||
|
0
server/log/dummy
Normal file
0
server/log/dummy
Normal file
@ -10,6 +10,7 @@ const folderPath = path.resolve(__dirname, './routers')
|
|||||||
const folders = fs.readdirSync(folderPath)
|
const folders = fs.readdirSync(folderPath)
|
||||||
|
|
||||||
router.get('/', async (req, res) => {
|
router.get('/', async (req, res) => {
|
||||||
|
// throw new Error('check error message')
|
||||||
res.send(`
|
res.send(`
|
||||||
<h1>multy stub is working v${pkg.version}</h1>
|
<h1>multy stub is working v${pkg.version}</h1>
|
||||||
<ul>
|
<ul>
|
||||||
@ -19,8 +20,7 @@ router.get('/', async (req, res) => {
|
|||||||
<h2>models</h2>
|
<h2>models</h2>
|
||||||
<ul>${
|
<ul>${
|
||||||
(await Promise.all(
|
(await Promise.all(
|
||||||
(
|
(await mongoose.modelNames()).map(async (name) => {
|
||||||
await mongoose.modelNames()).map(async (name) => {
|
|
||||||
const count = await mongoose.model(name).countDocuments()
|
const count = await mongoose.model(name).countDocuments()
|
||||||
return `<li>${name} - ${count}</li>`
|
return `<li>${name} - ${count}</li>`
|
||||||
}
|
}
|
||||||
|
@ -1,35 +1,40 @@
|
|||||||
const router = require('express').Router();
|
const router = require("express").Router();
|
||||||
|
|
||||||
router.get("/users", (request, response) => {
|
router.get("/users", (request, response) => {
|
||||||
response.send(require("./json/users/users.json"))
|
response.send(require("./json/users/users.json"));
|
||||||
})
|
});
|
||||||
|
|
||||||
router.post("/auth", (request, response) => {
|
router.post("/auth", (request, response) => {
|
||||||
const {phoneNumber, password} = request.body;
|
const { phoneNumber, password } = request.body;
|
||||||
console.log(phoneNumber, password);
|
console.log(phoneNumber, password);
|
||||||
if (phoneNumber === '89999999999') {
|
if (phoneNumber === "89999999999") {
|
||||||
response.send(require("./json/auth/dogsitter.success.json"))
|
response.send(require("./json/auth/dogsitter.success.json"));
|
||||||
|
} else if (phoneNumber === "89555555555") {
|
||||||
|
response.status(400).send(require("./json/auth/error.json"));
|
||||||
|
} else {
|
||||||
|
response.send(require("./json/auth/owner.success.json"));
|
||||||
}
|
}
|
||||||
else if (phoneNumber === '89555555555') {
|
});
|
||||||
response.status(400).send(require("./json/auth/error.json"))
|
|
||||||
|
router.post("/auth/2fa", (request, response) => {
|
||||||
|
const { code } = request.body;
|
||||||
|
if (code === "0000") {
|
||||||
|
response.send(require("./json/2fa/success.json"));
|
||||||
|
} else {
|
||||||
|
response.status(400).send(require("./json/2fa/error.json"));
|
||||||
}
|
}
|
||||||
else {
|
});
|
||||||
response.send(require("./json/auth/owner.success.json"))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
router.post("/register", (request, response) => {
|
router.post("/register", (request, response) => {
|
||||||
const {firstName, secondName, phoneNumber, password, role} = request.body;
|
const { firstName, secondName, phoneNumber, password, role } = request.body;
|
||||||
console.log(phoneNumber, password, role);
|
console.log(phoneNumber, password, role);
|
||||||
if (phoneNumber === '89283244141' || phoneNumber === '89872855893') {
|
if (phoneNumber === "89283244141" || phoneNumber === "89872855893") {
|
||||||
response.status(400).send(require("./json/register/error.json"))
|
response.status(400).send(require("./json/register/error.json"));
|
||||||
|
} else if (role === "dogsitter") {
|
||||||
|
response.send(require("./json/register/dogsitter.success.json"));
|
||||||
|
} else {
|
||||||
|
response.send(require("./json/register/owner.success.json"));
|
||||||
}
|
}
|
||||||
else if (role === 'dogsitter') {
|
});
|
||||||
response.send(require("./json/register/dogsitter.success.json"))
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
response.send(require("./json/register/owner.success.json"))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
4
server/routers/dogsitters-finder/json/2fa/error.json
Normal file
4
server/routers/dogsitters-finder/json/2fa/error.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"status": "error",
|
||||||
|
"message": "Invalid code."
|
||||||
|
}
|
4
server/routers/dogsitters-finder/json/2fa/success.json
Normal file
4
server/routers/dogsitters-finder/json/2fa/success.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"status": "success",
|
||||||
|
"message": "Two-factor authentication passed."
|
||||||
|
}
|
87
server/routers/dry-wash/arm-master.js
Normal file
87
server/routers/dry-wash/arm-master.js
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
const router = require('express').Router()
|
||||||
|
const {MasterModel} = require('./model/master')
|
||||||
|
const mongoose = require("mongoose")
|
||||||
|
|
||||||
|
|
||||||
|
router.get('/masters', async (req, res,next) => {
|
||||||
|
try {
|
||||||
|
const master = await MasterModel.find({})
|
||||||
|
res.status(200).send({success: true, body: master})
|
||||||
|
} catch (error) {
|
||||||
|
next(error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
router.delete('/masters/:id', async (req, res,next) => {
|
||||||
|
const { id } = req.params;
|
||||||
|
|
||||||
|
if (!mongoose.Types.ObjectId.isValid(id)){
|
||||||
|
throw new Error('ID is required')
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const master = await MasterModel.findByIdAndDelete(id, {
|
||||||
|
new: true,
|
||||||
|
});
|
||||||
|
if (!master) {
|
||||||
|
throw new Error('master not found')
|
||||||
|
}
|
||||||
|
res.status(200).send({success: true, body: master})
|
||||||
|
} catch (error) {
|
||||||
|
next(error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
router.post('/masters', async (req, res,next) => {
|
||||||
|
|
||||||
|
const {name, phone} = req.body
|
||||||
|
|
||||||
|
if (!name || !phone ){
|
||||||
|
throw new Error('Enter name and phone')
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const master = await MasterModel.create({name, phone})
|
||||||
|
res.status(200).send({success: true, body: master})
|
||||||
|
} catch (error) {
|
||||||
|
next(error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
router.patch('/masters/:id', async (req, res, next) => {
|
||||||
|
const { id } = req.params;
|
||||||
|
|
||||||
|
if (!mongoose.Types.ObjectId.isValid(id)) {
|
||||||
|
throw new Error('ID is required')
|
||||||
|
}
|
||||||
|
|
||||||
|
const { name, phone } = req.body;
|
||||||
|
|
||||||
|
if (!name && !phone) {
|
||||||
|
throw new Error('Enter name and phone')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
const updateData = {};
|
||||||
|
if (name) updateData.name = name;
|
||||||
|
if (phone) updateData.phone = phone;
|
||||||
|
|
||||||
|
const master = await MasterModel.findByIdAndUpdate(
|
||||||
|
id,
|
||||||
|
updateData,
|
||||||
|
{ new: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!master) {
|
||||||
|
throw new Error('master not found')
|
||||||
|
}
|
||||||
|
|
||||||
|
res.status(200).send({ success: true, body: master });
|
||||||
|
} catch (error) {
|
||||||
|
next(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = router
|
9
server/routers/dry-wash/arm-orders.js
Normal file
9
server/routers/dry-wash/arm-orders.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
const router = require('express').Router()
|
||||||
|
|
||||||
|
router.get('/orders', (req, res) => {
|
||||||
|
res
|
||||||
|
.status(200)
|
||||||
|
.send(require(`./json/arm-orders/success.json`))
|
||||||
|
})
|
||||||
|
|
||||||
|
module.exports = router
|
@ -1,15 +1,10 @@
|
|||||||
const router = require('express').Router()
|
const router = require('express').Router()
|
||||||
|
const armMasterRouter = require('./arm-master')
|
||||||
|
const armOrdersRouter = require('./arm-orders')
|
||||||
|
|
||||||
router.get('/arm/masters', (req, res) => {
|
|
||||||
res
|
|
||||||
.status(200)
|
|
||||||
.send(require("./json/arm-masters/success.json"))
|
|
||||||
})
|
|
||||||
|
|
||||||
router.get('/arm/orders', (req, res) => {
|
router.use('/arm', armMasterRouter)
|
||||||
res
|
router.use('/arm', armOrdersRouter)
|
||||||
.status(200)
|
|
||||||
.send(require(`./json/arm-orders/success.json`))
|
|
||||||
})
|
|
||||||
|
|
||||||
module.exports = router
|
module.exports = router
|
||||||
|
20
server/routers/dry-wash/model/master.js
Normal file
20
server/routers/dry-wash/model/master.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
const { Schema, model } = require('mongoose')
|
||||||
|
|
||||||
|
const schema = new Schema({
|
||||||
|
name: {type: String, required: true},
|
||||||
|
phone: {type: String, required: true,unique: true,},
|
||||||
|
created: {
|
||||||
|
type: Date, default: () => new Date().toISOString(),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
schema.set('toJSON', {
|
||||||
|
virtuals: true,
|
||||||
|
versionKey: false,
|
||||||
|
})
|
||||||
|
|
||||||
|
schema.virtual('id').get(function () {
|
||||||
|
return this._id.toHexString()
|
||||||
|
})
|
||||||
|
|
||||||
|
exports.MasterModel = model('dry-wash-master', schema)
|
30
server/routers/dry-wash/model/order.js
Normal file
30
server/routers/dry-wash/model/order.js
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
const { Schema, model } = require('mongoose')
|
||||||
|
|
||||||
|
const schema = new Schema({
|
||||||
|
startWashTime: {type: String, required: true},
|
||||||
|
endWashTime: {type: String, required: true},
|
||||||
|
orderDate: {type: String, required: true},
|
||||||
|
location: {type: String, required: true},
|
||||||
|
phone: {type: String, required: true},
|
||||||
|
status: {type: String, required: true},
|
||||||
|
carNumber: {type: String, required: true},
|
||||||
|
created: {
|
||||||
|
type: Date, default: () => new Date().toISOString(),
|
||||||
|
},
|
||||||
|
updated: {
|
||||||
|
type: Date, default: () => new Date().toISOString(),
|
||||||
|
},
|
||||||
|
master: {type: Schema.Types.ObjectId, ref: 'dry-wash-master'},
|
||||||
|
notes: String,
|
||||||
|
})
|
||||||
|
|
||||||
|
schema.set('toJSON', {
|
||||||
|
virtuals: true,
|
||||||
|
versionKey: false,
|
||||||
|
})
|
||||||
|
|
||||||
|
schema.virtual('id').get(function () {
|
||||||
|
return this._id.toHexString()
|
||||||
|
})
|
||||||
|
|
||||||
|
exports.OrderModel = model('dry-wash-order', schema)
|
107
server/routers/dry-wash/postman/dry-wash.postman_collection.json
Normal file
107
server/routers/dry-wash/postman/dry-wash.postman_collection.json
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
{
|
||||||
|
"info": {
|
||||||
|
"_postman_id": "e91fbcf7-3c7b-420d-a49e-4dbb6199c14a",
|
||||||
|
"name": "dry-wash",
|
||||||
|
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
|
||||||
|
"_exporter_id": "27705820"
|
||||||
|
},
|
||||||
|
"item": [
|
||||||
|
{
|
||||||
|
"name": "arm",
|
||||||
|
"item": [
|
||||||
|
{
|
||||||
|
"name": "create master",
|
||||||
|
"request": {
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\n \"name\":\"Anto234\",\n \"phone\": \"89172420577\"\n}",
|
||||||
|
"options": {
|
||||||
|
"raw": {
|
||||||
|
"language": "json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"raw": "{{host}}/arm/master",
|
||||||
|
"host": [
|
||||||
|
"{{host}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"arm",
|
||||||
|
"master"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "get masters",
|
||||||
|
"request": {
|
||||||
|
"method": "GET",
|
||||||
|
"header": [],
|
||||||
|
"url": {
|
||||||
|
"raw": "{{host}}/arm/master-list",
|
||||||
|
"host": [
|
||||||
|
"{{host}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"arm",
|
||||||
|
"master-list"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "delete master",
|
||||||
|
"request": {
|
||||||
|
"method": "DELETE",
|
||||||
|
"header": [],
|
||||||
|
"url": {
|
||||||
|
"raw": "{{host}}/arm/masters/{{id}}",
|
||||||
|
"host": [
|
||||||
|
"{{host}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"arm",
|
||||||
|
"masters",
|
||||||
|
"{{id}}"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "update master",
|
||||||
|
"request": {
|
||||||
|
"method": "PATCH",
|
||||||
|
"header": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\n \"name\":\"Anto234\",\n \"phone\": \"89172420577\"\n}",
|
||||||
|
"options": {
|
||||||
|
"raw": {
|
||||||
|
"language": "json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"raw": "{{host}}/arm/masters/{{id}}",
|
||||||
|
"host": [
|
||||||
|
"{{host}}"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"arm",
|
||||||
|
"masters",
|
||||||
|
"{{id}}"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -7,4 +7,6 @@ router.use('/cats', require('./cats/index'))
|
|||||||
|
|
||||||
router.use('/ecliptica', require('./ecliptica/index'))
|
router.use('/ecliptica', require('./ecliptica/index'))
|
||||||
|
|
||||||
|
router.use('/sdk', require('./sdk/index'))
|
||||||
|
|
||||||
module.exports = router
|
module.exports = router
|
||||||
|
123
server/routers/epja-2024-1/sdk/index.js
Normal file
123
server/routers/epja-2024-1/sdk/index.js
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
const router = require('express').Router();
|
||||||
|
const { v4: uuidv4 } = require('uuid');
|
||||||
|
|
||||||
|
const workout1 = {
|
||||||
|
id: uuidv4(),
|
||||||
|
title: "Toned upper body",
|
||||||
|
exercises: [
|
||||||
|
{ title: "Push ups", repsOrDuration: 12, isTimeBased: false },
|
||||||
|
{ title: "Plank", repsOrDuration: 4, isTimeBased: true },
|
||||||
|
{ title: "Bicep curl", repsOrDuration: 12, isTimeBased: false, weight: 5 },
|
||||||
|
{ title: "Bicep curl", repsOrDuration: 12, isTimeBased: false, weight: 5 },
|
||||||
|
{ title: "Bicep curl", repsOrDuration: 12, isTimeBased: false, weight: 5 },
|
||||||
|
{ title: "Bicep curl", repsOrDuration: 12, isTimeBased: false, weight: 5 },
|
||||||
|
],
|
||||||
|
tags: ['Weights', 'Arms', 'Abs', 'Chest', 'Back']
|
||||||
|
};
|
||||||
|
|
||||||
|
const workout2 = {
|
||||||
|
id: uuidv4(),
|
||||||
|
title: "Tom Platz's legs",
|
||||||
|
exercises: [
|
||||||
|
{ title: "Squats", repsOrDuration: 12, isTimeBased: false, weight: 40 },
|
||||||
|
{ title: "Leg Press", repsOrDuration: 4, isTimeBased: false, weight: 65 },
|
||||||
|
{ title: "Lunges", repsOrDuration: 2, isTimeBased: true }
|
||||||
|
],
|
||||||
|
tags: ['Weights', 'Legs']
|
||||||
|
};
|
||||||
|
|
||||||
|
const workout3 = {
|
||||||
|
id: uuidv4(),
|
||||||
|
title: "HIIT",
|
||||||
|
exercises: [
|
||||||
|
{ title: "Jumping rope", repsOrDuration: 100, isTimeBased: false },
|
||||||
|
{ title: "Burpees", repsOrDuration: 3, isTimeBased: true },
|
||||||
|
{ title: "Jumping Jacks", repsOrDuration: 50, isTimeBased: false }
|
||||||
|
],
|
||||||
|
tags: ['Cardio']
|
||||||
|
}
|
||||||
|
|
||||||
|
const savedWorkouts = [workout1, workout3];
|
||||||
|
|
||||||
|
const trainingWorkouts = [workout2];
|
||||||
|
|
||||||
|
router.post('/workout', (req, res) => {
|
||||||
|
const newWorkout = { ...req.body, id: uuidv4() };
|
||||||
|
savedWorkouts.push(newWorkout);
|
||||||
|
res.status(201).json(newWorkout);
|
||||||
|
});
|
||||||
|
|
||||||
|
router.get('/workouts', (req, res) => {
|
||||||
|
res.json(savedWorkouts);
|
||||||
|
});
|
||||||
|
|
||||||
|
router.post('/training/workout', (req, res) => {
|
||||||
|
const newWorkout = { ...req.body, id: uuidv4() };
|
||||||
|
trainingWorkouts.push(newWorkout);
|
||||||
|
res.status(201).json(newWorkout);
|
||||||
|
});
|
||||||
|
|
||||||
|
const trainings = [{ id: uuidv4(), calories: 450, date: new Date("Thu Oct 03 2024 10:05:24 GMT+0300 (Moscow Standard Time)"), emoji: "fuzzy", hours: 1, minutes: 30, isWorkoutSaved: true, workout: workout1.id }];
|
||||||
|
|
||||||
|
const days = [
|
||||||
|
new Date("Thu Oct 03 2024 10:05:24 GMT+0300 (Moscow Standard Time)"),
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
router.post('/training', (req, res) => {
|
||||||
|
const newTraining = { ...req.body, id: uuidv4() };
|
||||||
|
trainings.push(newTraining);
|
||||||
|
days.push(newTraining.date);
|
||||||
|
res.status(201).json(newTraining);
|
||||||
|
});
|
||||||
|
|
||||||
|
router.get('/training', (req, res) => {
|
||||||
|
const { date } = req.query;
|
||||||
|
if (!date) {
|
||||||
|
return res.status(400).json({ message: 'Date query parameter is required' });
|
||||||
|
}
|
||||||
|
const formattedDate = new Date(date);
|
||||||
|
const result = trainings.find(t => new Date(t.date).toDateString() === formattedDate.toDateString());
|
||||||
|
if (result) {
|
||||||
|
res.json(result);
|
||||||
|
} else {
|
||||||
|
res.status(404).json({ message: 'Training not found for the specified date' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
router.get('/training/workout', (req, res) => {
|
||||||
|
const { id } = req.query;
|
||||||
|
if (!id) {
|
||||||
|
return res.status(400).json({ message: 'Id query parameter is required' });
|
||||||
|
}
|
||||||
|
const result = trainingWorkouts.find(w => w.id === id);
|
||||||
|
if (result) {
|
||||||
|
res.json(result);
|
||||||
|
} else {
|
||||||
|
res.status(404).json({ message: 'Training with such workout not found' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
router.get('/workout', (req, res) => {
|
||||||
|
const { id } = req.query;
|
||||||
|
if (!id) {
|
||||||
|
return res.status(400).json({ message: 'Id query parameter is required' });
|
||||||
|
}
|
||||||
|
const result = savedWorkouts.find(w => w.id === id);
|
||||||
|
if (result) {
|
||||||
|
res.json(result);
|
||||||
|
} else {
|
||||||
|
res.status(404).json({ message: 'Workout not found' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
router.get('/trainings', (req, res) => {
|
||||||
|
res.json(trainings);
|
||||||
|
});
|
||||||
|
|
||||||
|
router.get('/days', (req, res) => {
|
||||||
|
res.json(days);
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = router;
|
19
server/routers/gamehub/index.js
Normal file
19
server/routers/gamehub/index.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
const router = require("express").Router();
|
||||||
|
|
||||||
|
router.get("/game-page", (request, response) => {
|
||||||
|
response.send(require("./json/gamepage/success.json"));
|
||||||
|
});
|
||||||
|
|
||||||
|
router.get("/categories", (request, response) => {
|
||||||
|
response.send(require("./json/categories/success.json"));
|
||||||
|
});
|
||||||
|
|
||||||
|
router.get("/shopping-cart", (request, response) => {
|
||||||
|
response.send(require("./json/shopping-cart/success.json"));
|
||||||
|
});
|
||||||
|
|
||||||
|
router.get("/home", (request, response) => {
|
||||||
|
response.send(require("./json/home-page-data/success.json"));
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = router;
|
150
server/routers/gamehub/json/categories/success.json
Normal file
150
server/routers/gamehub/json/categories/success.json
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"data": {
|
||||||
|
"games1": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"title": "How to Survive",
|
||||||
|
"price": 259,
|
||||||
|
"old_price": 500,
|
||||||
|
"image": "sales_game1",
|
||||||
|
"os": "windows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"title": "Red Solstice 2 Survivors",
|
||||||
|
"price": 561,
|
||||||
|
"image": "sales_game2",
|
||||||
|
"os": "windows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"title": "Sons Of The Forests",
|
||||||
|
"price": 820,
|
||||||
|
"old_price": 1100,
|
||||||
|
"image": "new_game2",
|
||||||
|
"os": "windows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 4,
|
||||||
|
"title": "The Witcher 3: Wild Hunt",
|
||||||
|
"price": 990,
|
||||||
|
"old_price": 1200,
|
||||||
|
"image": "leaders_game4",
|
||||||
|
"os": "windows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 5,
|
||||||
|
"title": "Atomic Heart",
|
||||||
|
"price": 1200,
|
||||||
|
"old_price": 2500,
|
||||||
|
"image": "leaders_game5",
|
||||||
|
"os": "windows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 6,
|
||||||
|
"title": "Crab Game",
|
||||||
|
"price": 600,
|
||||||
|
"old_price": 890,
|
||||||
|
"image": "leaders_game6",
|
||||||
|
"os": "windows"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"games2": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"title": "Alpha League",
|
||||||
|
"price": 299,
|
||||||
|
"image": "new_game1",
|
||||||
|
"os": "windows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"title": "Sons Of The Forests",
|
||||||
|
"price": 820,
|
||||||
|
"old_price": 1100,
|
||||||
|
"image": "new_game2",
|
||||||
|
"os": "windows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"title": "Pacific Drives",
|
||||||
|
"price": 1799,
|
||||||
|
"image": "new_game3",
|
||||||
|
"os": "windows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 4,
|
||||||
|
"title": "The Witcher 3: Wild Hunt",
|
||||||
|
"price": 990,
|
||||||
|
"old_price": 1200,
|
||||||
|
"image": "leaders_game4",
|
||||||
|
"os": "windows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 5,
|
||||||
|
"title": "Atomic Heart",
|
||||||
|
"price": 1200,
|
||||||
|
"old_price": 2500,
|
||||||
|
"image": "leaders_game5",
|
||||||
|
"os": "windows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 6,
|
||||||
|
"title": "Crab Game",
|
||||||
|
"price": 600,
|
||||||
|
"old_price": 890,
|
||||||
|
"image": "leaders_game6",
|
||||||
|
"os": "windows"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"games3": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"title": "Elden Ring",
|
||||||
|
"price": 3295,
|
||||||
|
"old_price": 3599,
|
||||||
|
"image": "leaders_game2",
|
||||||
|
"os": "windows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"title": "Counter-Strike 2",
|
||||||
|
"price": 479,
|
||||||
|
"image": "leaders_game1",
|
||||||
|
"os": "windows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"title": "PUBG: BATTLEGROUNDS",
|
||||||
|
"price": 199,
|
||||||
|
"image": "leaders_game3",
|
||||||
|
"os": "windows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 4,
|
||||||
|
"title": "The Witcher 3: Wild Hunt",
|
||||||
|
"price": 990,
|
||||||
|
"old_price": 1200,
|
||||||
|
"image": "leaders_game4",
|
||||||
|
"os": "windows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 5,
|
||||||
|
"title": "Atomic Heart",
|
||||||
|
"price": 1200,
|
||||||
|
"old_price": 2500,
|
||||||
|
"image": "leaders_game5",
|
||||||
|
"os": "windows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 6,
|
||||||
|
"title": "Crab Game",
|
||||||
|
"price": 600,
|
||||||
|
"old_price": 890,
|
||||||
|
"image": "leaders_game6",
|
||||||
|
"os": "windows"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
24
server/routers/gamehub/json/gamepage/success.json
Normal file
24
server/routers/gamehub/json/gamepage/success.json
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"data": {
|
||||||
|
"comments": [
|
||||||
|
{
|
||||||
|
"username": "Пользователь1",
|
||||||
|
"text": "Текст комментария 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"username": "Пользователь2",
|
||||||
|
"text": "Текст комментария 2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"username": "Пользователь3",
|
||||||
|
"text": "Текст комментария 3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"username": "Пользователь4",
|
||||||
|
"text": "Текст комментария 4"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
91
server/routers/gamehub/json/home-page-data/success.json
Normal file
91
server/routers/gamehub/json/home-page-data/success.json
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"data": {
|
||||||
|
"topSail": [
|
||||||
|
{
|
||||||
|
"image": "game1",
|
||||||
|
"text": "$10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "game2",
|
||||||
|
"text": "$10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "game3",
|
||||||
|
"text": "$10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "game4",
|
||||||
|
"text": "$10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "game5",
|
||||||
|
"text": "$10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "game6",
|
||||||
|
"text": "$10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "game7",
|
||||||
|
"text": "$10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "game8",
|
||||||
|
"text": "$10"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
{
|
||||||
|
"image": "category1",
|
||||||
|
"text": "гонки"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "category2",
|
||||||
|
"text": "глубокий сюжет"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "category3",
|
||||||
|
"text": "симуляторы"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "category4",
|
||||||
|
"text": "открытый мир"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "category5",
|
||||||
|
"text": "экшен"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "category6",
|
||||||
|
"text": "стратегии"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "category7",
|
||||||
|
"text": "шутеры"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "category8",
|
||||||
|
"text": "приключения"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"news": [
|
||||||
|
{
|
||||||
|
"image": "news1",
|
||||||
|
"text": "Разработчики Delta Force: Hawk Ops представили крупномасштабный режим Havoc Warfare"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "news2",
|
||||||
|
"text": "Первый трейлер Assassin’s Creed Shadows — с темнокожим самураем в феодальной Японии"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "news3",
|
||||||
|
"text": "Призрак Цусимы» вышел на ПК — и уже ставит рекорды для Sony"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"image": "news4",
|
||||||
|
"text": "Авторы Skull and Bones расширяют планы на второй сезо"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
37
server/routers/gamehub/json/shopping-cart/success.json
Normal file
37
server/routers/gamehub/json/shopping-cart/success.json
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"success":true,
|
||||||
|
"data":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"title": "Mortal Kombat 11",
|
||||||
|
"image": "mortal",
|
||||||
|
"alt": "Игра Мортал Комбат 11, картинка",
|
||||||
|
"releaseDate": "23 апр. 2019",
|
||||||
|
"description": "MORTAL KOMBAT 11 ULTIMATE ВКЛЮЧАЕТ В СЕБЯ БАЗОВУЮ ИГРУ МК11, КОМВАТ РАСК 1, ДОПОЛНЕНИЕ «ПОСЛЕДСТВИЯ» И НЕДАВНО ДОБАВЛЕННЫЙ НАБОР «КОМБАТ 2».",
|
||||||
|
"price": 300
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"title": "EA SPORTS™ FIFA 23",
|
||||||
|
"image": "fifa",
|
||||||
|
"alt": "Игра Фифа, картинка",
|
||||||
|
"releaseDate": "30 сен. 2022",
|
||||||
|
"description": "В FIFA 23 всемирная игра становится еще лучше с технологией HyperMotion2, мужским и женским FIFA World Cup™, женскими командами, кроссплатформенной игрой и множеством прочих возможностей.",
|
||||||
|
"price": 300
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"title": "Ведьмак: Дикая Охота",
|
||||||
|
"image": "ved",
|
||||||
|
"alt": "Игра Ведьмак, картинка",
|
||||||
|
"releaseDate": "18 мая 2015",
|
||||||
|
"description": "Вы — Геральт из Ривии, наемный убийца чудовищ. Вы путешествуете по миру, в котором бушует война и на каждом шагу подстерегают чудовища. Вам предстоит выполнить заказ и найти Цири — Дитя Предназначения, живое оружие, способное изменить облик этого мира.",
|
||||||
|
"price": 300
|
||||||
|
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"description": "1000 часто используемых",
|
||||||
|
"imageFilename": "kart1.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"description": "10 слов в Data Science",
|
||||||
|
"imageFilename": "kart1.jpg"
|
||||||
|
}
|
||||||
|
]
|
@ -0,0 +1,150 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"words": [
|
||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"word": "Tech",
|
||||||
|
"definition": "short for technical, relating to the knowledge, machines, or methods used in science and industry. Tech is a whole industry, which includes IT",
|
||||||
|
"examples": [
|
||||||
|
"“As a DevOps engineer I have been working in Tech since 2020.”"
|
||||||
|
],
|
||||||
|
"synonyms": ["IT"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"word": "career path",
|
||||||
|
"definition": "the series of jobs or roles that constitute a person's career, especially one in a particular field",
|
||||||
|
"examples": [
|
||||||
|
"“Technology is an evolving field with a variety of available career paths.”"
|
||||||
|
],
|
||||||
|
"synonyms": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"words": [
|
||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"word": "Machine Learning",
|
||||||
|
"translation": "Машинное обучение",
|
||||||
|
"definition": "An approach to artificial intelligence where computers learn from data without being explicitly programmed.",
|
||||||
|
"synonyms": ["Trainable Algorithms", "Automated Learning"],
|
||||||
|
"examples": [
|
||||||
|
"We used machine learning techniques to forecast product demand.",
|
||||||
|
"The movie recommendation system is based on machine learning algorithms.",
|
||||||
|
"Machine learning helped improve the accuracy of speech recognition in our application."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"word": "Neural Network",
|
||||||
|
"translation": "Нейронная сеть",
|
||||||
|
"definition": "A mathematical model inspired by the structure and function of biological neural networks, consisting of interconnected nodes organized in layers that can process information.",
|
||||||
|
"synonyms": ["Artificial Neural Network", "Deep Neural Network"],
|
||||||
|
"examples": [
|
||||||
|
"To process large amounts of data, we created a deep learning neural network.",
|
||||||
|
"This neural network is capable of generating realistic images.",
|
||||||
|
"Using neural networks significantly improved the quality of text translation."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"word": "Algorithm",
|
||||||
|
"translation": "Алгоритм",
|
||||||
|
"definition": "A step-by-step procedure or set of instructions for solving a problem or performing a computation.",
|
||||||
|
"synonyms": ["Procedure", "Method"],
|
||||||
|
"examples": [
|
||||||
|
"The algorithm we developed quickly finds the optimal delivery route.",
|
||||||
|
"This algorithm sorts an array with a minimal number of operations.",
|
||||||
|
"Encryption algorithms ensure secure transmission of data over the internet."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"word": "Data Model",
|
||||||
|
"translation": "Модель данных",
|
||||||
|
"definition": "An abstract representation of the structure of data, describing how data is organized and related to each other.",
|
||||||
|
"synonyms": ["Data Structure", "Schema"],
|
||||||
|
"examples": [
|
||||||
|
"Our data model allows us to efficiently manage relationships between customers and orders.",
|
||||||
|
"The data model was designed considering scalability and performance requirements.",
|
||||||
|
"This data model is used for storing information about social network users."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 4,
|
||||||
|
"word": "Regression",
|
||||||
|
"translation": "Регрессия",
|
||||||
|
"definition": "A statistical method used to determine the relationship between one variable and others.",
|
||||||
|
"synonyms": ["Linear Regression", "Nonlinear Regression"],
|
||||||
|
"examples": [
|
||||||
|
"We applied linear regression to analyze the impact of advertising campaigns on sales.",
|
||||||
|
"Results from the regression analysis showed a strong correlation between customer age and purchase frequency.",
|
||||||
|
"Regression helped us assess how changes in environmental conditions affect crop yield."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 5,
|
||||||
|
"word": "Clustering",
|
||||||
|
"translation": "Кластеризация",
|
||||||
|
"definition": "The process of grouping similar objects into clusters so that objects within the same cluster are more similar to each other than to those in other clusters.",
|
||||||
|
"synonyms": ["Grouping", "Segmentation"],
|
||||||
|
"examples": [
|
||||||
|
"Clustering allowed us to divide customers into several groups according to their purchasing behavior.",
|
||||||
|
"Clustering methods are used to automatically group news by topic.",
|
||||||
|
"As a result of clustering, several market segments were identified, each with its own characteristics."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 6,
|
||||||
|
"word": "Supervised Learning",
|
||||||
|
"translation": "Обучение с учителем",
|
||||||
|
"definition": "A type of machine learning where the algorithm learns from labeled data, meaning data for which correct answers are known.",
|
||||||
|
"synonyms": ["Controlled Learning", "Labeled Classification"],
|
||||||
|
"examples": [
|
||||||
|
"Supervised learning is used to classify emails as spam or not-spam.",
|
||||||
|
"This approach was used to create a model that predicts real estate prices based on multiple parameters.",
|
||||||
|
"Supervised learning helps diagnose diseases at early stages through medical data analysis."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 7,
|
||||||
|
"word": "Data Labeling",
|
||||||
|
"translation": "Разметка данных",
|
||||||
|
"definition": "The process of assigning labels or classes to data so it can be used in supervised learning.",
|
||||||
|
"synonyms": ["Data Annotation", "Tagging"],
|
||||||
|
"examples": [
|
||||||
|
"Before starting model training, we labeled the data by assigning each photo an animal category.",
|
||||||
|
"Data labeling includes marking user reviews as positive or negative.",
|
||||||
|
"Text documents were labeled with special tags for subsequent analysis."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 8,
|
||||||
|
"word": "Hyperparameters",
|
||||||
|
"translation": "Гиперпараметры",
|
||||||
|
"definition": "Parameters that define the structure and behavior of a machine learning model, set before the learning process begins.",
|
||||||
|
"synonyms": ["Model Settings", "Configuration Parameters"],
|
||||||
|
"examples": [
|
||||||
|
"Optimizing hyperparameters enabled us to enhance the performance of our machine learning model.",
|
||||||
|
"Hyperparameters include settings such as the number of layers in a neural network and the learning rate.",
|
||||||
|
"Choosing the right hyperparameters is crucial for achieving high model accuracy."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 9,
|
||||||
|
"word": "Model Validation",
|
||||||
|
"translation": "Валидация модели",
|
||||||
|
"definition": "The process of evaluating the quality of a model by testing it on new, previously unseen data.",
|
||||||
|
"synonyms": ["Model Testing", "Model Verification"],
|
||||||
|
"examples": [
|
||||||
|
"After completing the training, we validated the model using a test dataset.",
|
||||||
|
"During model validation, its ability to make accurate predictions on new data is checked.",
|
||||||
|
"Validation showed that the model is robust against changes in data and has low generalization error."
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
21
server/routers/kfu-m-24-1/eng-it-lean/dictionaries/index.js
Normal file
21
server/routers/kfu-m-24-1/eng-it-lean/dictionaries/index.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
const router = require("express").Router();
|
||||||
|
|
||||||
|
module.exports = router;
|
||||||
|
|
||||||
|
const data = require("./data/dictionaries.json");
|
||||||
|
const wordsData = require("./data/dictionaryWords.json");
|
||||||
|
|
||||||
|
router.get("/", (req, res) => {
|
||||||
|
res.send(data);
|
||||||
|
});
|
||||||
|
|
||||||
|
router.get("/:id", (req, res) => {
|
||||||
|
const id = parseInt(req.params.id);
|
||||||
|
const words = wordsData.find((word) => word.id === id);
|
||||||
|
|
||||||
|
if (!words) {
|
||||||
|
return res.status(404).send("Not found");
|
||||||
|
}
|
||||||
|
|
||||||
|
res.send(words);
|
||||||
|
});
|
13
server/routers/kfu-m-24-1/eng-it-lean/index.js
Normal file
13
server/routers/kfu-m-24-1/eng-it-lean/index.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
const router = require("express").Router();
|
||||||
|
|
||||||
|
const dictionariesRouter = require("./dictionaries");
|
||||||
|
module.exports = router;
|
||||||
|
|
||||||
|
const delay =
|
||||||
|
(ms = 1000) =>
|
||||||
|
(req, res, next) => {
|
||||||
|
setTimeout(next, ms);
|
||||||
|
};
|
||||||
|
|
||||||
|
router.use(delay());
|
||||||
|
router.use("/dictionaries", dictionariesRouter);
|
7
server/routers/kfu-m-24-1/index.js
Normal file
7
server/routers/kfu-m-24-1/index.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
const { Router } = require('express')
|
||||||
|
const router = Router()
|
||||||
|
|
||||||
|
router.use('/eng-it-lean', require('./eng-it-lean/index'))
|
||||||
|
|
||||||
|
module.exports = router
|
||||||
|
|
Loading…
Reference in New Issue
Block a user