This commit is contained in:
tparnell
2018-11-21 21:30:13 -05:00
commit 08bfb90652
22 changed files with 1500 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
node_modules/

View File

@@ -0,0 +1,18 @@
# This file contains information which helps Meteor properly upgrade your
# app when you run 'meteor update'. You should check it into version control
# with your project.
notices-for-0.9.0
notices-for-0.9.1
0.9.4-platform-file
notices-for-facebook-graph-api-2
1.2.0-standard-minifiers-package
1.2.0-meteor-platform-split
1.2.0-cordova-changes
1.2.0-breaking-changes
1.3.0-split-minifiers-package
1.4.0-remove-old-dev-bundle-link
1.4.1-add-shell-server-package
1.4.3-split-account-service-packages
1.5-add-dynamic-import-package
1.7-split-underscore-from-meteor-base

1
.meteor/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
local

7
.meteor/.id Normal file
View File

@@ -0,0 +1,7 @@
# This file contains a token that is unique to your project.
# Check it into your repository along with the rest of this directory.
# It can be used for purposes such as:
# - ensuring you don't accidentally deploy one app on top of another
# - providing package authors with aggregated statistics
av2oga6qqv5.lcwfkx2fpjh

22
.meteor/packages Normal file
View File

@@ -0,0 +1,22 @@
# Meteor packages used by this project, one per line.
# Check this file (and the other files in this directory) into your repository.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.
meteor-base@1.4.0 # Packages every Meteor app needs to have
mobile-experience@1.0.5 # Packages for a great mobile UX
mongo@1.6.0 # The database Meteor supports right now
reactive-var@1.0.11 # Reactive variable for tracker
standard-minifier-css@1.5.0 # CSS minifier run for production mode
standard-minifier-js@2.4.0 # JS minifier run for production mode
es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers
ecmascript@0.12.0 # Enable ECMAScript2015+ syntax in app code
shell-server@0.4.0 # Server-side component of the `meteor shell` command
autopublish@1.0.7 # Publish all data to the clients (for prototyping)
insecure@1.0.7 # Allow all DB writes from clients (for prototyping)
static-html # Define static page content in .html files
react-meteor-data # React higher-order component for reactively tracking Meteor data
mdg:geolocation

2
.meteor/platforms Normal file
View File

@@ -0,0 +1,2 @@
server
browser

1
.meteor/release Normal file
View File

@@ -0,0 +1 @@
METEOR@1.8

73
.meteor/versions Normal file
View File

@@ -0,0 +1,73 @@
allow-deny@1.1.0
autopublish@1.0.7
autoupdate@1.5.0
babel-compiler@7.2.0
babel-runtime@1.3.0
base64@1.0.11
binary-heap@1.0.11
blaze-tools@1.0.10
boilerplate-generator@1.6.0
caching-compiler@1.2.0
caching-html-compiler@1.1.3
callback-hook@1.1.0
check@1.3.1
ddp@1.4.0
ddp-client@2.3.3
ddp-common@1.4.0
ddp-server@2.2.0
deps@1.0.12
diff-sequence@1.1.0
dynamic-import@0.5.0
ecmascript@0.12.0
ecmascript-runtime@0.7.0
ecmascript-runtime-client@0.8.0
ecmascript-runtime-server@0.7.1
ejson@1.1.0
es5-shim@4.8.0
fetch@0.1.0
geojson-utils@1.0.10
hot-code-push@1.0.4
html-tools@1.0.11
htmljs@1.0.11
id-map@1.1.0
insecure@1.0.7
inter-process-messaging@0.1.0
launch-screen@1.1.1
livedata@1.0.18
logging@1.1.20
mdg:geolocation@1.3.0
meteor@1.9.2
meteor-base@1.4.0
minifier-css@1.4.0
minifier-js@2.4.0
minimongo@1.4.5
mobile-experience@1.0.5
mobile-status-bar@1.0.14
modern-browsers@0.1.2
modules@0.13.0
modules-runtime@0.10.2
mongo@1.6.0
mongo-decimal@0.1.0
mongo-dev-server@1.1.0
mongo-id@1.0.7
npm-mongo@3.1.1
ordered-dict@1.1.0
promise@0.11.1
random@1.1.0
react-meteor-data@0.2.16
reactive-var@1.0.11
reload@1.2.0
retry@1.1.0
routepolicy@1.1.0
shell-server@0.4.0
socket-stream-client@0.2.2
spacebars-compiler@1.1.3
standard-minifier-css@1.5.0
standard-minifier-js@2.4.0
static-html@1.2.2
templating-tools@1.1.2
tmeasday:check-npm-versions@0.3.2
tracker@1.2.0
underscore@1.0.10
webapp@1.7.0
webapp-hashing@1.0.9

