GithubHelp home page GithubHelp logo

johanmouchet / broccoli-co Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 411 KB

A React app using a form to call an API requesting an invitation

Home Page: https://johanmouchet.github.io/broccoli-co/

License: MIT License

HTML 2.45% SCSS 29.31% TypeScript 54.14% JavaScript 14.09%
react hooks api form typescript sass

broccoli-co's Introduction

Broccoli & Co.

The Brief

Read

Make a simple single-page web application for Broccoli & Co.

Broccoli & Co., an upcoming online service company, would like to let people to "Request an invitation" on their website.

The functionality

Create a simple yet clean homepage for them that allow users to enter their name and email to receive email invitations.

Visual Requirements

  • The UI should occupy the full height of the screen.
  • Shows a fixed header that is always on top of the window and a footer that is always on the bottom of the window (assuming a reasonable window height). The page content is sandwiched in the middle, containing just a heading, a small piece of text and a button to request an invite.
  • A rough mockup of the basic layout is attached. While preserving this layout on desktop, you may style it however you wish, with or without images.
  • The solution must be mobile friendly (users won't need to pinch and zoom on their mobile devices).

UI Behaviour / Validation

  • When the Request Invite button is clicked, a popup shows containing the Full name, Email and Confirm Email input fields.
  • The user needs to fill in all three fields to request an invite. Full name needs to be at least 3 characters long, Email needs to be in validation email format and Confirm Email needs to match Email. (You may display the validation errors inline)
  • If the user clicks Send and one or more fields do not validate properly, the app should not contact the backend but instead provide appropriate feedback to the user (use your judgement on what this UX should be).
  • If the user clicks Send and all fields validate properly, the app should send the request to the backend server (see specs below) and inform the user that the request is being sent.
  • If the server returns 200 OK, it should switch to another popup, indicating that everything went through OK. This popup can be dismissed and will simply close - revealing the homepage again.
  • The server may return 400 Bad Request, in which case the app should simply display the error message from the server.
  • The Send button can be clicked again to re-attempt the submission.

You're encouraged to tweak/customise the UI to provide a better user experience. However the final solution must still adhere to layout design provided.

Tooling

  • The solution should be implemented in React.
  • The solution should use a modern build tool, e.g. create-react-app, Webpack.
  • The solution should use a modern styling approach.
  • The solution should run on most current browsers (e.g. flexbox okay).

Backend API

Demo

Checkout the GitHub Page

About This App

This app is,

  • bootstrapped with Create React App
    • including React, webpack, Babel and more
  • type-checked with TypeScript
  • unit and snapshot tested with Jest and React Testing Library
  • using Sass, CSS Modules and CSS post-processing
  • linted and formated with ESlint, stylelint and Prettier, enforced by Husky and lint-staged

npm Scripts

In the project directory, you can npm run:

  • start: Runs the app in the development mode. Open http://localhost:3000 to view it in the browser.
  • test: Launches the Jest test runner in the interactive watch mode.
  • type-check: Runs TypeScript, as a static type checker.
  • lint:js: Runs the ESLint linter, a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code, with the goal of making code more consistent and avoiding bugs.
  • lint:css: Runs the stylelint linter, a mighty, modern linter that helps you avoid errors and enforce conventions in your styles.
  • format: Runs ESLint and stylelint with the --fix option, as well as Prettier with the --write option to automatically fix problems.
  • build: Builds the app ready for production.

broccoli-co's People

Contributors

johanmouchet avatar

Watchers

 avatar  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.