Hosted Link: https://frontend-end-challenge.vercel.app/
A Sample Transactions List Viewer
- Website: Transaction List
- Graphql Endpoint: Backend Endpoints
Step 1: Clone this repository:
git clone https://github.com/okeken/frontend-end-challenge.git
Step 2: Install dependencies:
yarn install
Step 3: Run the development server:
yarn dev
Open http://localhost:3000 with your browser to see the result.
Open http://localhost:3000/api/graphql with your browser to open the graphql playground.
Column | Sample data |
---|---|
Alias | Don |
Receiver | 0x786BfF269d10812Ac61c0c197E3Fc4215cabc3d9 |
Amount | 12 |
Status | Success |
Type | Out |
Transaction ID | 9984df6-2b71-4788-84fc-314599789492 |
const sampleData = {
id:"9984df6-2b71-4788-84fc-314599789492",
receiver:"0x786BfF269d10812Ac61c0c197E3Fc4215cabc3d9",
amount:12,
status:"Success",
description:"This is a seed sample data",
created_at:'2022-07-09T10:23:49.779Z',
type:"out",
alias:'Don'
}
- Transaction Type: Received | Sent
- Transaction Status: Pending | Success | Failed
Click on the Received
button to see all the transactions that add value to your account, or click on the Sent
button to see all transactions that send value to other people from your account. These options are also available on Type
Click on the Pending
, Success
or Failed
Button to see the corresponding status of the transactions in your account.
This project is bootstrapped with Nextjs. I want to make sure both the frontend and backend run on the same server, since Nextjs has the capacity for a full-stack app, I decided to go with it.
The Current Layout transactions divs are tabbable and the filter options.
One of the challenges I faced is formating the backend end data such that the frontend can show them grouped by the same date they occur. I solved this by
- Mapping through the data and giving data on the same date a common date
- Group the data by the common date
- Put data with the same date in an array with the key
date
anddata
code location - /utils.ts
function name - normalizedTxn
- Select Element For Filtering: The
Status
andType
buttons can be substituted with a select element, such that when a user clicks onStatus
the select options open withpending
,success
andfailed
options, a user clicks on an option the select element returns to its normal state, the search operation occurs with the selected option. Same forType
- Pagination: This application can be approved by adding pagination to the list of data to improve UX experience.
- Custom Page Size: Provide a UI for users to customize the page size of the data returning from the backend
- CSS: Tailwind
- Mock data: Fakerjs
- Linting: Prettier
- Cors: Micro Cors
- Search: Fusejs