Slide 1

Slide 1 text

Web App Design & Development Project By Andy Kelly @askkell Catherine Hopkins @catherinehpkns Liam Defty @liamdefty Jo Hardy @johardydesign

Slide 2

Slide 2 text

Questions Problem Solving The Project The Team Development Web App Demo Introduction

Slide 3

Slide 3 text

Meet The Team

Slide 4

Slide 4 text

Andy Kelly Catherine Hopkins Liam Defty Jo Hardy We are 2nd Year FdA Digital Design Students, working together on our final assignment

Slide 5

Slide 5 text

Project Planning Research Preparing the Project Proposal The Roles Everyone in the Team played a role in;

Slide 6

Slide 6 text

Andy Kelly Catherine Hopkins The Designers UX & UI @askkell @catherinehpkns

Slide 7

Slide 7 text

The Developers Javascript & Sass Liam Defty @liamdefty Javascript & Sass Jo Hardy @johardydesign Sass

Slide 8

Slide 8 text

The Project The Design and Development of a Web Application would allow us to perform the roles identified and meet our personal objectives

Slide 9

Slide 9 text

The Problem UK children are becoming obese at a younger age There is a need to reduce obesity in children by way of education so that they can make their own informed life choices. Published on the 20th May 2015 by Michelle Roberts http://www.bbc.co.uk/news/health-32797769

Slide 10

Slide 10 text

The Solution A Web App for Children A product aimed at children to educate them in a fun, interactive and engaging way about health and how decisions they make could affect their wellbeing

Slide 11

Slide 11 text

What is Munchstars?

Slide 12

Slide 12 text

munchstars.com

Slide 13

Slide 13 text

Creating your team of Munchsters

Slide 14

Slide 14 text

Editing your team

Slide 15

Slide 15 text

Personalising your Munchster

Slide 16

Slide 16 text

Feeding your Munchster

Slide 17

Slide 17 text

I got 99 problems but Munchstars ain’t one

Slide 18

Slide 18 text

Gathering together to figure out our MVP revealed that we all had different ideas for how we wanted the app to work...

Slide 19

Slide 19 text

We created a user journey together to finalise the idea. The MoSCoW technique was then used to determine our MVP.

Slide 20

Slide 20 text

Our week by week plan seemed so promising… We had 4 weeks to go and only had some buttons styles designed

Slide 21

Slide 21 text

As a team we decided on a general style to push forward with. Designers got full control over the UI decisions. Focusing on our personal goals that we wanted to achieve with our final project, our last chance with total creative freedom

Slide 22

Slide 22 text

What did we use for version control as Designers...

Slide 23

Slide 23 text

We didn’t use version control

Slide 24

Slide 24 text

Development Liam Defty

Slide 25

Slide 25 text

React “A Javascript library for building user interfaces.” Firebase “The tools and infrastructure you need to build better apps”

Slide 26

Slide 26 text

JSX You don’t have to use JSX with React. But I think that’s what makes React awesome. render() { const token = localStorage.getItem('token'); if(token && !this.props.auth.loggedIn) { return (
) } if(!this.props.auth.loggedIn) { return ( ) } if(this.props.auth.loggedIn) { return ( ) } }

Slide 27

Slide 27 text

Stateful Components React makes use of stateful components. Store your data as state and when the state is updated the rendered markup will be re- rendered depending on the change. getInitialState() { return { users: {}, newUser: false, user: { name: this.props.player.name, nickname: this.props.player.nickname, points: this.props.player.points, avatar: { head: this.props.player.avatar.head, body: this.props.player.avatar.body, legs: this.props.player.avatar.legs, } }, } },

Slide 28

Slide 28 text

Sync State with Firebase We can use re-base to sync our state. Forget about data persistence and focus on doing the fun stuff. https://github.com/tylermcginnis/re-base getInitialState() { return { questions: {}, } }, componentDidMount() { const endPoint = `${this.props.auth.uid}/users/questions`; this.ref = base.syncState(endPoint, { context: this, state: 'questions' }); }, componentWillUnmount() { base.removeBinding(this.ref); },

Slide 29

Slide 29 text

Routing We use JSX for the router too. React Router is the most popular router for React. It has a simple API with powerful features. const routes = ( );

Slide 30

Slide 30 text

One Way Data Flow React uses a one way data flow where data is passed down from component to component via props. render() { return ( ) }

Slide 31

Slide 31 text

A better way to visualize it

Slide 32

Slide 32 text

Passing data back up.. ...can get a bit messy. render() { return ( ) }

Slide 33

Slide 33 text

What if we want to pass data from component 1 to component 3? Surely there’s a better way? 1 3

Slide 34

Slide 34 text

Redux “Redux is a predictable state container for JavaScript Apps”

Slide 35

Slide 35 text

Redux provides a global store we can access from any component. Instead of having to pass everything up through each component. We use a dispatcher to update the global store.

Slide 36

Slide 36 text

Actions Actions are payloads of information that send data from your application to your store. export function updateUsers(users) { return { type: 'UPDATE_USERS', users } };

Slide 37

Slide 37 text

Reducers Actions describe what’s happened but don’t state how the apps state changes. This is the reducers job. A reducer is a pure function that takes the previous state, an action and returns the next state. function authReducer(state = initialState, action) { switch(action.type) { case 'LOG_IN': return Object.assign({}, state, { team: action.team, loggedIn: action.loggedIn }); case 'UPDATE_USERS': return Object.assign({}, state, { users: action.users }); default: return state; } }

Slide 38

Slide 38 text

Store Redux apps have a single store which takes: 1. All Reducers which we combined into the rootReducer. 2. An optional starting state - similar to React's getInitialState. const store = createStore(rootReducer, initialState);

Slide 39

Slide 39 text

Create a component to attach it to We're injecting the data at the top level and passing it down, but you can connect() any component to make the actions and the store available to you anywhere. 1. Get state from store we want to pass down as props function mapStateToProps(state) { return { auth: state.auth, player: state.player, }; } 2. Bind actions to dispatch and make the actions available as props function mapDispatchToProps(dispatch) { return bindActionCreators(actions, dispatch); } 3. Create an component which passes the data to which makes the data available to the entire app const App = connect(mapStateToProps, mapDispatchToProps) (Main);

Slide 40

Slide 40 text

Routing with Redux Our App component replaces the Main component, which means the date we bound to it is available to be passed down. The store is made available to it via the Provider component which is where we were able to pass the stores state to previously. import store, { history } from './store'; const routes = ( );

Slide 41

Slide 41 text

What this looks like in a real example

Slide 42

Slide 42 text

Thanks for listening! :) Questions?