Giter VIP home page Giter VIP logo

pfg-test's Introduction

PFG React Test

Build a simple React app with the following screens:

BASIC

  1. Login screen with username and password fields + validation
  2. Home page that displays a grid with news articles a search bar on top that filters based on the article title
    • To get the news articles use the following API: https://localhost:9420/news
    • You need to provide the token returned from the login API
    • Every article should have a view button, text preview (max 400 characters) and a date
  3. Article page that displays the full article
  4. Profile page with user details and a form with prefilled user details

For all pages:

  • All pages must include a header with title (PFG test for example) and links for navihation + a profile menu (user avatar fom the response + profilepage and logout link)
  • Make sure the pages are navigable, so you can go from one to onether and back.
  • Provide visual feedback in the form of loaders
  • The rest if the design is as you like.

Requirements:

  • must use TypeScript and define interfaces for data and props
  • use tailwind css or sass/less for styling (tailwind is preferred and included in the project)
  • Use react contexts for state managment (user tokens and stuff)
  • Use the broser fetch api to make the API calls and use await/async where possible

To start the test backend

  1. The server starts on port 9420 so when calling form the app use https://localhost:9420
cd backend
npm start
  1. The data is not

example requests

### Login
POST http://localhost:9420/login
Content-Type: application/json

{
    "username": "[email protected]",
    "password": "[email protected]"
}

### GetNews

GET http://localhost:9420/news
Content-Type: application/json
Authorization: Bearer wq7a3kkxs0o70s1athc17e9pzxg4g4cgha8g3xhvwqagcl2ekx95cdsdzadom2iv

### GetArticle

GET http://localhost:9420/news/796101
Content-Type: application/json
Authorization: Bearer wq7a3kkxs0o70s1athc17e9pzxg4g4cgha8g3xhvwqagcl2ekx95cdsdzadom2iv

### GetArticle Comments

GET http://localhost:9420/news/796101/comments/11
Content-Type: application/json
Authorization: Bearer wq7a3kkxs0o70s1athc17e9pzxg4g4cgha8g3xhvwqagcl2ekx95cdsdzadom2iv

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.