<commit_before>// this is the main entry point for the app
// it renders the App component after wrapping it in the Provider from Redux

import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, combineReducers } from 'redux';
import { Provider } from 'react-redux';
import { Router, Route, IndexRoute, browserHistory, Link } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';

import App from './components/App';
import MainRecipe from './components/MainRecipe';
import Profile from './components/Profile';
import Dashboard from './components/Dashboard';
import SearchResults from './components/SearchResults';
import ImageUpload from './components/ImageUpload.js';
import CreateRecipe from './components/CreateRecipe';

import rootReducer from './reducers';

// Grab the state from a global injected into server-generated HTML
const initialState = window.__INITIAL_STATE__;

// Create Redux store with initial state
// the store manages the state of our app
// createStore accepts a single reducer or a collection of reducers
const store = createStore(rootReducer, initialState);

const history = syncHistoryWithStore(browserHistory, store);

const render = function () {
  ReactDOM.render(
    <Provider store={store}>
      <div>
        <Router history={history}>
          <Route path="/" component={App}>
            <IndexRoute component={Dashboard} />
            <Route path="/profile" component={Profile} />
            <Route path="/recipe" component={MainRecipe} />
            <Route path="/dashboard" component={Dashboard} />
            <Route path="/create" component={CreateRecipe} />
            <Route path="/search" component={SearchResults} />
            <Route path="/*" component={Dashboard} />
          </Route>
        </Router>
      </div>

    </Provider>,
    document.getElementById('app')
  );
};

render();
store.subscribe(render);<commit_msg>Add route to individual recipe page<commit_after>// this is the main entry point for the app
// it renders the App component after wrapping it in the Provider from Redux

import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, combineReducers } from 'redux';
import { Provider } from 'react-redux';
import { Router, Route, IndexRoute, browserHistory, Link } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';

import App from './components/App';
import MainRecipe from './components/MainRecipe';
import Profile from './components/Profile';
import Dashboard from './components/Dashboard';
import SearchResults from './components/SearchResults';
import ImageUpload from './components/ImageUpload.js';
import CreateRecipe from './components/CreateRecipe';

import rootReducer from './reducers';

// Grab the state from a global injected into server-generated HTML
const initialState = window.__INITIAL_STATE__;

// Create Redux store with initial state
// the store manages the state of our app
// createStore accepts a single reducer or a collection of reducers
const store = createStore(rootReducer, initialState);

const history = syncHistoryWithStore(browserHistory, store);

const render = function () {
  ReactDOM.render(
    <Provider store={store}>
      <div>
        <Router history={history}>
          <Route path="/" component={App}>
            <IndexRoute component={Dashboard} />
            <Route path="/profile" component={Profile} />
            <Route path="/recipe" component={MainRecipe} />
            <Route path="/recipe/:id" component={MainRecipe} />
            <Route path="/dashboard" component={Dashboard} />
            <Route path="/create" component={CreateRecipe} />
            <Route path="/search" component={SearchResults} />
            <Route path="/*" component={Dashboard} />
          </Route>
        </Router>
      </div>

    </Provider>,
    document.getElementById('app')
  );
};

render();
store.subscribe(render);
{'fraction_non_alphanumeric': 0.12253164556962025, 'fraction_numerical': 0.0, 'mean_word_length': 3.6102683780630107, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5346335', 'n_tokens_mistral': 1024, 'n_tokens_neox': 1016, 'n_words': 343}