React.Js/Node.Js Project
## Quick start
- FrontEnd part:
cd Frontend
Runnpm run setup
to install dependencies
Runnpm start
for development
Runnpm run build
for production
Runnpm run test
for testing - BackEnd part:
cd Backend
Runnpm install
to install dependencies
Runnpm start
for development
Runnpm run prod
for production
Runnpm run test
for testing
- Authentication
- Only User page needs authentication and `redux-auth-wrapper` high order component library is wrapped that page for authentication. Trying access to Users page without authentication, HOC will redirect to login page and login page validates token in sessionStorage if exist. If it not exist, client stays in login page. If re-login successful, re-direct again to desired page.
- Home, Login and Contact pages validate jwt token in mount state.
- Credentials are email:[email protected], password:secret
- Styling
- Styles are in global-styles.js file which provide css injection to `head` tag
- Sagas
- For side effects, `redux-saga` is implemented. All the actions are sync and sagas listens stores and actions and catch the desired requests then fires back the request results
- Main saga is in App container.This saga runs all the time, but other sagas destroy themselves after page change.
- Proxy
- All sagas uses '/api/*' paths for server. In development frontend node.js server rewrites all request to '/api/* -> /*' and backend server only handles '/*'.
- ES6
- Babel compiler implemented for es6 features
- Any DB system not included, only endpoints
- /contact endpoint only logs datas, no saving or validation
Please note that there are only 2 React components and 3 endpoints have unit tests.