Skip to content

Commit

Permalink
Getting things ready for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
koushikkothagal committed Apr 10, 2021
1 parent 6736193 commit 62dd2bf
Show file tree
Hide file tree
Showing 35 changed files with 194 additions and 17 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<name>ipl-dashboard</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>16</java.version>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
Expand Down
4 changes: 3 additions & 1 deletion src/frontend/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
REACT_APP_DATA_START_YEAR=2008
REACT_APP_DATA_END_YEAR=2020
REACT_APP_DATA_END_YEAR=2020
REACT_APP_API_ROOT_URL=
# REACT_APP_API_ROOT_URL=http://localhost:8080 # Use this line when developing locally
2 changes: 1 addition & 1 deletion src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"build": "react-scripts build && xcopy .\\build\\* ..\\main\\resources\\public\\ /s /y",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import './App.scss';
import {BrowserRouter as Router, Route, Switch} from 'react-router-dom';
import {HashRouter as Router, Route, Switch} from 'react-router-dom';
import { TeamPage } from './pages/TeamPage';
import { MatchPage } from './pages/MatchPage';
import { HomePage } from './pages/HomePage';
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/components/YearSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const YearSelector = ({teamName}) => {
return (
<ol className="YearSelector">
{ years.map(year => (
<li>
<li key={year}>
<Link to={`/teams/${teamName}/matches/${year}`}>{year}</Link>
</li>
)) }
Expand Down
9 changes: 2 additions & 7 deletions src/frontend/src/pages/HomePage.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import { React, useEffect, useState } from 'react';
import { useParams, Link } from 'react-router-dom';
import { MatchDetailCard } from '../components/MatchDetailCard';
import { MatchSmallCard } from '../components/MatchSmallCard';
import { PieChart } from 'react-minimal-pie-chart';

import './HomePage.scss';
import { TeamTile } from '../components/TeamTile';

Expand All @@ -14,7 +9,7 @@ export const HomePage = () => {
useEffect(
() => {
const fetchAllTeams = async () => {
const response = await fetch(`http://localhost:8080/team`);
const response = await fetch(`${process.env.REACT_APP_API_ROOT_URL}/team`);
const data = await response.json();
setTeams(data);

Expand All @@ -32,7 +27,7 @@ export const HomePage = () => {
<h1 className="app-name">Java Brains IPL Dashboard</h1>
</div>
<div className="team-grid">
{ teams.map(team => <TeamTile teamName={team.teamName} />)}
{ teams.map(team => <TeamTile key={team.id} teamName={team.teamName} />)}
</div>
</div>

Expand Down
6 changes: 3 additions & 3 deletions src/frontend/src/pages/MatchPage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { React, useEffect, useState } from 'react';
import { useParams } from 'react-router-dom';
import { MatchDetailCard } from '../components/MatchDetailCard';
import { MatchSmallCard } from '../components/MatchSmallCard';

import { YearSelector } from '../components/YearSelector';

import './MatchPage.scss';
Expand All @@ -14,7 +14,7 @@ export const MatchPage = () => {
useEffect(
() => {
const fetchMatches = async () => {
const response = await fetch(`http://localhost:8080/team/${teamName}/matches?year=${year}`);
const response = await fetch(`${process.env.REACT_APP_API_ROOT_URL}/team/${teamName}/matches?year=${year}`);
const data = await response.json();
setMatches(data);

Expand All @@ -36,7 +36,7 @@ export const MatchPage = () => {
<div>
<h1 className="page-heading">{teamName} matches in {year}</h1>
{
matches.map(match => <MatchDetailCard teamName={teamName} match={match} />)
matches.map(match => <MatchDetailCard key={match.id} teamName={teamName} match={match} />)
}
</div>

Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/pages/TeamPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const TeamPage = () => {
useEffect(
() => {
const fetchTeam = async () => {
const response = await fetch(`http://localhost:8080/team/${teamName}`);
const response = await fetch(`${process.env.REACT_APP_API_ROOT_URL}/team/${teamName}`);
const data = await response.json();
setTeam(data);

Expand Down Expand Up @@ -47,7 +47,7 @@ export const TeamPage = () => {
<h3>Latest Matches</h3>
<MatchDetailCard teamName={team.teamName} match={team.matches[0]}/>
</div>
{team.matches.slice(1).map(match => <MatchSmallCard teamName={team.teamName} match={match} />)}
{team.matches.slice(1).map(match => <MatchSmallCard key={match.id} teamName={team.teamName} match={match} />)}
<div className="more-link">
<Link to={`/teams/${teamName}/matches/${process.env.REACT_APP_DATA_END_YEAR}`}>More ></Link>
</div>
Expand Down
22 changes: 22 additions & 0 deletions src/main/resources/public/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"files": {
"main.css": "/static/css/main.f9764921.chunk.css",
"main.js": "/static/js/main.45b031f2.chunk.js",
"main.js.map": "/static/js/main.45b031f2.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.0dfc2b39.js",
"runtime-main.js.map": "/static/js/runtime-main.0dfc2b39.js.map",
"static/js/2.540c4450.chunk.js": "/static/js/2.540c4450.chunk.js",
"static/js/2.540c4450.chunk.js.map": "/static/js/2.540c4450.chunk.js.map",
"static/js/3.ccc2f53f.chunk.js": "/static/js/3.ccc2f53f.chunk.js",
"static/js/3.ccc2f53f.chunk.js.map": "/static/js/3.ccc2f53f.chunk.js.map",
"index.html": "/index.html",
"static/css/main.f9764921.chunk.css.map": "/static/css/main.f9764921.chunk.css.map",
"static/js/2.540c4450.chunk.js.LICENSE.txt": "/static/js/2.540c4450.chunk.js.LICENSE.txt"
},
"entrypoints": [
"static/js/runtime-main.0dfc2b39.js",
"static/js/2.540c4450.chunk.js",
"static/css/main.f9764921.chunk.css",
"static/js/main.45b031f2.chunk.js"
]
}
Binary file added src/main/resources/public/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions src/main/resources/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><link href="/static/css/main.f9764921.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,a=r[0],c=r[1],f=r[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);p.length;)p.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"ccc2f53f"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/",i.oe=function(e){throw console.error(e),e};var a=this.webpackJsonpfrontend=this.webpackJsonpfrontend||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var f=0;f<a.length;f++)r(a[f]);var l=c;t()}([])</script><script src="/static/js/2.540c4450.chunk.js"></script><script src="/static/js/main.45b031f2.chunk.js"></script></body></html>
Binary file added src/main/resources/public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions src/main/resources/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
3 changes: 3 additions & 0 deletions src/main/resources/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
2 changes: 2 additions & 0 deletions src/main/resources/public/static/css/main.f9764921.chunk.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/main/resources/public/static/js/2.540c4450.chunk.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/

/** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.2
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.2
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.2
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/main/resources/public/static/js/2.82175949.chunk.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/

/** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.2
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.2
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.2
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

Large diffs are not rendered by default.

Loading

0 comments on commit 62dd2bf

Please sign in to comment.