Personal project for Ajaib.co.id frontend test.

Overview

ajaib-frontend-test

Personal project for Ajaib.co.id frontend test.

Stack used

Developing

A Node.js LTS setup with yarn (v1) is recommended.

# install dependencies
yarn

# serve with hot reload at localhost:3000
yarn dev

# build for production
yarn build

# run lint + type check
yarn validate

# run unit tests
yarn test

Architecture

Data fetching

We use Next.js API routes to wrap requests heading to the Random User API. Then we use SWR for our data-fetching logic, allowing for data fetches to be wrapped in a custom hook.

Performance boost: We serve the API response in the API route with a stale-while-revalidate header to serve stale content whilst revalidating them in the background for the next request.

State management

We use Zustand for our state management. This provides a simpler, less-boilerplatey way to manage our React application state while still conforming to the Flux principles, and allows for state + dispatcher to be easily called via hooks.

We use Zustand to track the state of our app's filter settings.

Debounced search

The useUsersFilterable hook contains a debounce function (using lodash/debounce) to delay updating of the URL until the user has stopped typing.

Directory structure

  • components/ - UI/layout components that are used globally throughout project.
  • lib/ - Shared utility/helper functions.
  • modules/ - Each feature and their business logic goes into this folder.
  • pages/ - Next.js pages. Please read this page for more info about them.
    • api/ - Next.js API routes. This is where the application's API/backend goes.
  • public/ - Next.js public directory, used for storing static assets.
  • styles/ - Global CSS files.
  • types/ - TypeScript types + interfaces that are used globally throughout the project.
You might also like...

This Project is made with HTML5, CSS3, ReactJS, Axios, MetaMask, thirdweb, Rinkeby Test Network, Web 3.0 Technologies, and OpenSea API.

This Project is made with HTML5, CSS3, ReactJS, Axios, MetaMask, thirdweb, Rinkeby Test Network, Web 3.0 Technologies, and OpenSea API.

Abstract Collections This Project is made with HTML5, CSS3, ReactJS, Axios, MetaMask, thirdweb, Rinkeby Test Network, Web 3.0 Technologies, and OpenSe

Jan 4, 2023

Group project where, we have built a simple quiz to test your Pokemon knowledge

Pokemon-Project For our first team project we have built a Pokemon Quiz. The Team Damon Spriggle Chris Burton Fuji Sin Oscar Hurtado Christopher Lee A

Apr 25, 2022

Boilerplate project to run MOBILE Test Automation with WebdriverIO v7, Mocha, Appium, Allure reporting and Momentum Suite cloud device farm support

Boilerplate project to run MOBILE Test Automation with WebdriverIO v7, Mocha, Appium, Allure reporting and Momentum Suite cloud device farm support

WebdriverIO Mocha Appium Momentumsuite WebdriverIO Integration with local or Momentum Suite real mobile farm devices Supports Native or Hybrid Android

Dec 5, 2022

In this project I write the test for several functions and used the TDD with Jest and JavaScript.

JavaScript-Testing-with-Jest npm init -y npm install --save-dev jest Once installed, you should see it in already created Json file Change Jest Script

Jun 11, 2022

Sample project to demonstrate Playwright Test usage, pointing to ServeRest API and Front-end

demo-playwright-test This is a sample project to demonstrate Playwright Test usage, running tests against ServeRest API and Front-end. Pre-requisites

Oct 24, 2022

Three.js boilerplate project configured with typescript, webpack and css/style loader, HTTPS local server, and a sample test codes !!

Three.js boilerplate project configured with typescript, webpack and css/style loader, HTTPS local server, and a sample test codes !!

three.js-boilerplate Welcome, this is a three.js boilerplate project where you can clone it and start to work !!! Installed and Configured Items: Type

Jul 6, 2022

This project provides a React-powered web experience using the PokeAPI. It also is a creative space to hone frontend skills.

pokedex-nova This project provides a React-powered web experience using the PokeAPI. It also is a creative space to hone frontend skills. Available Sc

Feb 1, 2022

NFT stacking frontend completion using web3 on solana for client Nelson project.

NFT stacking frontend completion using web3 on solana for client Nelson project.

Dec 16, 2022
Owner
Resi Respati
web development, gaming, and motorsports, sometimes in that order. professional starter kit creator
Resi Respati
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
A personal semantic search engine capable of surfacing relevant bookmarks, journal entries, notes, blogs, contacts, and more, built on an efficient document embedding algorithm and Monocle's personal search index.

Revery ?? Revery is a semantic search engine that operates on my Monocle search index. While Revery lets me search through the same database of tens o

Linus Lee 215 Dec 30, 2022
The frontend of a full stack application of a personal wallet made with React, Node and MongoDB that allows you to add inputs, outputs and see all your extract.

The frontend of a full stack application of a personal wallet made with React, Node and MongoDB that allows you to add inputs, outputs and see all your extract.

Bernardo Rodrigues 5 Jun 2, 2022
Jester is a test-generation tool to create integration test code.

Code Generator for Integration Tests Introduction Welcome to Jester: An easy-to-use web application that helps you create and implement integration te

OSLabs Beta 54 Dec 12, 2022
O objetivo dessa aplicação era criar um frontend feito totalmente em Javascript, sem nenhum arquivo HTML ou CSS pré-criado. Além disso, esse projeto também é o frontend da minha API 100% NodeJS.

Projeto HTML 100% Javascript Front-end feito "sem HTML" Conteúdos ➜ Sobre o projeto ➜ O que aprendi ➜ Como usar ?? Sobre o projeto Voltar ao topo O ob

João Victor Negreiros 19 Aug 3, 2021
Personal Blog - a project developed with Angular for the front-end interface and Wordpress for the back-end API served with Docker containers

PersonalBlog This project was generated with Angular CLI version 13.0.1. Front-end Interface Development server Run ng serve or ng serve --configurati

null 9 Oct 5, 2022
Personal project to a student schedule classes according his course level. Using GraphQL, Clean Code e Clean Architecture.

classes-scheduler-graphql This is a personal project for student scheduling, with classes according his course level. I intend to make just the backen

Giovanny Lucas 6 Jul 9, 2022
A personal school project to model the behaviour of the human immune system as a network graph with interactive visualisation.

An educational tool designed to help users understand the immune system. Made using Processing 5 for Java Script

Oscar Bullen 2 Jun 18, 2022
My personal Website, where I share my blog and project. Build using Nextjs and Tailwind CSS

Personal Blog This is my portfolio website built with Next.js, Tailwind CSS and hosted with Vercel. Perfect Light House Score ?? Installation & Set Up

Ashish Lotake 6 Dec 24, 2022