Skip to content

Commit

Permalink
expense recorder boilerplate code is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Vivek Patel authored and Vivek Patel committed Mar 21, 2018
0 parents commit af48a60
Show file tree
Hide file tree
Showing 22 changed files with 7,188 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["es2015", "react"],
"plugins": ["react-hot-loader/babel"]
}
21 changes: 21 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "airbnb",
"plugins": [
"react"
],
"rules": {
"no-console": 0,
"react/jsx-filename-extension": 0,
"react/no-array-index-key": 0,
"react/sort-comp": 0,
"react/jsx-no-bind": 0,
"jsx-a11y/href-no-hash": 0,
"jsx-a11y/no-static-element-interactions": 0,
"react/forbid-prop-types": 0,
"linebreak-style": 0,
"no-underscore-dangle": 0,
"import/no-extraneous-dependencies": 0,
"jsx-a11y/label-has-for": 0,
"jsx-a11y/img-has-alt": 0
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
/dist
.env
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Expense-Recorder
8 changes: 8 additions & 0 deletions client/actions/asyncActions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Request from 'axios';
import syncActions from './syncActions';

const ip = '/api';
function makeRequest(method, api = '/login', data) {
return Request[method](ip + api, data)
.then(r => r);
}
Empty file added client/actions/syncActions.js
Empty file.
13 changes: 13 additions & 0 deletions client/components/homepage/HomePage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import { Link } from 'react-router-dom';
import './HomePage.scss';

const HomePage = () => (
<div className="homepage row-col-center">
<div className="middle">
<h1 className="h1">Welcome</h1>
<button><Link to="">Click Here</Link></button>
</div>
</div>
);
export default HomePage;
27 changes: 27 additions & 0 deletions client/components/homepage/HomePage.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.homepage {
background: #3b4465;
height: 100vh;
.middle {
display: flex;
flex-direction: column;
align-items: center;
h1 {
color: #fff;
font-size: 3em;
margin: 0 0 0.4em 0;
}
button {
font-size: 2em;
color: #fff;
background: none;
border: none;
cursor: pointer;
a {
all: unset;
}
&:hover, &:active {
text-decoration: underline;
}
}
}
}
21 changes: 21 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!doctype html>
<html lang="en">
<head>
<title>Expense-Recorder</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../dist/style.css" />
</head>
<body>
<div id="app"></div>
<script src="../dist/bundle.js"></script>
</body>
</html>


<!-- The Bootstrap 4 grid system has five classes:
.col- (extra small devices - screen width less than 576px)
.col-sm- (small devices - screen width equal to or greater than 576px)
.col-md- (medium devices - screen width equal to or greater than 768px)
.col-lg- (large devices - screen width equal to or greater than 992px)
.col-xl- (xlarge devices - screen width equal to or greater than 1200px) -->
19 changes: 19 additions & 0 deletions client/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { BrowserRouter as Router } from 'react-router-dom';
import './styles.scss';

import createRoutes from './routes';
import configureStore from './store';

const initialState = {};
const store = configureStore(initialState);
const routes = createRoutes(store);

render(
<Provider store={store}>
<Router>
{routes}
</Router>
</Provider>, document.getElementById('app'));
8 changes: 8 additions & 0 deletions client/reducers/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { combineReducers } from 'redux';
import { routerReducer as routing } from 'react-router-redux';

const rootReducer = combineReducers({
routing,
});

export default rootReducer;
5 changes: 5 additions & 0 deletions client/reducers/initialState.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const initialState = {

};

export default initialState;
10 changes: 10 additions & 0 deletions client/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import { Redirect, Switch, Route } from 'react-router-dom';

import HomePage from './components/homepage/HomePage';

export default () => (
<Switch>
<Route path="/" exact component={HomePage} />
</Switch>
);
10 changes: 10 additions & 0 deletions client/store/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import { createLogger } from 'redux-logger';
import rootReducer from '../reducers';

export default function configureStore(initialState) {
const middleware = [thunk];
middleware.push(createLogger({ collapsed: true }));
return createStore(rootReducer, initialState, compose(applyMiddleware(...middleware), f => f));
}
9 changes: 9 additions & 0 deletions client/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import '../node_modules/bootstrap/dist/css/bootstrap.min.css';
@import '../node_modules/font-awesome/css/font-awesome.min.css';
@import '../node_modules/react-select/dist/react-select.min.css';

.row-col-center {
display: flex;
justify-content: center;
align-items: center;
}
Loading

0 comments on commit af48a60

Please sign in to comment.