4
client/main.css Normal file
View File

@@ -0,0 +1,4 @@
body {
margin: 0;
padding: 0;
}

9
client/main.html Normal file
View File

@@ -0,0 +1,9 @@
<head>
<title>stroll</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" />
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
</head>
<body>
<div id="react-target"></div>
</body>

8
client/main.jsx Normal file
View File

@@ -0,0 +1,8 @@
import React from 'react';
import { Meteor } from 'meteor/meteor';
import { render } from 'react-dom';
import App from '/imports/ui/App'
Meteor.startup(() => {
render(<App />, document.getElementById('react-target'));
});

3
imports/api/links.js Normal file
View File

@@ -0,0 +1,3 @@
import { Mongo } from 'meteor/mongo';
export default Links = new Mongo.Collection('links');

19
imports/ui/App.jsx Normal file
View File

@@ -0,0 +1,19 @@
import React, { createContext } from "react";
import { Grid, AppBar, Toolbar, Typography } from "@material-ui/core";
import Header from "./Header.jsx";
import Table from "./Table";
import Map from "./Map";
const App = () => (
<Grid container direction="row">
<Header />
<Grid item xs={12}>
<Map />
</Grid>
<Grid item xs={12}>
<Table />
</Grid>
</Grid>
);
export default App;

13
imports/ui/Header.jsx Normal file
View File

@@ -0,0 +1,13 @@
import React from 'react';
import { AppBar, Toolbar, Typography } from '@material-ui/core';
export default function Header() {
return (
<AppBar style={{marginBottom: ".5rem"}} position="static">
<Toolbar>
<Typography variant="h6" color="inherit">
Stroll
</Typography>
</Toolbar>
</AppBar>
);
}

31
imports/ui/Map.jsx Normal file
View File

@@ -0,0 +1,31 @@
import React from "react";
import {
withScriptjs,
withGoogleMap,
GoogleMap,
Marker
} from "react-google-maps";
import { eventLocations } from './eventLocations.js';
const markers = eventLocations.map( i => <Marker position={{lat: i.lat, lng: i.lng}} />)
const MyMapComponent = withScriptjs(
withGoogleMap(props => (
<GoogleMap defaultZoom={14} defaultCenter={{ lat: 42.7564758, lng: -71.4673018 }}>
{markers}
</GoogleMap>
))
);
export default function() {
return (
<div>
<MyMapComponent
isMarkerShown
googleMapURL={"https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=geometry,drawing,places&key=AIzaSyCPvocvFiqD8QJ8pH9_BjEUzjQZhmalfoE "}
mapElement={<div style={{ position: "relative", height: `100%` }} />}
containerElement={<div style={{height: "50vh"}} />}
loadingElement={<div />}
/>
</div>
);
}

39
imports/ui/Stroll.js Normal file
View File

@@ -0,0 +1,39 @@
import { CHURCH, HUNT } from './eventLocations.js';
export const events = {
[CHURCH]: [
{
name: "The granite Statesman",
startTime: 1,
endTime: 2
},
{
name: "New england voices in harmony",
startTime: 2,
endTime: 3
},
{
name: "Jazz Fest",
startTime: 3,
endTime: 4
}
],
[HUNT]: [
{
name: "Joe Harnett",
startTime: 1,
endTime: 2,
},
{
name: "The switch house ramblers",
startTime: 2,
endTime: 3,
},
{
name: "The switch house ramblers",
startTime: 3,
endTime: 4,
}
]
}

