Giter VIP home page Giter VIP logo

react-challenge-stst's Introduction

Login Challenge

This repo currenlty only contains a skeleton react app.

The goal is to create an app that has two subcomponents, one for logged in users and one for logged out users. If the user is not logged in, the Login component with a login form should be displayed. Once the user is logged in, then the Secure component will be displayed with the user's name and the ability to log the user out.

Users that have not logged in should not be able to view the Secure component.

There is a mock API library in the src/lib directory that you can use for authentication. This is an async function that returns a promise. The payload is expected to be an object with a username and password property. The only rules of this API library is that the username must exist and the password must be "postal".

You are free to style the app (or not) in any way you like. Tests are not required for this app, however, you may do so with any testing library that you are familiar with if it will help your workflow.

MOCK API EXAMPLE

import api from './lib/api'


try {
  const user = await api.login({username: 'myname', password: 'postal'})
  console.log(user) // { username: "myname" }
} catch(err) {
  console.log(err.message) // Invalid Login
}

Example

Setup

A recent nodejs is required.

First fork this repo into your own github account. Once you've made a fork of the repo, clone the fork to your local machine.

When you are done with the coding challenge, go ahead and push it back up to github. You can do multiple pushes if you'd like. The goal is to complete this in under 2 hours, but if you need more time that is fine as we will review it tomorrow.

# install the dependencies
npm install

# start the app
npm start

react-challenge-stst's People

Contributors

dusty avatar sstampher avatar

Watchers

 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.