Compare commits

..

13 Commits

Author SHA1 Message Date
Kayne Ruse 2964c1e448 Updated dependencies
* Removed 'react-router-dom' as no longer needed

Linked to:

* news-server v1.7.4
* auth-server v1.8.10
* chat-server v1.5.4
2025-09-18 10:48:24 +10:00
dependabot[bot] a2344947f8 Bump react-router-dom from 7.8.2 to 7.9.1
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 7.8.2 to 7.9.1.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@7.9.1/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-version: 7.9.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-18 10:08:51 +10:00
Kayne Ruse 52b755fe16 Bump dependencies 2025-09-10 14:02:40 +10:00
dependabot[bot] b1c31731ee Bump @babel/core from 7.28.0 to 7.28.4
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.28.0 to 7.28.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.28.4/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-version: 7.28.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 12:58:02 +10:00
dependabot[bot] b8cc43c556 Bump html-webpack-plugin from 5.6.3 to 5.6.4
Bumps [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) from 5.6.3 to 5.6.4.
- [Release notes](https://github.com/jantimon/html-webpack-plugin/releases)
- [Changelog](https://github.com/jantimon/html-webpack-plugin/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jantimon/html-webpack-plugin/compare/v5.6.3...v5.6.4)

---
updated-dependencies:
- dependency-name: html-webpack-plugin
  dependency-version: 5.6.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 12:53:11 +10:00
dependabot[bot] 24b9ff3b5f Bump dotenv from 17.2.1 to 17.2.2
Bumps [dotenv](https://github.com/motdotla/dotenv) from 17.2.1 to 17.2.2.
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/motdotla/dotenv/compare/v17.2.1...v17.2.2)

---
updated-dependencies:
- dependency-name: dotenv
  dependency-version: 17.2.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 12:49:46 +10:00
dependabot[bot] a38b8922a0 Bump @babel/preset-env from 7.28.0 to 7.28.3
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.28.0 to 7.28.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.28.3/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-version: 7.28.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 12:49:13 +10:00
dependabot[bot] fcedc00612 Bump react-router-dom from 7.7.1 to 7.8.2
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 7.7.1 to 7.8.2.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@7.8.2/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-version: 7.8.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 12:48:11 +10:00
Kayne Ruse da4316dccc Experimenting with dependabot 2025-09-09 18:48:01 +10:00
Kayne Ruse faacb8b8c7 Fixed CORS configuration 2025-07-29 14:40:24 +10:00
Kayne Ruse c48fcba994 Commented out MacOS check in configure-script.js 2025-07-29 12:49:50 +10:00
Kayne Ruse 56e3151db0 Fixed a missing import 2025-07-29 11:02:02 +10:00
Kayne Ruse 8aeaa46332 Updated dependencies, removed server demo 2025-07-26 04:03:32 +10:00
23 changed files with 3165 additions and 3038 deletions
+10
View File
@@ -0,0 +1,10 @@
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
+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
-3
View File
@@ -1,6 +1,3 @@
//polyfills
import 'regenerator-runtime/runtime';
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom/client'; import ReactDOM from 'react-dom/client';
+1 -1
View File
@@ -1,5 +1,5 @@
import React, { useEffect, useContext, useRef } from 'react'; import React, { useEffect, useContext, useRef } from 'react';
import { Link, Navigate } from 'react-router-dom'; import { Link, Navigate } from 'react-router';
import ApplyToBody from '../utilities/apply-to-body'; import ApplyToBody from '../utilities/apply-to-body';
+1 -1
View File
@@ -1,5 +1,5 @@
import React, { useContext, useRef } from 'react'; import React, { useContext, useRef } from 'react';
import { Link, Navigate } from 'react-router-dom'; import { Link, Navigate } from 'react-router';
import ApplyToBody from '../utilities/apply-to-body'; import ApplyToBody from '../utilities/apply-to-body';
+1 -1
View File
@@ -1,5 +1,5 @@
import React, { useContext, useRef } from 'react'; import React, { useContext, useRef } from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router';
import { TokenContext } from '../../utilities/token-provider'; import { TokenContext } from '../../utilities/token-provider';
+1 -1
View File
@@ -1,5 +1,5 @@
import React, { useContext, useRef } from 'react'; import React, { useContext, useRef } from 'react';
import { Link, useNavigate } from 'react-router-dom'; import { Link, useNavigate } from 'react-router';
import ApplyToBody from '../utilities/apply-to-body'; import ApplyToBody from '../utilities/apply-to-body';
+1 -1
View File
@@ -1,5 +1,5 @@
import React, { useContext, useRef } from 'react'; import React, { useContext, useRef } from 'react';
import { Link, useNavigate, useSearchParams } from 'react-router-dom'; import { Link, useNavigate, useSearchParams } from 'react-router';
import ApplyToBody from '../utilities/apply-to-body'; import ApplyToBody from '../utilities/apply-to-body';
+1 -1
View File
@@ -1,5 +1,5 @@
import React, { useContext, useRef } from 'react'; import React, { useContext, useRef } from 'react';
import { Link, useNavigate } from 'react-router-dom'; import { Link, useNavigate } from 'react-router';
import ApplyToBody from '../utilities/apply-to-body'; import ApplyToBody from '../utilities/apply-to-body';
+1 -1
View File
@@ -1,5 +1,5 @@
import React, { useContext } from 'react'; import React, { useContext } from 'react';
import { Link, Navigate } from 'react-router-dom'; import { Link, Navigate } from 'react-router';
import ApplyToBody from '../utilities/apply-to-body'; import ApplyToBody from '../utilities/apply-to-body';
+1 -1
View File
@@ -1,5 +1,5 @@
import React, { useContext } from 'react'; import React, { useContext } from 'react';
import { Link, Navigate } from 'react-router-dom'; import { Link, Navigate } from 'react-router';
import ApplyToBody from '../utilities/apply-to-body'; import ApplyToBody from '../utilities/apply-to-body';
+1 -1
View File
@@ -1,6 +1,6 @@
//react //react
import React, { useContext, Suspense, lazy } from 'react'; import React, { useContext, Suspense, lazy } from 'react';
import { BrowserRouter, Routes, Route } from 'react-router-dom'; import { BrowserRouter, Routes, Route } from 'react-router';
import { TokenContext } from './utilities/token-provider'; import { TokenContext } from './utilities/token-provider';
//styling //styling
+1 -1
View File
@@ -1,5 +1,5 @@
import React, { useContext } from 'react'; import React, { useContext } from 'react';
import { Link, Navigate } from 'react-router-dom'; import { Link, Navigate } from 'react-router';
import ApplyToBody from './utilities/apply-to-body'; import ApplyToBody from './utilities/apply-to-body';
+1 -1
View File
@@ -1,5 +1,5 @@
import React, { useContext } from 'react'; import React, { useContext } from 'react';
import { Link, Navigate } from 'react-router-dom'; import { Link, Navigate } from 'react-router';
import ApplyToBody from './utilities/apply-to-body'; import ApplyToBody from './utilities/apply-to-body';
+1 -1
View File
@@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router';
import ApplyToBody from './utilities/apply-to-body'; import ApplyToBody from './utilities/apply-to-body';
+1 -1
View File
@@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router';
const Break = () => { const Break = () => {
return ( return (
+1 -1
View File
@@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router';
const Static = props => { const Static = props => {
return ( return (
+1 -1
View File
@@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router';
const Static = props => { const Static = props => {
return ( return (
+15 -8
View File
@@ -46,18 +46,21 @@ See https://github.com/krgamestudios/MERN-template/wiki for help.
` `
); );
//determine local computer address for mac user vs everyone else // //determine local computer address for mac user vs everyone else
let macUser = ''; // let macUser = '';
while (macUser.toLowerCase() !== 'yes' && macUser.toLowerCase() !== 'no') { // while (macUser.toLowerCase() !== 'yes' && macUser.toLowerCase() !== 'no') {
macUser = await question('Will the MERN-Template be running locally on a MacOS system? (yes or no, this only alters startup.sql)', ''); // macUser = await question('Will the MERN-Template be running locally on a MacOS system? (yes or no, this only alters startup.sql)', '');
} // }
const localAddress = macUser ? 'localhost' : '%'; // const localAddress = macUser === 'yes' ? 'localhost' : '%';
const localAddress = '%';
//project configuration //project configuration
const projectName = await question('Project Name', 'template'); const projectName = await question('Project Name', 'template');
const projectWebAddress = await question('Project Web Address', 'example.com'); const projectWebAddress = await question('Project Web Address', 'example.com');
const corsWebOrigin = await question('CORS Web Origin', `https://${projectWebAddress}`);
let projectDBLocation = ''; let projectDBLocation = '';
while (typeof projectDBLocation != 'string' || /^[le]/i.test(projectDBLocation[0]) == false) { while (typeof projectDBLocation != 'string' || /^[le]/i.test(projectDBLocation[0]) == false) {
projectDBLocation = await question('Project [l]ocal or [e]xternal database?'); projectDBLocation = await question('Project [l]ocal or [e]xternal database?');
@@ -180,7 +183,7 @@ See https://github.com/krgamestudios/MERN-template/wiki for help.
const defaultHost = tmpHost; const defaultHost = tmpHost;
if (defaultUser) { if (defaultUser) {
console.log(`Default user email will be: ${defaultUser}@${authWebAddress}`); console.log(`Default user email will be: ${defaultUser}@${defaultHost}`);
} }
//traefic configuration //traefic configuration
@@ -206,6 +209,7 @@ services:
- traefik.http.routers.${projectName}router.service=${projectName}service@docker - traefik.http.routers.${projectName}router.service=${projectName}service@docker
- traefik.http.services.${projectName}service.loadbalancer.server.port=${projectPort} - traefik.http.services.${projectName}service.loadbalancer.server.port=${projectPort}
environment: environment:
- WEB_ORIGIN=${corsWebOrigin}
- WEB_PORT=${projectPort} - WEB_PORT=${projectPort}
- DB_HOSTNAME=${projectDBHost} - DB_HOSTNAME=${projectDBHost}
- DB_PORTNAME=${projectDBPort} - DB_PORTNAME=${projectDBPort}
@@ -238,6 +242,7 @@ services:
- traefik.http.routers.${newsName}router.service=${newsName}service@docker - traefik.http.routers.${newsName}router.service=${newsName}service@docker
- traefik.http.services.${newsName}service.loadbalancer.server.port=${newsPort} - traefik.http.services.${newsName}service.loadbalancer.server.port=${newsPort}
environment: environment:
- WEB_ORIGIN=${corsWebOrigin}
- WEB_PORT=${newsPort} - WEB_PORT=${newsPort}
- DB_HOSTNAME=${newsDBHost} - DB_HOSTNAME=${newsDBHost}
- DB_PORTNAME=${newsDBPort} - DB_PORTNAME=${newsDBPort}
@@ -268,6 +273,7 @@ services:
- traefik.http.routers.${authName}router.service=${authName}service@docker - traefik.http.routers.${authName}router.service=${authName}service@docker
- traefik.http.services.${authName}service.loadbalancer.server.port=${authPort} - traefik.http.services.${authName}service.loadbalancer.server.port=${authPort}
environment: environment:
- WEB_ORIGIN=${corsWebOrigin}
- WEB_PROTOCOL=https - WEB_PROTOCOL=https
- WEB_ADDRESS=${authWebAddress} - WEB_ADDRESS=${authWebAddress}
- HOOK_POST_VALIDATION_ARRAY=${authPostValidationHookArray} - HOOK_POST_VALIDATION_ARRAY=${authPostValidationHookArray}
@@ -309,6 +315,7 @@ services:
- traefik.http.routers.${chatName}router.service=${chatName}service@docker - traefik.http.routers.${chatName}router.service=${chatName}service@docker
- traefik.http.services.${chatName}service.loadbalancer.server.port=${chatPort} - traefik.http.services.${chatName}service.loadbalancer.server.port=${chatPort}
environment: environment:
- WEB_ORIGIN=${corsWebOrigin}
- WEB_PORT=${chatPort} - WEB_PORT=${chatPort}
- DB_HOSTNAME=${chatDBHost} - DB_HOSTNAME=${chatDBHost}
- DB_PORTNAME=${chatDBPort} - DB_PORTNAME=${chatDBPort}
@@ -376,7 +383,7 @@ networks:
FROM node:22-bookworm-slim FROM node:22-bookworm-slim
WORKDIR "/app" WORKDIR "/app"
COPY . /app COPY . /app
RUN mkdir /app/public RUN mkdir -p /app/public
RUN chown node:node /app/public RUN chown node:node /app/public
RUN npm install --production RUN npm install --production
EXPOSE ${projectPort} EXPOSE ${projectPort}
+3095 -2978
View File
File diff suppressed because it is too large Load Diff
+22 -26
View File
@@ -1,6 +1,6 @@
{ {
"name": "mern-template", "name": "mern-template",
"version": "1.5.1", "version": "1.5.4",
"description": "A website template using the MERN stack.", "description": "A website template using the MERN stack.",
"main": "server/server.js", "main": "server/server.js",
"scripts": { "scripts": {
@@ -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,33 @@
}, },
"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.4",
"@babel/preset-env": "^7.24.5", "@babel/preset-env": "^7.28.3",
"@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.1",
"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.2",
"express": "^4.19.2", "express": "^5.1.0",
"html-webpack-plugin": "^5.6.0", "html-webpack-plugin": "^5.6.4",
"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.1",
"react-dom": "^18.3.1", "react-dom": "^19.1.1",
"react-router": "^6.3.0", "react-router": "^7.7.1",
"react-router-dom": "^6.23.0", "react-select": "^5.10.2",
"react-select": "^5.8.0", "sequelize": "^6.37.7",
"sequelize": "^6.37.3", "socket.io-client": "^4.8.1",
"socket.io-client": "^4.7.5",
"style-loader": "^4.0.0", "style-loader": "^4.0.0",
"webpack": "^5.91.0", "webpack": "^5.101.3",
"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({