feat: Einführung von Umgebungsvariablen und Startskripten für die Backend-Anwendung

- Hinzufügen eines zentralen Skripts zum Laden von Umgebungsvariablen aus einer .env-Datei.
- Implementierung von Start- und Entwicklungs-Skripten in der package.json für eine vereinfachte Ausführung der Anwendung.
- Bereinigung und Entfernung nicht mehr benötigter Minigame-Modelle und -Services zur Verbesserung der Codebasis.
- Anpassungen an den Datenbankmodellen zur Unterstützung von neuen Assoziationen und zur Verbesserung der Lesbarkeit.
This commit is contained in:
Torsten Schulz (local)
2025-08-23 22:27:19 +02:00
parent 66818cc728
commit 6da849ca3c
128 changed files with 1054 additions and 1611 deletions

View File

@@ -5,19 +5,14 @@ const ChatRight = sequelize.define('ChatRight', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
autoIncrement: true},
tr: {
type: DataTypes.STRING(32),
allowNull: false,
unique: true,
},
}, {
unique: true}}, {
schema: 'chat',
tableName: 'rights',
timestamps: false,
underscored: true,
,
freezeTableName: true});
underscored: true});
export default ChatRight;

View File

@@ -5,55 +5,43 @@ const Room = sequelize.define('Room', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
autoIncrement: true},
title: {
type: DataTypes.TEXT,
allowNull: false,
},
owner_id: {
allowNull: false},
ownerId: {
type: DataTypes.INTEGER,
allowNull: true, // kann null sein, wenn system-owned
},
room_type_id: {
roomTypeId: {
type: DataTypes.INTEGER,
allowNull: true,
},
is_public: {
allowNull: true},
isPublic: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: true,
},
gender_restriction_id: {
defaultValue: true},
genderRestrictionId: {
type: DataTypes.INTEGER,
allowNull: true,
},
allowNull: true},
password: {
type: DataTypes.STRING,
allowNull: true,
},
min_age: {
allowNull: true},
minAge: {
type: DataTypes.INTEGER,
allowNull: true,
},
max_age: {
allowNull: true},
maxAge: {
type: DataTypes.INTEGER,
allowNull: true,
},
password_hash: {
allowNull: true},
passwordHash: {
type: DataTypes.TEXT,
allowNull: true,
},
friends_of_owner_only: {
allowNull: true},
friendsOfOwnerOnly: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
},
required_user_right_id: {
defaultValue: false},
requiredUserRightId: {
type: DataTypes.INTEGER,
allowNull: true,
},
}, {
allowNull: true}}, {
schema: 'chat',
tableName: 'room',
timestamps: true,
@@ -61,10 +49,7 @@ const Room = sequelize.define('Room', {
indexes: [
{
name: 'idx_chat_room_owner',
fields: ['owner_id'],
,
freezeTableName: true},
],
});
fields: ['ownerId']},
]});
export default Room;

View File

@@ -5,19 +5,14 @@ const RoomType = sequelize.define('RoomType', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
autoIncrement: true},
tr: {
type: DataTypes.STRING(32),
allowNull: false,
unique: true,
},
}, {
unique: true}}, {
schema: 'chat',
tableName: 'room_type',
timestamps: false,
underscored: true,
,
freezeTableName: true});
underscored: true});
export default RoomType;

View File

@@ -5,38 +5,29 @@ const ChatUser = sequelize.define('ChatUser', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
falukant_user_id: {
autoIncrement: true},
falukantUserId: {
type: DataTypes.INTEGER,
allowNull: false,
comment: 'Verknüpfung zu community.falukant_user',
},
display_name: {
comment: 'Verknüpfung zu community.falukant_user'},
displayName: {
type: DataTypes.STRING(64),
allowNull: false,
},
allowNull: false},
color: {
type: DataTypes.STRING(16), // z.B. Hex-Code
allowNull: false,
defaultValue: '#000000',
},
show_gender: {
defaultValue: '#000000'},
showGender: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: true,
},
show_age: {
defaultValue: true},
showAge: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: true,
},
}, {
defaultValue: true}}, {
schema: 'chat',
tableName: 'user',
timestamps: true,
underscored: true,
,
freezeTableName: true});
underscored: true});
export default ChatUser;

View File

@@ -4,24 +4,21 @@ import ChatUser from './user.js';
import ChatRight from './rights.js';
const ChatUserRight = sequelize.define('ChatUserRight', {
chat_user_id: {
chatUserId: {
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true,
references: null, // Assoziation wird separat gesetzt
},
chat_right_id: {
chatRightId: {
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true,
references: null, // Assoziation wird separat gesetzt
},
}, {
}}, {
schema: 'chat',
tableName: 'user_rights',
timestamps: false,
underscored: true,
,
freezeTableName: true});
underscored: true});
export default ChatUserRight;