37
imports/ui/Table.jsx Normal file
View File

@@ -0,0 +1,37 @@
import React, { Fragment } from "react";
import {
Table,
Grid,
TableHead,
TableCell,
TableBody,
TableRow
} from "@material-ui/core";
import { events } from "./Stroll.js";
export default function() {
let rows = Object.keys(events).map((item, index) => {
let arrayOfEvents = events[item];
let eventsAsCells = arrayOfEvents.sort(i => -i.startTime).map(i => <TableCell>{i.name}</TableCell>);
let cells = [
<Fragment>
<TableCell>{index + 1}</TableCell>
<TableCell>{item}</TableCell>
</Fragment>
].concat(eventsAsCells);
return <TableRow>{cells}</TableRow>;
});
return (
<Table>
<TableHead>
<TableRow>
<TableCell>#</TableCell>
<TableCell>Place</TableCell>
<TableCell>5:45-6:15</TableCell>
<TableCell>7:10-8:10</TableCell>
<TableCell>8:35-9:45</TableCell>
</TableRow>
</TableHead>
<TableBody>{rows}</TableBody>
</Table>
);
}

View File

@@ -0,0 +1,9 @@
export const CHURCH = "First Church";
export const HUNT = "Hunt Memorial Building";
export const FODYS = "Fodys Tavern";
export const CHRISTMASS_TREE = "City Christmas Tree stage";
export const eventLocations = [
{ name: CHURCH, lat: 42.7657596, lng: -71.4689868 },
{ name: HUNT, lat: 42.7651657, lng: -71.4693774 }
];

28
package.json Normal file
View File

@@ -0,0 +1,28 @@
{
"name": "stroll",
"private": true,
"scripts": {
"start": "meteor run",
"test": "meteor test --once --driver-package meteortesting:mocha",
"test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha",
"visualize": "meteor --production --extra-packages bundle-visualizer"
},
"dependencies": {
"@babel/runtime": "^7.0.0",
"@material-ui/core": "^3.5.1",
"@material-ui/icons": "^3.0.1",
"meteor-node-stubs": "^0.4.1",
"react": "^16.5.0",
"react-dom": "^16.5.0",
"react-google-maps": "^9.4.5",
"react-redux": "^5.1.1",
"redux": "^4.0.1"
},
"meteor": {
"mainModule": {
"client": "client/main.jsx",
"server": "server/main.js"
},
"testModule": "tests/main.js"
}
}

31
server/main.js Normal file
View File

@@ -0,0 +1,31 @@
import { Meteor } from 'meteor/meteor';
import Links from '/imports/api/links';
function insertLink(title, url) {
Links.insert({ title, url, createdAt: new Date() });
}
Meteor.startup(() => {
// If the Links collection is empty, add some data.
if (Links.find().count() === 0) {
insertLink(
'Do the Tutorial',
'https://www.meteor.com/tutorials/react/creating-an-app'
);
insertLink(
'Follow the Guide',
'http://guide.meteor.com'
);
insertLink(
'Read the Docs',
'https://docs.meteor.com'
);
insertLink(
'Discussions',
'https://forums.meteor.com'
);
}
});

20
tests/main.js Normal file
View File

@@ -0,0 +1,20 @@
import assert from "assert";
describe("stroll", function () {
it("package.json has correct name", async function () {
const { name } = await import("../package.json");
assert.strictEqual(name, "stroll");
});
if (Meteor.isClient) {
it("client is not server", function () {
assert.strictEqual(Meteor.isServer, false);
});
}
if (Meteor.isServer) {
it("server is not client", function () {
assert.strictEqual(Meteor.isClient, false);
});
}
});

1124
yarn.lock Normal file

File diff suppressed because it is too large Load Diff