Demo Wallet is a Node.js application that provides a wallet management system. It allows users to create accounts, fund their wallets, transfer funds, and withdraw money. The project uses Knex.js for database migrations and queries, bcrypt for password hashing, and Express.js for handling HTTP requests.
aside from the minor tweaks coming from the lendsqr adjudtor karma api(the field for identity
doesent seem to read the any identity provided. except for the very one depicted in the documentation), the api does the other functionalities right.
you can find the project overview on notion:
https://www.notion.so/DEMO-WALLET-OVERVIEW-63a7af23be604086babab90762ee3aee?pvs=4
- User account creation
- Wallet funding
- Funds transfer between wallets
- Funds withdrawal
- Password hashing for security
- Database migrations and seeds
the detailed ERD diagram with the project overview and structure can be found below:
https://dbdesigner.page.link/m4SnghNuT9pf8Lhv9
Before you begin, ensure you have the following installed on your system:
- Node.js (v14 or later)
- npm (v6 or later)
- MySQL (or any other SQL database supported by Knex)
- NOTE: the cloud instance i used for this project is
clever cloud
you can see their website here:https://www.clever-cloud.com/
you can visit, set up your add-on, and then retrieve your necessary credentials
- Clone the repository:
git clone https://github.com/echewisi/Demo_wallet
cd demo_wallet
-
install dependencies
npm install
-
Create a .env file in the root directory and configure your environment variables:
DB_USER= DB_PASSWORD= DB_NAME= ADJUTOR_SECRET_KEY= PORT= FAUX_TOKEN=
-
create the database (if you choose local setup)
CREATE DATABASE demo_wallet_db;
-
run database migrations
npx knex migrate:latest --knexfile src/knexfile.ts
npm start
The server will start on http://localhost:3000 if you didnt provide a port in the .env file.
npm test
note:... the connection to the server is timed so the max_number of connections made to the database/server is limited.
POST /users/create-account Description: Create a new user Body Parameters: name, email, phone, password
POST /wallets/fund-wallet Description: Transfer funds to user wallet Body Parameters: userId, amount, password
POST /wallets/transfer-funds Description: Transfer funds between wallets Body Parameters: userId, recipient_wallet_Id, amount, password
POST /wallets/withdraw-funds Description: Withdraw funds from a wallet Body Parameters: userId, amount, password
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License
- Project Purpose: The README starts by explaining the purpose of the project and listing its features.
- Setup Instructions: Detailed steps to set up the project, including prerequisites, installation steps, database setup, and how to configure environment variables.
- Running the Application: Instructions on how to start the application.
- Running Tests: Instructions on how to run the unit tests.
- Project Structure: An overview of the project's directory structure to help understand where different components are located.
- API Endpoints: A list of available API endpoints with their descriptions and required parameters.
- Contributing: Information on how to contribute to the project.
- License: Licensing information.
This README should provide a comprehensive guide for anyone who wants to understand, set up, run, or contribute to your project.