Git Product home page Git Product logo

archimydes-coding-challenge's Introduction

This project is a solution to the given code challenge by Archimydes to me - Adetola Daniel

Introduction

This project was bootstrapped with create-next-app and Chakra UI as the design framework

PLEASE NOTE:

Please set the node.js api server to listen at localhost:5000 rather than localhost:3000. So it doesn't conflict with this development port and break the code .

I have already set the base url to localhost:5000 (you can see/change that in the url.js file)

To install:

  • clone this repo
  • run yarn add or npm install to install all necessary packages
  • run yarn dev or npm run dev to start the development server

Methods/Steps

1. Theming

Chakra UI supports inline styling of components (sort of like how it's done in Tailwind CSS). Hence, there are no separate .css files.

For responsiveness, style values for different breakpoints are used in arrays. So if you see something like

height={[200,300,400]}

It simply means;

@media(min-width: 576px){ height: 200px }

@media(min-width: 768px){ height: 300px }

@media(min-width: 991px){ height: 400px }

2. Utils

The two major utils here are the withAuth HOC and the findInArray helper function.

  • The withAuth HOC is used on protected pages to check if the user already has a saved session on the app. If not, it will redirect the user to the Login page

  • The findInArray helper function is used to find an object in an array with a unique identifier (usually an id). It accepts three parameters; The body(array), the group(specific object key to search from) and the query(the value that is being searched for)

3. State Management

State management was implemented using Redux with Hooks

archimydes-coding-challenge's People

Contributors

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