import {Meteor} from 'meteor/meteor';

import {createApp} from 'mantra-core';
import initContext from './configs/context';

// Redux
import {combineReducers} from 'redux';
import {routerReducer} from 'react-router-redux';

// modules
import coreModule from './modules/core';

// Combine Reducers
const reducer = combineReducers({
  ...coreModule.reducers,
  routing: routerReducer,
});

// init context
const context = initContext({ reducer });

// create app
const app = createApp(context);
app.loadModule(coreModule);

Meteor.startup(function () {
  app.init();
});
