Coder Social home page Coder Social logo

anymind-frontend-test's Introduction

One Day Chat Application Challenge

This is the Challenge application for AnyMind, developed by Victor Shinobi Toshiki Gakiya Cruz.

Tech Stack and Dependencies

  • React.js
  • Jest
  • TypeScript
  • GraphQl
  • Apollo/Client
  • Styled-components
  • Istanbul-badges-readme
  • React-icons

Getting Started

  1. Clone the repository
git clone https://github.com/shinobig/anymind-frontend-test.git
  1. Install npm packages in the root directory
npm install
  1. Run the project

This project uses the default configuration from the NPX react project generator

npm start

Please note that this project was created with the node version 18.1.0, on node version 16.14.2, older versions might not work.

If you see the following message, it means that the application is up and running in http://localhost:3000/ (The application should open a browser tab automatically)

No issues found.

About this project

This project matches the following points (Described in the test PDF document):

✔️ Users can talk with eachother.

✔️ User can choose from three predefined users

✔️ User can change the channel

✔️ Whenever a channel change, it displays the latest message

✔️ Whenever the HTML petition returns an error, an error message is displayed and the option to resend the message

✔️ When the user reopen the page, the text editor maintains the text

✔️ Suggested better UI

Context API

The application handles 3 main properties in the context API, the channel Id, the selected user and the chat itself. That way, it is easier to manage verification and sending new messages.

Components

All of the components in this project are functional components.

Notes

  • Please note that this application is not optimized for tablet or mobile devices.
  • The Read More button will be active when there are 10 or more messages displayed.
  • There is warning related to the installation of some of the modules in the Apollo/Client, please note that this does not affect on the application at all.

Project Structure

src
├── App.tsx
├── components
│   ├── ChatHolder
│   │   ├── ChatHeader
│   │   │   └── ChatHeader.tsx
│   │   ├── ChatHolder.tsx
│   │   ├── ChatWindow
│   │   │   └── ChatWindow.tsx
│   │   ├── MessageHolder
│   │   │   ├── MessageBubble.tsx
│   │   │   ├── MessageHolder.tsx
│   │   │   ├── MessageStatus.tsx
│   │   │   └── UserIcon.tsx
│   │   └── TextBox
│   │       └── Textbox.tsx
│   ├── Header
│   │   └── Header.tsx
│   ├── Menu
│   │   ├── ChannelButton.tsx
│   │   └── Menu.tsx
│   ├── SharedStyles
│   │   └── GeneralButton.ts
│   └── Spinner
│       └── Spinner.tsx
├── context
│   └── chatContext.ts
├── graphql
│   ├── mutations.ts
│   └── queries.ts
├── Hooks
│   └── Hooks.ts
├── Icons
│   ├── JoiseIcon.svg
│   ├── RusselIcon.svg
│   └── SamIcon.svg
├── index.css
├── index.tsx
├── interfaces
│   └── interfaces.ts
├── logo.svg
├── react-app-env.d.ts
├── setupTests.ts
├── __test__
│   ├── App.test.tsx
│   ├── components
│   │   ├── ChatHolder.test.tsx
│   │   ├── Menu.test.tsx
│   │   ├── MessageHolder.test.tsx
│   │   ├── MockAppComponent.tsx
│   │   └── TextBox.test.tsx
│   ├── mockQueries.ts
│   └── testUtils
│       └── icons.test.tsx
└── utils
    ├── IconSelector.tsx
    ├── memoizeInput.ts
    ├── postMessage.ts
    └── timeUtils.ts

Tests

In order to run the tests and create a report document, run the following command in the root directory:

npm run test

The report document will be stored in the following directory as an HTML file.

__root__/coverage/lcov-report/index.html
Statements Branches Functions Lines
Statements Branches Functions Lines

Thank you for the opportunity!

anymind-frontend-test's People

Contributors

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