Code Monkey home page Code Monkey logo

test-react-todomvc's Introduction

Genius Plaza Todo App Test (React)

Application Specification

We have created this short spec to help you create an awesome and consistent todo app. Make sure to not only read it but to understand it as well.

Structure

Directory Structure

Recommended file structure:

.gitignore
index.html
package.json
node_modules/
src/
  - components/
  - containers/
  - styles/
    └──base.scss
    └──app.scss
  - utils/
  app.js  
readme.md

Try to follow this structure as close as possible while still keeping React best practices.

Components should be split up into separate files and placed into folders where it makes the most sense.

A Container does data fetching and then renders its corresponding components.

Example:

src/
  - components/
  - containers/
  - styles/
    └──base.scss
    └──app.scss
  - utils/
  app.js  

README

Your code must include a README describing the general implementation, and the build process if required. There is an example readme in this project.

Dependency Management

Unless it conflicts with the project's best practices, your example should use npm or yarn for package management. Specify your dependencies in a package.json file in the root directory of your app. An example package.json could look like this:

{
  "private": true,
  "dependencies": {
    "backbone": "^1.1.2",
  }
}

You should .gitignore everything in node_modules except the files actually used by your example. That means that documentation, READMEs and tests should not be included in the pull request.

Mockup

It is a recommended practice to have a rough visual representation of what you are about to build.

Mockup V1

From the above diagram, try to create your own presentation components, there's no wrong answers, be creative.

Code

Please try to keep the HTML as close to the template as possible. The base.css file should be referenced from the assets folder and should not be touched. If you need to change some styles, use the app.css file, but try to keep changes to a minimum. Remember to update the relative paths when using the template.

Make sure to follow these:

  • Use double-quotes in HTML and single-quotes in JS and CSS.
  • Use npm packages for your third-party dependencies and manually remove files that aren't required for your app to run.
  • Use a constant instead of the keyCode directly: var ENTER_KEY = 13;

Functionality

No todos

When there are no todos, the todos list section should be hidden.

New todo

New todos are entered in the input at the top of the app. The input element should be focused when the page is loaded, preferably by using the autofocus input attribute. Pressing Enter creates the todo, appends it to the todo list, and clears the input. Make sure to .trim() the input and then check that it's not empty before creating a new todo.

Item

A todo item has these possible interactions:

  • Clicking the checkbox marks the todo as complete by updating its completed value and toggling the class completed on its parent <li>
  • Hovering over the todo shows the remove button (.destroy)

Counter

Displays the number of active todos in a pluralized form. Make sure the number is wrapped by a <strong> tag. Also make sure to pluralize the item word correctly: 0 items, 1 item, 2 items. Example: 2 items left

Submit your test

Create a fork of this branch, or create a new repo called test-react-todomvc, please feel free to follow a good git-flow and when you think you are ready to submit it please send an email to [email protected] with the url of your repository.

test-react-todomvc's People

Contributors

david-gp avatar

Watchers

James Cloos avatar Waldo Lavaut 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.