Tecnhical test consisting of a simple React app that allows users to manage their wallet using Ethereum and MetaMask.
Previous knowdlege with these technologies is assumed in order to use the app and follow this document.
Table of contents
- Features ✨
- Demo 🕹️
- Installation 💻
- Usage 🤹
- Tech stack 📦
- Tech features ⚙️
- Possible improvements 🆙
- Project Management
- Login (fake)
- Register (also fake)
- Wallet
- Deposit
- Transfer
- Integration with MetaMask
- Dark/Light theme mode
- Routes protected by auth
- Fully responsive and mobile first
- “Not found” page
Visit the live Demo here: https://ivnosing.github.io/react-wallet.
Note: Make sure to follow the installation process below to set up Ganache and Metamask.
Download, install and configure these:
-
Clone the repo
git clone https://github.com/Ivnosing/react-wallet.git -
Start Ganache with a sample workspace. Make sure the address is
http://127.0.0.1:7545. In the workspace configuration, add the Truffle project to the workspace (e.g./react-wallet/projects/truffle/truffle-config.js) -
Navigate to the
projects/trufflefolder and run the migration into Ganache. You should see the updates in Ganache.cd projects/truffle truffle migrate -
Install the dependencies in the root of the workspace.
npm install -
Serve the application. You should be able to see the app running at http://localhost:4200.
npm start
Both the Login and Register pages consist of an HTML form with validation. Since they are fake, you can use any credentials. The username must be at least 6 characters long, and the password must be at least 8 characters and must include lowercase, uppercase and numbers (e.g. Password0).
You must authenticate in order to utilize the rest of the application.
The Wallet page displays the balance and the account of the user. This data comes from MetaMask, so you will be prompted to login and select an account.
The Deposit page displays a form to deposit some amount of Ether into the contract. It also displays the user and contract info.
The Transfer page displays a form to send a transaction from the user's address (sender) to a specific address (receiver).
The Logout button in the navbar ends the user session and redirects the user to the Login.
The Dark/Light button in the navbar toggles the current theme for the entire app. This setting is persisted in the user's browser.
The app is built with mobile-first principles and keeping responsiveness in mind.
- React 18.2
- TypeScript
- Vite
- Nx
- Jest
- React Testing Library
- React Router
- Redux
- Hooks
- Chakra UI
- HTML Forms
- web3.js
- Truffle
- Ganache
- Metamask
Deployments:
- GitHub Actions
- GitHub Pages
Other:
- Prettier
- ESLint
- VSCode
- Git
- Conventional Commits
This project follows the monorepo pattern using Nx as the build system. The code is splitted in different projects and libraries, generally by domain, following strategic design.
Then each lib scope can be further broken down into smaller pieces following this patterne:
- feature: complex components with feature logic,
- ui: scoped pure components,
- data-access: data-access layer (HTTP requests and others),
- utils: helpers and utilities for coding,
- store: Redux-related code,
With Nx we have built-in code generators for React, the workspace and other. It makes it easy to generate libraries, components, tests, etc.
Nx caches the result of tasks, making subsequent runs of the same task fast. For example, the shared-ui lib is a publishable lib, so it can be built on its own, cached and then excluded from future builds of the dependant projects.
With these, the application could be further improved but they are left out of scope due to time limitations.
Include support for different languages and locales.
Lazily load the different features (wallet, transfer, deposit...).
An improvement to SEO and performance would be to render the application in the server, as opposed to the current rendering in the client.
Some basic error handling was included (HTML Forms and catch-error displays) but it could be further improved, especially with knowdledge of the Web3 domain.
Even with reusable libraries in the workspace some code is duplicated and it could be optimized. Some examples are repeating layout elements and styles and test utilites.
Some basic testing using Jest and React Testing Library was included but greater coverage should be the goal.
Notion was used for tracking development and taking notes.









