Initial commit: Своя Игра - multiplayer quiz game

This commit is contained in:
Cosmo
2026-03-21 05:00:06 +00:00
commit 1d46ad8b06
80 changed files with 9215 additions and 0 deletions

54
server/src/models/Game.js Normal file
View File

@@ -0,0 +1,54 @@
import mongoose from 'mongoose';
const gameSchema = new mongoose.Schema({
gameCode: {
type: String,
required: true,
unique: true
},
hostId: String,
hostName: String,
teams: [{
id: String,
name: String,
score: { type: Number, default: 0 },
players: [{
id: String
}]
}],
currentRound: {
type: Number,
default: 1
},
selectedCategories: {
type: mongoose.Schema.Types.Mixed,
default: []
},
usedCategoryIds: {
type: [String],
default: []
},
usedQuestions: [{
category: String,
points: Number
}],
status: {
type: String,
enum: ['waiting', 'playing', 'finished'],
default: 'waiting'
},
currentQuestion: {
type: mongoose.Schema.Types.Mixed,
default: null
},
answeringTeam: {
type: String,
default: null
}
}, {
timestamps: true
});
const Game = mongoose.model('Game', gameSchema);
export default Game;