Updated dependencies, removed server demo

This commit is contained in:
2025-07-26 04:01:06 +10:00
parent cd34f0db5c
commit 8aeaa46332
6 changed files with 3003 additions and 2965 deletions
+1
View File
@@ -44,6 +44,7 @@ To set up this template in development mode:
4. Run `cp .envdev .env` and enter your details into the `.env` file 4. Run `cp .envdev .env` and enter your details into the `.env` file
5. Execute `npm run dev` 5. Execute `npm run dev`
6. Navigate to `http://localhost:3001` in your web browser 6. Navigate to `http://localhost:3001` in your web browser
7. Repeat this process for each microservice (linked above)
# Features List # Features List
-4
View File
@@ -1,7 +1,3 @@
//polyfills
import 'regenerator-runtime/runtime';
import React from 'react';
import ReactDOM from 'react-dom/client'; import ReactDOM from 'react-dom/client';
import App from './pages/app'; import App from './pages/app';
+2973 -2928
View File
File diff suppressed because it is too large Load Diff
+22 -25
View File
@@ -10,10 +10,7 @@
"build:client": "webpack --env=production --config webpack.config.js", "build:client": "webpack --env=production --config webpack.config.js",
"dev": "concurrently npm:dev:server npm:dev:client", "dev": "concurrently npm:dev:server npm:dev:client",
"dev:server": "nodemon --ext js,jsx,json --ignore 'node_modules/*'", "dev:server": "nodemon --ext js,jsx,json --ignore 'node_modules/*'",
"dev:client": "webpack serve --env=development --config webpack.config.js", "dev:client": "webpack serve --config webpack.config.js",
"local": "concurrently npm:local:server npm:local:client",
"local:server": "nodemon --ext js,jsx,json --ignore 'node_modules/*'",
"local:client": "webpack serve --env=local --config webpack.config.js",
"analyze": "webpack --env=production --env=analyze --config webpack.config.js" "analyze": "webpack --env=production --env=analyze --config webpack.config.js"
}, },
"repository": { "repository": {
@@ -27,34 +24,34 @@
}, },
"homepage": "https://github.com/KRGameStudios/MERN-template#readme", "homepage": "https://github.com/KRGameStudios/MERN-template#readme",
"dependencies": { "dependencies": {
"@babel/core": "^7.24.5", "@babel/core": "^7.28.0",
"@babel/preset-env": "^7.24.5", "@babel/preset-env": "^7.28.0",
"@babel/preset-react": "^7.24.1", "@babel/preset-react": "^7.27.1",
"babel-loader": "^9.1.3", "babel-loader": "^10.0.0",
"clean-webpack-plugin": "^4.0.0", "clean-webpack-plugin": "^4.0.0",
"compression-webpack-plugin": "^11.1.0", "compression-webpack-plugin": "^11.1.0",
"concurrently": "^8.2.2", "concurrently": "^9.2.0",
"css-loader": "^7.1.1", "css-loader": "^7.1.2",
"dateformat": "^5.0.3", "dateformat": "^5.0.3",
"dotenv": "^16.4.5", "dotenv": "^17.2.1",
"express": "^4.19.2", "express": "^5.1.0",
"html-webpack-plugin": "^5.6.0", "html-webpack-plugin": "^5.6.3",
"jwt-decode": "^4.0.0", "jwt-decode": "^4.0.0",
"mariadb": "^3.3.0", "mariadb": "^3.4.5",
"react": "^18.3.1", "react": "^19.1.0",
"react-dom": "^18.3.1", "react-dom": "^19.1.0",
"react-router": "^6.3.0", "react-router": "^7.7.1",
"react-router-dom": "^6.23.0", "react-router-dom": "^7.7.1",
"react-select": "^5.8.0", "react-select": "^5.10.2",
"sequelize": "^6.37.3", "sequelize": "^6.37.7",
"socket.io-client": "^4.7.5", "socket.io-client": "^4.8.1",
"style-loader": "^4.0.0", "style-loader": "^4.0.0",
"webpack": "^5.91.0", "webpack": "^5.100.2",
"webpack-bundle-analyzer": "^4.10.2", "webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4" "webpack-cli": "^6.0.1"
}, },
"devDependencies": { "devDependencies": {
"nodemon": "^3.1.0", "nodemon": "^3.1.10",
"webpack-dev-server": "^5.0.4" "webpack-dev-server": "^5.2.2"
} }
} }
+3 -3
View File
@@ -13,14 +13,14 @@ const server = require('http').Server(app);
app.use(express.json()); app.use(express.json());
//handle compressed files (middleware) //handle compressed files (middleware)
app.get('*.js', (req, res, next) => { app.get('/{*any}.js', (req, res, next) => {
req.url = req.url + '.gz'; req.url = req.url + '.gz';
res.set('Content-Encoding', 'gzip'); res.set('Content-Encoding', 'gzip');
res.set('Content-Type', 'text/javascript'); res.set('Content-Type', 'text/javascript');
next(); next();
}); });
app.get('*.css', (req, res, next) => { app.get('/{*any}.css', (req, res, next) => {
req.url = req.url + '.gz'; req.url = req.url + '.gz';
res.set('Content-Encoding', 'gzip'); res.set('Content-Encoding', 'gzip');
res.set('Content-Type', 'text/css'); res.set('Content-Type', 'text/css');
@@ -34,7 +34,7 @@ const database = require('./database');
app.use('/', express.static(path.resolve(__dirname, '..', 'public'))); app.use('/', express.static(path.resolve(__dirname, '..', 'public')));
//fallback to the index file //fallback to the index file
app.get('*', (req, res) => { app.get('/{*any}', (req, res) => {
res.sendFile(path.resolve(__dirname, '..', 'public' , 'index.html')); res.sendFile(path.resolve(__dirname, '..', 'public' , 'index.html'));
}); });
+4 -5
View File
@@ -9,7 +9,7 @@ const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const path = require('path'); const path = require('path');
//the exported config function //the exported config function
module.exports = ({ production, development, local, analyze }) => { module.exports = ({ production, analyze }) => {
return { return {
mode: production ? "production" : "development", mode: production ? "production" : "development",
entry: path.resolve(__dirname, 'client', 'client.jsx'), entry: path.resolve(__dirname, 'client', 'client.jsx'),
@@ -33,7 +33,6 @@ module.exports = ({ production, development, local, analyze }) => {
loader: 'babel-loader', loader: 'babel-loader',
options: { options: {
presets: ['@babel/preset-env', '@babel/preset-react'], presets: ['@babel/preset-env', '@babel/preset-react'],
plugins: ['@babel/plugin-syntax-dynamic-import']
} }
} }
] ]
@@ -48,9 +47,9 @@ module.exports = ({ production, development, local, analyze }) => {
new DefinePlugin({ new DefinePlugin({
'process.env': { 'process.env': {
'PRODUCTION': production, 'PRODUCTION': production,
'NEWS_URI': production ? `"${process.env.NEWS_URI}"` : development ? '"https://dev-news.krgamestudios.com"' : '"http://localhost:3100"', 'NEWS_URI': production ? `"${process.env.NEWS_URI}"` : '"http://localhost:3100"',
'AUTH_URI': production ? `"${process.env.AUTH_URI}"` : development ? '"https://dev-auth.krgamestudios.com"' : '"http://localhost:3200"', 'AUTH_URI': production ? `"${process.env.AUTH_URI}"` : '"http://localhost:3200"',
'CHAT_URI': production ? `"${process.env.CHAT_URI}"` : development ? '"https://dev-chat.krgamestudios.com"' : '"http://localhost:3300"', 'CHAT_URI': production ? `"${process.env.CHAT_URI}"` : '"http://localhost:3300"',
} }
}), }),
new CleanWebpackPlugin({ new CleanWebpackPlugin({