Git Product home page Git Product logo

sprint.vue's Introduction

React Sprint

This was created during my time as a Code Chrysalis Student

Table of Contents

  1. Introduction
  2. Objectives
  3. Environment
  4. Requirements
  5. Installing Dependencies
  6. Requirements & Instructions
  7. Basic Requirements
  8. Advanced Requirements
  9. Resources
  10. Contributing

Introduction

Dive into Vue, a front end framework quickly gaining recognition as a popular alternative to React and Angular. This framework is known for two-way data binding and ability to easily insert and scale into other applications.

Objectives

In this task students will:

  • Learn a new framework using documentation
  • Be able to clearly state similarities and differences between front-end frameworks
  • Use Vue's single-file architecture to develop a photo upload app
  • Use the basics of Vue architecture: create components, use lifecycle methods, and pass data

Environment

Requirements

  • Node.js

Installing Dependencies and Starting Up

To install the dependencies for this project:

  $ yarn

To run tests:

  $ yarn test

To run eslint:

  $ yarn eslint

To run the app in development with hot reloading:

  $ yarn dev

To create a production-ready build:

  $ yarn build

Requirements and Instructions

Basic Requirements

For this activity, you should be replicating the photo upload app you build in React, but in Vue. You will end up with the same five components: App, Navbar, Upload, AllPhotos, and SinglePhoto.

Use the Vue docs to explore this framework. You will have to learn new technologies and frameworks often, so this activity is designed to push you to get better at reading documentation.

Note that we will be using single file components for this Vue app. Read this page closely so you understand the difference in syntax. Most of the structure of this app has been set up for you.

Your component hierarchy will end up resembling the following:

  App
    Navbar
      Upload
    AllPhotos/SinglePhoto

Tests

[ ] In this project, tests have NOT been written for you. We will be using Mocha + webpack to unit test your components. You can read more about the setup here.

App

This component is the main entry point for your Vue app.

It should store three pieces of data:

  • currentView, a string that tells the component whether the user should be shown the AllPhotos or SinglePhoto view.
  • photos, an array of images represented as base-64 strings.
  • selectedPhoto, an image represented as a base-64 string.

It is also responsible for rendering all of the other components:

  • Navbar, which renders the navigation bar for the user. The Navbar is always shown regardless of view.
  • Either AllPhotos or SinglePhoto, which renders either a grid of all photos or an enlarged version of just one single photo. This render is conditional, based on the currentView property of the App component's state. Explore the Vue docs for ideas for how to render conditional displays in your template.

App should default to showing the AllPhotos component.

When App component mounts, the following should happen:

  • It should pause the Vue lifecycle by calling the created method. Read more about the Vue lifecycle here. Inside of that method, it should use the utility methods found in the utils/index.js file to make a call to Amazon's S3 service to retrieve a list of all items stored on the pre-specified S3 bucket.
  • Then, it should grab each image from that list of items and store it into the photos array in the component's data.

Navbar

This component should serve as your navigation bar for your Vue app. It should render a title along with the Upload component.

  • The title should be a clickable element that, when clicked, will modify the value of the currentView string in the App component's data, changing it to 'AllPhotos'. This is to provide the user with a method of navigating back to seeing the AllPhotos view. You should check out the Vue documentation on Events for how to handle this interaction.
  • The navbar should also render the Upload component. This component should expect a file to be sent as an argument and is responsible for saving that file to S3 using one of the utility methods found in utils/index.js to do so. As a result of this, it should also update the photos array saved in the state of the App component.

Upload

  • The Upload component renders a button element for the purposes of uploading an image.
  • The input element should allow users to select a an image file.
  • When an image file has been selected with the input element, it should ultimately save that file in a S3 bucket.
  • You should use the button element in the component to trigger a click event on the invisible input element. Check out the Vue documentation on Event Handling for a look at how to accomplish this.

AllPhotos

  • It should render a grid of images based on an array of base64-encoded strings given to it as a prop.
  • The images should not take up the entire screen! Make sure their dimensions allow for a decently-sized grid of images.
  • This array of strings should be passed down as data by the parent App component.
  • Each image should be clickable, executing a function that will send the clicked image's index back up to the App component.
  • When an individual photo is clicked, it should switch the rendering of the App component so that it shows the SinglePhoto component instead of the AllPhotos component.

SinglePhoto

  • It should render a single image that takes up the entire screen!
  • The image it renders should be passed into it as a prop from the App component.

Wireframes

  • All Photos:

All Photos

  • Single Photo:

Single Photo

Advanced Requirements

  • Add a progress bar or visual overlay while a photo is being uploaded, and make it disappear once the upload is complete.
  • Add Vuex to manage your state. This is similar to Redux, but for Vue. Read more here!

Resources

Contributing

See a problem? Can something be done better? Contribute to our curriculum!

sprint.vue's People

Contributors

mia-the-coding-cat avatar

Watchers

James Cloos avatar Mike Donnelly avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.