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 brain = require('brain.js') | |
const data = require('./data') | |
const express = require('express') | |
var app = express() | |
const cors = require('cors') | |
app.use(cors()) | |
var trainingData = [] | |
var maxClose = Math.max.apply(Math, data.map(function(o) { | |
return o.Close | |
})); |
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 initialState = { | |
result: [ | |
[] | |
], | |
sending: false, | |
keyArr: [], | |
dailyTrending: false | |
}; | |
export default function(state = initialState, action) { |
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
import axios from 'axios' | |
import * as RNLocalize from "react-native-localize"; | |
// const domain = "http://localhost:3001" | |
const domain = "https:apigoogletrends.herokuapp.com" | |
export const trendData = (trend1, trend2) => async (dispatch) => { | |
try { | |
dispatch({ | |
type: 'SENDING' | |
}) | |
console.log('dispatched') |
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
import React, { useEffect, useState, Fragment } from "react"; | |
import Chart from 'react-google-charts' | |
import { connect} from "react-redux"; | |
import {trendData, getTrending} from './actions/data' | |
import {PropTypes} from 'prop-types' | |
import loading from './loading.gif' | |
import Dropdown from 'react-dropdown'; | |
import 'react-dropdown/style.css'; | |
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 googleTrends = require('google-trends-api'); | |
var express = require('express') | |
var cors = require('cors') | |
var app = express() | |
app.use(cors()) | |
app.get("/", async (req, res) => { | |
res.json({ | |
'Ping': 'Pong' | |
}) |
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 initialState = { | |
training: false, | |
founding: false, | |
resultN: 0, | |
red: Math.random(), | |
green: Math.random(), | |
blue: Math.random(), | |
whiteReturning: false, | |
blackReturning: false, | |
predicting: false, |
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
import axios from 'axios' | |
// const domain = "http://localhost:4000" | |
const domain = "https://apicontrastpicker.herokuapp.com" | |
export const trainNetwork = () => async (dispatch) => { | |
try { | |
dispatch({ | |
type: 'TRAINING' | |
}) | |
console.log('Dispatching') | |
const result = await axios.get(`${domain}/train`) |
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
import React, { | |
useEffect, | |
useState, | |
Fragment | |
} from "react"; | |
import loading from './loading.gif' | |
import { | |
connect | |
} from "react-redux"; |
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 URI = "URL" | |
const connectDB = async () => { | |
try { | |
await mongoose.connect(URI, { | |
useUnifiedTopology: true, | |
useNewUrlParser: true | |
}) |
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
var express = require('express') | |
var app = express(); | |
const Train = require("./models/Train"); | |
const db = require('./mongoConnect.js') | |
const brain = require('brain.js') | |
const cors = require('cors') | |
const net = new brain.NeuralNetwork() | |
db() | |
app.use(cors()); | |
app.get('/', async (req, res) => { |