This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// client/src/App.js | |
import React, { Component } from "react"; | |
class App extends Component { | |
render() { | |
return <div>I'M READY TO USE THE BACK END APIS! :-)</div>; | |
} | |
} | |
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// client/src/index.js | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import App from './App'; | |
import registerServiceWorker from './registerServiceWorker'; | |
ReactDOM.render(<App />, document.getElementById('root')); | |
registerServiceWorker(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose'); | |
const express = require('express'); | |
var cors = require('cors'); | |
const bodyParser = require('body-parser'); | |
const logger = require('morgan'); | |
const Data = require('./data'); | |
const API_PORT = 3001; | |
const app = express(); | |
app.use(cors()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /backend/data.js | |
const mongoose = require("mongoose"); | |
const Schema = mongoose.Schema; | |
// this will be our data base's data structure | |
const DataSchema = new Schema( | |
{ | |
id: Number, | |
message: String | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /client/App.js | |
import React, { Component } from 'react'; | |
import axios from 'axios'; | |
class App extends Component { | |
// initialize our state | |
state = { | |
data: [], | |
id: 0, | |
message: null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "client", | |
"version": "0.1.0", | |
"private": true, | |
"dependencies": { | |
"axios": "^0.18.0", | |
"react": "^16.5.0", | |
"react-dom": "^16.5.0", | |
"react-scripts": "1.1.5" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "fullstack_app", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"start": "concurrently \"cd backend && node server.js\" \"cd client && npm start\"" | |
}, | |
"keywords": [], | |
"author": "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /src/App.js | |
import React, { Component } from 'react'; | |
class App extends Component { | |
render() { | |
return <div>I'm ready for changes</div>; | |
} | |
} | |
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /src/App.js | |
import React, { Component } from 'react'; | |
import Grid from '@material-ui/core/Grid'; | |
import Button from '@material-ui/core/Button'; | |
import { connect } from 'react-redux'; | |
import { | |
getCurrentPot, | |
sendNameToServer, | |
sendPitchInToServer, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /src/index.js | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import App from './App'; | |
import * as serviceWorker from './serviceWorker'; | |
import configureSocket from './socket'; | |
import { createStore } from 'redux'; | |
import reducer from './reducer'; | |
import { Provider } from 'react-redux'; | |
const store = createStore(reducer); |
OlderNewer