Giter Club home page Giter Club logo

nextjs-ssr's Introduction

About Application

This is a FE application built on NEXT.js with a mock end point. The application is simple demonstration of server side rendering skills along with error handling

The Task

The task is to complete a mock Search Results Page.

The project includes some mock designs, an already working single page application, and an API endpoint which returns mock results.

Getting Started

This is a Next.js project bootstrapped with create-next-app.

You’ll need Node.js version 10.13 or later, a text editor and terminal app for this task.

  • Either clone this repository or download the gtau-fe-test.zip and extract the contents
  • Navigate to the gtau-fe-test directory in your terminal
  • Install the dependencies npm install
  • Start the development server npm run dev

Open http://localhost:3000/listings with your browser and you will see the listings of cars

You can also open http://localhost:3000/api/listings with your browser and see the response from the API endpoint (the results are a randomised number of listings, and order).

The task Requirements/ Acceptance criteria is:

Complete the Listings component(s) so that it correctly render the results returned from the API endpoint.

  • The layout should be responsive and match the mocks (3 columns on desktop, 2 on tablet, 1 on mobile).
  • The listings should visually match the mocks as closely as possible.
  • The title of the listing should be truncated to a single line.
  • The description of the listing should be truncated to 3 lines.
  • The price should be formatted to be human readable.
  • The two buttons on each listing do not need to do anything when clicked except log a message to the console with the format [action]: [title], e.g: Reply: 2007 Ferrari Spider or View: 2007 Ferrari Spider.
  • The page only needs to work in the latest version of Chrome.
  • Do not include any extra dependencies. The project has everything you need to complete it.
  • The only two files you need to edit are components/Listings.js and public/css/listings.css. There is no need to edit anything else.

How did I start?

Review the mocks in design-mocks directory. There is a mock design for desktop, tablet and mobile.

The logical order to complete the tasks are:

  • Retrieve results from the API endpoint.
  • Complete the logic and responsive layout for the parent Listings component.
  • Complete the logic and layout for the singular Listing component.
  • Complete the logic for the formatAsCurrency utility.

You do not need to use anything but plain ol' CSS for styling. There are some root level CSS variables declared in public/css/variables.css which you can, and should, use to help save you time.

Tips to understand the dev process

  • Even though the API is a mock, treat it as you would a production API. What happens when there are no results? Or the request fails?
  • The API server is temperamental - 10% of the time it will return an error, and may take up to 3 seconds to return a response. Make sure the Frontend can handle it!
  • This isn't just a Javascript test. The HTML structure of your component and the CSS layout are equally important.
  • Dont try to do too much! A simple, clean solution that works is looked at more favourably than an complex one that does not.

nextjs-ssr's People

Contributors

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