Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 335c7008aa | |||
| e89b0645ca | |||
| 36e79a513f | |||
| 6ef0affcf6 | |||
| cb0c1284bf | |||
| 5cf4b66894 | |||
| 45cf281c91 | |||
| 2794b4c724 | |||
| b1f49a4166 | |||
| 4cbf67dcbb | |||
| fd29385cf8 |
@@ -56,6 +56,7 @@ To set up this template in development mode:
|
|||||||
- Account deletion
|
- Account deletion
|
||||||
- Password management
|
- Password management
|
||||||
- JSON web token authentication
|
- JSON web token authentication
|
||||||
|
- HttpOnly cookies for security
|
||||||
- Optional post validation hook
|
- Optional post validation hook
|
||||||
- Fully Featured News Blog (as a microservice)
|
- Fully Featured News Blog (as a microservice)
|
||||||
- Publish, edit or delete articles as needed
|
- Publish, edit or delete articles as needed
|
||||||
|
|||||||
+9
-7
@@ -2,14 +2,16 @@
|
|||||||
import 'regenerator-runtime/runtime';
|
import 'regenerator-runtime/runtime';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom/client';
|
||||||
|
|
||||||
import App from './pages/app';
|
import App from './pages/app';
|
||||||
import TokenProvider from './pages/utilities/token-provider';
|
import TokenProvider from './pages/utilities/token-provider';
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM
|
||||||
<TokenProvider>
|
.createRoot(document.getElementById('root'))
|
||||||
<App />
|
.render(
|
||||||
</TokenProvider>,
|
<TokenProvider>
|
||||||
document.querySelector('#root')
|
<App />
|
||||||
);
|
</TokenProvider>
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useContext, useRef } from 'react';
|
import React, { useEffect, useContext, useRef } from 'react';
|
||||||
import { Link, Redirect } from 'react-router-dom';
|
import { Link, Navigate } from 'react-router-dom';
|
||||||
|
|
||||||
import ApplyToBody from '../utilities/apply-to-body';
|
import ApplyToBody from '../utilities/apply-to-body';
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ const Account = props => {
|
|||||||
|
|
||||||
//misplaced?
|
//misplaced?
|
||||||
if (!authTokens.accessToken) {
|
if (!authTokens.accessToken) {
|
||||||
return <Redirect to='/' />;
|
return <Navigate to='/' />;
|
||||||
}
|
}
|
||||||
|
|
||||||
//refs
|
//refs
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useContext, useRef } from 'react';
|
import React, { useContext, useRef } from 'react';
|
||||||
import { Link, Redirect } from 'react-router-dom';
|
import { Link, Navigate } from 'react-router-dom';
|
||||||
|
|
||||||
import ApplyToBody from '../utilities/apply-to-body';
|
import ApplyToBody from '../utilities/apply-to-body';
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ const Login = props => {
|
|||||||
|
|
||||||
//misplaced?
|
//misplaced?
|
||||||
if (authTokens.accessToken) {
|
if (authTokens.accessToken) {
|
||||||
return <Redirect to='/' />;
|
return <Navigate to='/' />;
|
||||||
}
|
}
|
||||||
|
|
||||||
//refs
|
//refs
|
||||||
@@ -40,7 +40,7 @@ const Login = props => {
|
|||||||
if (accessToken) {
|
if (accessToken) {
|
||||||
authTokens.setAccessToken(accessToken);
|
authTokens.setAccessToken(accessToken);
|
||||||
|
|
||||||
props.history.push('/');
|
return <Navigate to='/' />;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}>
|
}>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useContext, useRef } from 'react';
|
import React, { useContext, useRef } from 'react';
|
||||||
import { Link, Redirect } from 'react-router-dom';
|
import { Link, useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
import ApplyToBody from '../utilities/apply-to-body';
|
import ApplyToBody from '../utilities/apply-to-body';
|
||||||
|
|
||||||
@@ -9,12 +9,15 @@ import { TokenContext } from '../utilities/token-provider';
|
|||||||
const validateEmail = require('../../../common/utilities/validate-email');
|
const validateEmail = require('../../../common/utilities/validate-email');
|
||||||
|
|
||||||
const Recover = props => {
|
const Recover = props => {
|
||||||
|
//history
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
//context
|
//context
|
||||||
const authTokens = useContext(TokenContext);
|
const authTokens = useContext(TokenContext);
|
||||||
|
|
||||||
//misplaced?
|
//misplaced?
|
||||||
if (authTokens.accessToken) {
|
if (authTokens.accessToken) {
|
||||||
return <Redirect to='/' />;
|
navigate("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
//refs
|
//refs
|
||||||
@@ -39,7 +42,7 @@ const Recover = props => {
|
|||||||
|
|
||||||
//redirect
|
//redirect
|
||||||
if (redirect) {
|
if (redirect) {
|
||||||
props.history.push('/');
|
navigate("/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}>
|
}>
|
||||||
|
|||||||
@@ -1,21 +1,23 @@
|
|||||||
import React, { useContext, useRef } from 'react';
|
import React, { useContext, useRef } from 'react';
|
||||||
import { Link, Redirect } from 'react-router-dom';
|
import { Link, useNavigate, useSearchParams } from 'react-router-dom';
|
||||||
import queryString from 'query-string';
|
|
||||||
|
|
||||||
import ApplyToBody from '../utilities/apply-to-body';
|
import ApplyToBody from '../utilities/apply-to-body';
|
||||||
|
|
||||||
import { TokenContext } from '../utilities/token-provider';
|
import { TokenContext } from '../utilities/token-provider';
|
||||||
|
|
||||||
const Reset = props => {
|
const Reset = props => {
|
||||||
|
//params
|
||||||
|
const [params, setParams] = useSearchParams(); //the URLSearchParams API
|
||||||
|
|
||||||
|
//history
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
//context
|
//context
|
||||||
const authTokens = useContext(TokenContext);
|
const authTokens = useContext(TokenContext);
|
||||||
|
|
||||||
//query
|
|
||||||
const query = queryString.parse(props.location.search);
|
|
||||||
|
|
||||||
//misplaced?
|
//misplaced?
|
||||||
if (authTokens.accessToken || !query.email || !query.token) {
|
if (authTokens.accessToken || !params.has('email') || !params.has('token')) {
|
||||||
return <Redirect to='/' />;
|
navigate("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
//refs
|
//refs
|
||||||
@@ -31,7 +33,7 @@ const Reset = props => {
|
|||||||
<h1 className='text centered'>Reset Password</h1>
|
<h1 className='text centered'>Reset Password</h1>
|
||||||
<form className='constrained' onSubmit={async evt => {
|
<form className='constrained' onSubmit={async evt => {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
const [err, redirect] = await update(passwordRef.current.value, retypeRef.current.value, query);
|
const [err, redirect] = await update(passwordRef.current.value, retypeRef.current.value, params);
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
alert(err);
|
alert(err);
|
||||||
@@ -42,7 +44,7 @@ const Reset = props => {
|
|||||||
|
|
||||||
//redirect
|
//redirect
|
||||||
if (redirect) {
|
if (redirect) {
|
||||||
props.history.push('/');
|
navigate("/");
|
||||||
}
|
}
|
||||||
}}>
|
}}>
|
||||||
<input type='password' name='password' placeholder='New Password' ref={passwordRef} />
|
<input type='password' name='password' placeholder='New Password' ref={passwordRef} />
|
||||||
@@ -56,7 +58,7 @@ const Reset = props => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const update = async (password, retype, query) => {
|
const update = async (password, retype, params) => {
|
||||||
if (password != retype) {
|
if (password != retype) {
|
||||||
return ['Passwords do not match'];
|
return ['Passwords do not match'];
|
||||||
}
|
}
|
||||||
@@ -65,7 +67,7 @@ const update = async (password, retype, query) => {
|
|||||||
return ['Password is too short'];
|
return ['Password is too short'];
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await fetch(`${process.env.AUTH_URI}/auth/reset?email=${query.email}&token=${query.token}`, {
|
const result = await fetch(`${process.env.AUTH_URI}/auth/reset?email=${params.get('email')}&token=${params.get('token')}`, {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useContext, useRef } from 'react';
|
import React, { useContext, useRef } from 'react';
|
||||||
import { Link, Redirect } from 'react-router-dom';
|
import { Link, useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
import ApplyToBody from '../utilities/apply-to-body';
|
import ApplyToBody from '../utilities/apply-to-body';
|
||||||
|
|
||||||
@@ -10,12 +10,15 @@ const validateEmail = require('../../../common/utilities/validate-email');
|
|||||||
const validateUsername = require('../../../common/utilities/validate-username');
|
const validateUsername = require('../../../common/utilities/validate-username');
|
||||||
|
|
||||||
const Signup = props => {
|
const Signup = props => {
|
||||||
|
//history
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
//context
|
//context
|
||||||
const authTokens = useContext(TokenContext);
|
const authTokens = useContext(TokenContext);
|
||||||
|
|
||||||
//misplaced?
|
//misplaced?
|
||||||
if (authTokens.accessToken) {
|
if (authTokens.accessToken) {
|
||||||
return <Redirect to='/' />;
|
navigate("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
//refs
|
//refs
|
||||||
@@ -44,7 +47,7 @@ const Signup = props => {
|
|||||||
|
|
||||||
//redirect
|
//redirect
|
||||||
if (redirect) {
|
if (redirect) {
|
||||||
props.history.push('/');
|
navigate("/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}>
|
}>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useContext } from 'react';
|
import React, { useContext } from 'react';
|
||||||
import { Link, Redirect } from 'react-router-dom';
|
import { Link, Navigate } from 'react-router-dom';
|
||||||
|
|
||||||
import ApplyToBody from '../utilities/apply-to-body';
|
import ApplyToBody from '../utilities/apply-to-body';
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ const Admin = props => {
|
|||||||
|
|
||||||
//misplaced? (admin only)
|
//misplaced? (admin only)
|
||||||
if (!authTokens.accessToken || !authTokens.getPayload().admin) {
|
if (!authTokens.accessToken || !authTokens.getPayload().admin) {
|
||||||
return <Redirect to='/' />;
|
return <Navigate to='/' />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useContext } from 'react';
|
import React, { useContext } from 'react';
|
||||||
import { Link, Redirect } from 'react-router-dom';
|
import { Link, Navigate } from 'react-router-dom';
|
||||||
|
|
||||||
import ApplyToBody from '../utilities/apply-to-body';
|
import ApplyToBody from '../utilities/apply-to-body';
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ const Mod = props => {
|
|||||||
|
|
||||||
//misplaced? (admin only)
|
//misplaced? (admin only)
|
||||||
if (!authTokens.accessToken || !(authTokens.getPayload().admin || authTokens.getPayload().mod)) {
|
if (!authTokens.accessToken || !(authTokens.getPayload().admin || authTokens.getPayload().mod)) {
|
||||||
return <Redirect to='/' />;
|
return <Navigate to='/' />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -7,16 +7,13 @@ const ChatReports = props => {
|
|||||||
|
|
||||||
const authTokens = useContext(TokenContext);
|
const authTokens = useContext(TokenContext);
|
||||||
|
|
||||||
useEffect(async () => {
|
useEffect(() => {
|
||||||
const result = await authTokens.tokenFetch(`${process.env.CHAT_URI}/admin/reports`);
|
authTokens.tokenFetch(`${process.env.CHAT_URI}/admin/reports`)
|
||||||
|
.then(res => res.json())
|
||||||
if (!result.ok) {
|
.then(json => {
|
||||||
const err = `${result.status}: ${await result.text()}`;
|
setReports(json);
|
||||||
console.log(err);
|
})
|
||||||
alert(err);
|
;
|
||||||
} else {
|
|
||||||
setReports(await result.json());
|
|
||||||
}
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -17,16 +17,13 @@ const NewsEditor = props => {
|
|||||||
const [index, setIndex] = useState(null);
|
const [index, setIndex] = useState(null);
|
||||||
|
|
||||||
//run once
|
//run once
|
||||||
useEffect(async () => {
|
useEffect(() => {
|
||||||
const result = await fetch(`${process.env.NEWS_URI}/news/metadata?limit=999`);
|
fetch(`${process.env.NEWS_URI}/news/metadata?limit=999`)
|
||||||
|
.then(res => res.json())
|
||||||
if (!result.ok) {
|
.then(json => {
|
||||||
const err = `${result.status}: ${await result.text()}`;
|
setArticles(json)
|
||||||
console.log(err);
|
})
|
||||||
alert(err);
|
;
|
||||||
} else {
|
|
||||||
setArticles(await result.json());
|
|
||||||
}
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
+34
-21
@@ -1,11 +1,8 @@
|
|||||||
//react
|
//react
|
||||||
import React, { useContext } from 'react';
|
import React, { useContext, Suspense, lazy } from 'react';
|
||||||
import { BrowserRouter, Switch } from 'react-router-dom';
|
import { BrowserRouter, Routes, Route } from 'react-router-dom';
|
||||||
import { TokenContext } from './utilities/token-provider';
|
import { TokenContext } from './utilities/token-provider';
|
||||||
|
|
||||||
//library components
|
|
||||||
import LazyRoute from './utilities/lazy-route';
|
|
||||||
|
|
||||||
//styling
|
//styling
|
||||||
import '../styles/styles.css';
|
import '../styles/styles.css';
|
||||||
|
|
||||||
@@ -13,33 +10,49 @@ import '../styles/styles.css';
|
|||||||
import Footer from './panels/footer';
|
import Footer from './panels/footer';
|
||||||
import PopupChat from './panels/popup-chat';
|
import PopupChat from './panels/popup-chat';
|
||||||
|
|
||||||
|
//lazy wrappers
|
||||||
|
const Homepage = lazy(() => import('./homepage'));
|
||||||
|
const Signup = lazy(() => import('./accounts/signup'));
|
||||||
|
const Login = lazy(() => import('./accounts/login'));
|
||||||
|
const Account = lazy(() => import('./accounts/account'));
|
||||||
|
const Dashboard = lazy(() => import('./dashboard'));
|
||||||
|
const Recover = lazy(() => import('./accounts/recover'));
|
||||||
|
const Reset = lazy(() => import('./accounts/reset'));
|
||||||
|
const Admin = lazy(() => import('./administration/admin'));
|
||||||
|
const Mod = lazy(() => import('./administration/mod'));
|
||||||
|
const PrivacyPolicy = lazy(() => import('./static/privacy-policy'));
|
||||||
|
const Credits = lazy(() => import('./static/credits'));
|
||||||
|
const NotFound = lazy(() => import('./not-found'));
|
||||||
|
|
||||||
const App = props => {
|
const App = props => {
|
||||||
const authTokens = useContext(TokenContext);
|
const authTokens = useContext(TokenContext);
|
||||||
|
|
||||||
//default render
|
//default render
|
||||||
return (
|
return (
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<Switch>
|
<Suspense>
|
||||||
<LazyRoute exact path='/' component={() => import('./homepage')} />
|
<Routes>
|
||||||
|
<Route exact path='/' element={<Homepage />} />
|
||||||
|
|
||||||
<LazyRoute path='/signup' component={() => import('./accounts/signup')} />
|
<Route path='/signup' element={<Signup />} />
|
||||||
<LazyRoute path='/login' component={() => import('./accounts/login')} />
|
<Route path='/login' element={<Login />} />
|
||||||
<LazyRoute path='/account' component={() => import('./accounts/account')} />
|
<Route path='/account' element={<Account />} />
|
||||||
<LazyRoute path='/dashboard' component={() => import('./dashboard')} />
|
<Route path='/dashboard' element={<Dashboard />} />
|
||||||
|
|
||||||
<LazyRoute path='/recover' component={() => import('./accounts/recover')} />
|
<Route path='/recover' element={<Recover />} />
|
||||||
<LazyRoute path='/reset' component={() => import('./accounts/reset')} />
|
<Route path='/reset' element={<Reset />} />
|
||||||
|
|
||||||
<LazyRoute path='/admin' component={() => import('./administration/admin')} />
|
<Route path='/admin' element={<Admin />} />
|
||||||
<LazyRoute path='/mod' component={() => import('./administration/mod')} />
|
<Route path='/mod' element={<Mod />} />
|
||||||
|
|
||||||
<LazyRoute path='/privacypolicy' component={() => import('./static/privacy-policy')} />
|
<Route path='/privacypolicy' element={<PrivacyPolicy />} />
|
||||||
<LazyRoute path='/credits' component={() => import('./static/credits')} />
|
<Route path='/credits' element={<Credits />} />
|
||||||
|
|
||||||
<LazyRoute path='*' component={() => import('./not-found')} />
|
<Route path='*' element={<NotFound />} />
|
||||||
</Switch>
|
</Routes>
|
||||||
{ authTokens.accessToken ? <PopupChat /> : <></> }
|
</Suspense>
|
||||||
<Footer />
|
{ authTokens.accessToken ? <PopupChat /> : <></> }
|
||||||
|
<Footer />
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useContext } from 'react';
|
import React, { useContext } from 'react';
|
||||||
import { Link, Redirect } from 'react-router-dom';
|
import { Link, Navigate } from 'react-router-dom';
|
||||||
|
|
||||||
import ApplyToBody from './utilities/apply-to-body';
|
import ApplyToBody from './utilities/apply-to-body';
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ const Dashboard = props => {
|
|||||||
|
|
||||||
//misplaced?
|
//misplaced?
|
||||||
if (!authTokens.accessToken) {
|
if (!authTokens.accessToken) {
|
||||||
return <Redirect to='/' />;
|
return <Navigate to='/' />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useContext } from 'react';
|
import React, { useContext } from 'react';
|
||||||
import { Link, Redirect } from 'react-router-dom';
|
import { Link, Navigate } from 'react-router-dom';
|
||||||
|
|
||||||
import ApplyToBody from './utilities/apply-to-body';
|
import ApplyToBody from './utilities/apply-to-body';
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ const HomePage = props => {
|
|||||||
|
|
||||||
//misplaced?
|
//misplaced?
|
||||||
if (authTokens.accessToken) {
|
if (authTokens.accessToken) {
|
||||||
return <Redirect to='/dashboard' />;
|
return <Navigate to='/dashboard' />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ const NewsFeed = props => {
|
|||||||
<div className='panel'>
|
<div className='panel'>
|
||||||
<h1 className='text centered'>News Feed</h1>
|
<h1 className='text centered'>News Feed</h1>
|
||||||
{articles.map((article, index) => {
|
{articles.map((article, index) => {
|
||||||
console.log(article)
|
|
||||||
return (
|
return (
|
||||||
<div key={index} className='panel'>
|
<div key={index} className='panel'>
|
||||||
<hr />
|
<hr />
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import { Route } from 'react-router-dom';
|
|
||||||
import loadable from '@loadable/component';
|
|
||||||
|
|
||||||
const LazyRoute = props => {
|
|
||||||
const { component, ...lazyProps } = props;
|
|
||||||
|
|
||||||
const lazyComponent = loadable(component);
|
|
||||||
|
|
||||||
return <Route {...lazyProps} component={lazyComponent} />
|
|
||||||
};
|
|
||||||
|
|
||||||
export default LazyRoute;
|
|
||||||
@@ -9,6 +9,12 @@ const TokenProvider = props => {
|
|||||||
//state to be used
|
//state to be used
|
||||||
const [accessToken, setAccessToken] = useState('');
|
const [accessToken, setAccessToken] = useState('');
|
||||||
|
|
||||||
|
//force a logout under certain conditions
|
||||||
|
const forceLogout = () => {
|
||||||
|
localStorage.removeItem("accessToken");
|
||||||
|
setAccessToken("");
|
||||||
|
};
|
||||||
|
|
||||||
//make the access token persist between reloads
|
//make the access token persist between reloads
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setAccessToken(localStorage.getItem("accessToken") || '');
|
setAccessToken(localStorage.getItem("accessToken") || '');
|
||||||
@@ -47,6 +53,9 @@ const TokenProvider = props => {
|
|||||||
|
|
||||||
//any errors, throw them
|
//any errors, throw them
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
if (response.status == 403) {
|
||||||
|
forceLogout();
|
||||||
|
}
|
||||||
throw `${response.status}: ${await response.text()}`;
|
throw `${response.status}: ${await response.text()}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,6 +91,9 @@ const TokenProvider = props => {
|
|||||||
|
|
||||||
//any errors, throw them
|
//any errors, throw them
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
if (response.status == 403) {
|
||||||
|
forceLogout();
|
||||||
|
}
|
||||||
throw `${response.status}: ${await response.text()}`;
|
throw `${response.status}: ${await response.text()}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,6 @@
|
|||||||
<meta property="og:description" content="" />
|
<meta property="og:description" content="" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id = "root"></div>
|
<div id="root"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+1
-1
@@ -278,7 +278,7 @@ networks:
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const dockerfile = `
|
const dockerfile = `
|
||||||
FROM node:16
|
FROM node:18
|
||||||
WORKDIR "/app"
|
WORKDIR "/app"
|
||||||
COPY . /app
|
COPY . /app
|
||||||
RUN mkdir /app/public
|
RUN mkdir /app/public
|
||||||
|
|||||||
Generated
+879
-6604
File diff suppressed because it is too large
Load Diff
+27
-29
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mern-template",
|
"name": "mern-template",
|
||||||
"version": "1.3.0",
|
"version": "1.4.0",
|
||||||
"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": {
|
||||||
@@ -27,36 +27,34 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/KRGameStudios/MERN-template#readme",
|
"homepage": "https://github.com/KRGameStudios/MERN-template#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/core": "^7.14.8",
|
"@babel/core": "^7.20.5",
|
||||||
"@babel/preset-env": "^7.14.8",
|
"@babel/preset-env": "^7.20.2",
|
||||||
"@babel/preset-react": "^7.14.5",
|
"@babel/preset-react": "^7.18.6",
|
||||||
"@loadable/component": "^5.15.0",
|
"babel-loader": "^8.3.0",
|
||||||
"babel-loader": "^8.2.2",
|
"clean-webpack-plugin": "^4.0.0",
|
||||||
"clean-webpack-plugin": "^3.0.0",
|
"compression-webpack-plugin": "^10.0.0",
|
||||||
"compression-webpack-plugin": "^8.0.1",
|
"concurrently": "^7.6.0",
|
||||||
"concurrently": "^6.2.0",
|
"css-loader": "^6.7.2",
|
||||||
"css-loader": "^6.2.0",
|
"dateformat": "^5.0.3",
|
||||||
"dateformat": "^4.5.1",
|
"dotenv": "^16.0.3",
|
||||||
"dotenv": "^10.0.0",
|
"express": "^4.18.2",
|
||||||
"express": "^4.17.1",
|
"html-webpack-plugin": "^5.5.0",
|
||||||
"html-webpack-plugin": "^5.3.2",
|
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"mariadb": "^2.5.4",
|
"mariadb": "^3.0.2",
|
||||||
"query-string": "^7.0.1",
|
"react": "^18.2.0",
|
||||||
"react": "^17.0.2",
|
"react-dom": "^18.2.0",
|
||||||
"react-dom": "^17.0.2",
|
"react-router": "^6.3.0",
|
||||||
"react-router": "^5.2.0",
|
"react-router-dom": "^6.4.3",
|
||||||
"react-router-dom": "^5.2.0",
|
"react-select": "^5.6.1",
|
||||||
"react-select": "^5.2.1",
|
"sequelize": "^6.25.8",
|
||||||
"sequelize": "^6.6.5",
|
"socket.io-client": "^4.5.4",
|
||||||
"socket.io-client": "^4.1.3",
|
"style-loader": "^3.3.1",
|
||||||
"style-loader": "^3.2.1",
|
"webpack": "^5.75.0",
|
||||||
"webpack": "^5.46.0",
|
"webpack-bundle-analyzer": "^4.7.0",
|
||||||
"webpack-bundle-analyzer": "^4.4.2",
|
"webpack-cli": "^4.10.0"
|
||||||
"webpack-cli": "^4.7.2"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"nodemon": "^2.0.12",
|
"nodemon": "^2.0.20",
|
||||||
"webpack-dev-server": "^4.6.0"
|
"webpack-dev-server": "^4.11.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user