## Introduction

### Details

Tradexpro Exchange is a complete crypto coins exchange platform developed with Laravel and next js. It is the best choice to buy, sell or exchange any crypto coin that works via coin payment or bitcoin fork node. It will connect with a coin payment merchant account, or also connect with node. Our system is 100% secure and dynamic. It supports all cryptocurrency wallets including Coin Payment, Buy , Sell , Stop Limit, Deposit, Withdrawal, Referral system, and whatever you need. The most attractive feature of this platform is trading. In the trading system, you can place buy and sell orders according to your preferences of coin prices. Beside that, you can check your balance from wallet section. You can also check your buy-sell transaction status, deposit, withdrawal histories.

Demo

### Getting Started

The application has a few system requirements, so you will need to make sure your server meets the following requirements:

Admin side requirement :

1. Laravel 5.8+
2. PHP 7.4
3. MySQL 8.0
4. Intl PHP Extension
5. OpenSSL PHP Extension
6. PDO PHP Extension
7. Mbstring PHP Extension
8. Tokenizer PHP Extension
9. XML PHP Extension
10. Ctype PHP Extension
11. JSON PHP Extension
12. cURL PHP Extension
13. GD PHP Extension
14. ZIP PHP Extension
15. BC Math
16. Process Control System (Preferred Supervisord)
17. PHP Dependency Manager (Preferred Composer)
18. Redis Server For Queue Management
19. Setup Horizon Supervisor

User side requirement :

1. Nodejs 16.16.0
2. Yarn 1.22.19 or above
3. Nginx

### Permissions

After uploading the Tradexpro exchange to your server, you may need to configure some permissions. Firstly set all your directories permission to 755 and files to 644. Directories within the storage, vendor and the bootstrap/cache directories should be writable by your web server. Set permission to 775 for storage, vendor and the bootstrap/cache directories. So set these directories set the write permissions to the web server.
Example command
sudo chmod -R 777 /storage/
sudo chmod -R 777 /public/uploaded_file

## Key Features

### Admin Side

Admin Side Developed With LARAVEL

- Complete user management
- Support coin payment or Personal node
- Multiple coin using coin payment or personal node or bitgo
- Coin management
- Buy / Sell order management
- Trading management
- Broadcast Email
- Trade report
- Buy sell report
- Deposit management
- Withdrawal management
- KYC verification
- Manage referral system
- Admin settings
- Trade fees setting
- Coin Payment setting
- Bitcoin Node setting
- Bitgo Api setting
- Re-capcha setting
- Sms setting using twillo
- Fees setting
- FAQ Management
- Landing Setting
- Fully responsive and dynamic
- Easy to signup & signin
- Email verification
- Forgot password
- Profile management
- Password setup
- Security management

### User Side

User Side Developed With Next Js

- Easy to Signup & Signin
- Profile Management
- Notification
- Multi coin system
- Trading/ Exchange
- Order Book (buy, sell, stop limit)
- Coin Swap
- Supper easy and secure trading process
- Nice Wallet management
- Generate wallet address using coin payment or bitcoin node or bitgo
- Coin deposit system
- Coin withdrawal system
- Transaction Chart
- Deposit Chart
- Withdrawal Chart
- Google Auth Setup
- Phone Verification
- KYC System
- Password Setup
- Security Management
- An user can send coin to both internal and external address
- Use Google authentication
- Use Two factor authentication for login
- Three level Referral System
- Fully Responsive and Dynamic

## Files in Plugin

'Tradexpro Exchange' is bundled with files:

- Tradexpro-exchange-admin.zip
- Tradexpro-exchange-user.zip
- documentation.zip
- database.zip

## Installation Process

### Local Installation (Admin Part)

#### Setup for local pc

- It's a super easy installation process
- Need to create a database
- Go to phpmyadmin or you can create database by using command "create database tradexpro_exchange_db"
- Go to this path "/var/www/html/"

Here you keep your file

open terminal in this path

write "php artisan serve" and hit enter

- Then run the project and complete step by step installation

Welcome page. Start the install process

After run the project you see this page

- Check server requirement

- Check and give permission

- Verify Envato Purchase code

  Put here your purchase code

- Setup project Environment

  Give here your app title, database name, username, password etc

- Then click the setup install button

- Installation Finish

- now click here to exit

- Sign in page

### Installation (vps server) (admin part)

login to the server

suppose "root@demo-server:"

- install the "nginx"

  "sudo apt install nginx"

- Get a listing of the application profiles:

  sudo ufw app list

- It is recommended that you enable the most restrictive profile that will still allow the traffic you’ve configured. Right now, we will only need to allow traffic on port 80. You can enable this by typing:

  sudo ufw allow 'Nginx HTTP'

- check the status

  sudo ufw status

  As confirmed by this out, the service has started successfully. However, the best way to test this is to actually request a page from Nginx. You can access the default Nginx landing page to confirm that the software is running properly by navigating to your server’s IP address.

- Managing the Nginx Process

- then update

  sudo apt-get update

- Now need to install php

  sudo apt -y install php7.4

- We use nginx so disable the apache2

  sudo systemctl disable --now apache2

- Install fpm

  sudo apt-get install nginx php7.4-fpm

- Install some php package

  sudo apt-get install -y php7.4-cli php7.4-json php7.4-common php7.4-mysql php7.4-zip php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath

- Install mysql server

  sudo apt install mysql-server

- start mysql server and check

  sudo systemctl start mysql.service

  mysql

- Add password to user

  ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'myPassword';

  flush privileges;

- Create new database

  create database demo;

  quit;

- Go to nginx path

  cd /etc/nginx/sites-available/

  nano default

  Delete everything and just keep as bellow image

- Make a directory to /var/www/ path

  cd /var/www/

  mkdr demo (demo is the folder name)

  inside the demo folder just keep the admin code file (extract files)

  This should looks like --->

- create a new .env file and edit it

  add the database name, user name, password etc (can follow the .env.example file)

  nano .env

  This should looks like --->

- install the composer

  if composer not found run this command first,

  sudo apt install composer

  Then

  composer install

- Now need have some permission

  sudo chgrp -R www-data storage bootstrap/cache

  sudo chmod -R ug+rwx storage bootstrap/cache

  another file need to give permission

  sudo chmod -R 777 /public/uploaded_file

- Generate the key

  php artisan key:generate

- Migration the database file also seed

  php artisan migrate --seed

- Install passport package

  php artisan passport:install

- Now all done. just open browser and check site

- Another thing: need to use supervisor so install first

  sudo apt update && sudo apt install supervisor

- Config supervisor

  sudo systemctl status supervisor

  got to this path and open cron.conf file

  cd /etc/supervisor/conf.d/

  nano cron.conf

  inside this the cron.conf file write down the below code and save it

  here need to configure sockets, scheduler and horizon

- Then run these command

  sudo supervisorctl reread

  sudo supervisorctl update

  sudo supervisorctl status

### Sub Domain Installation (Admin Part)

#### Setup for sub domain

- It's a super easy installation process
- Go to cpanel
- Here is a sub domain named "tradexpro.itech-softsolutions.com"
- Create a database
- Create a database user
- Add user to database
- Then go to file manager
- Go to your domain folder "tradexpro.itech-softsolutions.com"
- Upload here your web code
- Select file
- Unzip web-code.zip into domain folder
- Extract the uploaded file then move the file into your site folder
- Select all file and move to your site folder
- Modify your subdomain root folder and add /public
- Then run the project and complete step by step installation
- Then run the project and complete step by step installation

Welcome page. Start the install process

After run the project you see this page

- Check server requirement

- Check and give permission

- Verify Envato Purchase code

  Put here your purchase code

- Setup project Environment

- Fill up Environment Setup Form

  Give here your app title, database name, username, password etc

- Then click the setup install button

- Installation Finish

- Then open a browser and run the url like "http://tradexpro.itech-softsolutions.com/" and hit enter

- Sign in page

### Installation for main domain (Admin Part)

- It's a super easy installation process
- Go to cpanel
- Create a database
- Create a database user
- Add user to database
- Then go to file manager
- Upload here your web code
- Select file
- Unzip web-code.zip into public_html folder
- Extract the uploaded file then move the file into public_html folder
- Select all file and move to your site folder
- Now select the example.htaccess file and rename it to .htaccess
- Then run the project and complete step by step installation
- Then run the project and complete step by step installation

Welcome page. Start the install process

After run the project you see this page

- Check server requirement

- Check and give permission

- Verify Envato Purchase code

  Put here your purchase code

- Setup project Environment

- Fill up Environment Setup Form

  Give here your app title, database name, username, password etc

- Then click the setup install button

- Installation Finish

- Then open a browser and run the url like "http://tradexpro-exchange.com/" and hit enter

- Sign In page

### Installation in VPS server (user part)

login to the server

suppose "root@demo-server:"

- Make a directory to /var/www/ path

  cd /var/www/

  mkdr demonode (demonode is the folder name)

  inside the demonode folder just keep the user code file (extract files)

  This should looks like --->

- Install nodejs

  sudo apt install nodejs

- install yarn

  sudo apt install yarn

- Now go to the demonode path

  cd /var/www/demonode/

  yarn install

- Then go to this path

  cd /etc/nginx/sites-available/

  cp -r default nodedemo

  nano nodedemo

  in the file write down these code

  Then run this command

  sudo ln -s /etc/nginx/sites-available/nodedemo /etc/nginx/sites-enabled/

  service nginx reload

  service nginx reload

- now time to build the project

  cd /var/www/demonode/

  open the ".env.production" file

  nano .env.production

  change the text

  NEXT_PUBLIC_BASE_URL ='your domain name /api'

  GENERATE_SOURCEMAP = false

  NEXT_PUBLIC_WS_URL = 'wss://your domain name/app/test'

  NEXT_PUBLIC_STRIPE_SECRET_KEY= "your_key"

  NEXT_PUBLIC_PAYPAL_CLIENT_KEY="your_key"

  NEXT_PUBLIC_HOST_SOCKET ="your domain name"

  and other things like as below image

- build the yarn

  yarn installs

  then

  yarn starts

- add pm2

  yarn add pm2 -g

- now go to supervisor

  cd /etc/supervisor/conf.d

  nano cron.conf

  add here node program

- Then run these command

  sudo supervisorctl reread

  sudo supervisorctl update

  sudo supervisorctl status

- if not working then build the yarn again

  yarn installs

  then

  yarn starts

- Now all done. just open browser and check site

### Installation (user part)

- It's a super easy installation process
- Before deployment edit your .env and add all your backend server info
- Go to github
- If you have a account sign in if you dont have an account then signup
- After login click on the new button on the left top side
- Type a name for your project and click create repository
- Type all the commands and upload your project to git
- Now login to vercel.com with github
- Then click on the add new dropdown then click on the project option
- Then you can find your github project name there click on import and your website deployment will start
- And your project will be successfully deployed

## Some configuration

- You need to run the queue all time with the help of supervisor. Here we use the redis server for withdrawal process
  When user place a withdrawal order it will go to queue
  some command -> need to run always
  "php artisan schedule:run"
  "php artisan horizon"
  "php artisan websockets:serve --port=6005" (port can change)

## Admin Panel

- Admin panel is developed with Laravel 8
- The database is MySql

### Auth System

- Login
- Forgot password
- Reset password

### Dashboard

- Admin Dashboard

### Coin Settings

- Coin list

  From here admin can active or deactive any coin

- From here admin can update the coin rate with USD, that show in coin price

- New Coin Add , from here you can add new coin

  coin type : Please make sure your coin type is right. Never input wrong coin type

  coin network : (coin payment or personal network bitcoin base node)Please make sure your coin network is right.You never change this network. So be careful

- Coin Configuration , from here you can update coin
- Coin Api Setup (for Coin Payment Setting)
- Coin Api Setup (for Bitcoin Api Setting)
- Coin Api Setup (for Bitgo Setting)
- Coin Api Setup (for Bitgo Api Setting)
- Coin Api Setup (for ERC20 Api Setting)
- Coin Api Setup (for BEP20 Api Setting)
- Coin Api Setup (BEP20 or ERC20 calling api )
  (It should be same as image or also changeable)
- Coin Pairs

  Trading pair of base coin and trade coin

  By clicking add new pair admin can add new coin pair

  Also update the coin pair

  if you want you can update your chart data with cryptocompare historical data . we take the data from api and save it to database, when trade happened in your site it also save in database and show you the latest price

  if you don't need this just ignore please. no problem

### User Management

- User list (Active user list, suspended , deleted, pending email/phone verify user list)
- User Profile
- Add New User

### User KYC

- Pending id verification

- Pending kyc list

  In details page ,Pending id verify approve or reject process

### Wallet

- User Wallet List

  All list of user wallets

- Send coin to user

  admin can send coin to any user's wallet if he want

- Send coin history

### Deposit/Withdrawal Report

- All Transaction History

  Deposit list of user

- Withdrawal list of user

- Pending Withdrawal

  From here admin can accept or reject the pending withdrawals

### Trade Report

- All buy order list
- All Sell order list
- All Stop limit order list
- All Trade list

### Token Deposit

- Token pending deposit

  Suppose user deposit any token to system but not fully deposited for any reason, so from here admin can approve or reject it

- Estimate gas sent report
- Admin token receive history
- All Trade list

### Notification

- Send notification to all user
- Send Bulk Email

### Language List

- Language List , admin can modify from here

### Currency List

- Currency List , admin can modify from here

  get all currency : if click then get all the currency

  Live update rate : if click then update the rate from api

  Add New Currency : able to add new currency

### Country List

- Country List , admin can modify from here

### Fiat Deposit

- fiat deposit pending list, from here admin can approve or reject the deposit fiat deposit rejected list fiat deposit approve list
- fiat deposit bank payment admin bank list
- payment method list

### FAQ

- Faq list

### Admin Settings

- General Setting

  Check this carefully and update the all things using the input label

- Email Setting

  Check this carefully and update the all things using the input label

- Twillo Setting

  Check this carefully and update the all things using the input label

- Google Captcha Setting
  if you stop this feature you can disable it from here
- Coin Payment Setting

  Check this carefully and update the all things using the input label

  for more info please follow our coin payment integration part

- Personal Node Setting (Bitcoin base)

  Check this carefully and update the all things using the input label

  add here your bitcoin base credential

- Trade fees Setting

  Check this carefully and update the all things using the input label

- Referral Setting

  we have 3 level referral bonus, when user make external withdrawal then it distribute instantly

- Some configuration setting

### Feature Settings

- Update cookie setting
  - Enable cookie : yes or no, that means it shows or not in user end
  - Cookie Header Text : you can change Cookie title from here
  - Cookie Button Text : you can change text from here
  - Cookie description : detail text of cookie
  - Select page for cookie : when user click the button which page you want to show
  - Cookie Image : option for cookie image
- Update Live Chat api
  - Enable live chat : yes or no, that means it shows or not in user end
  - Chat api key : you can set chat api key from here
- Swap feature enable/disable
  - Enable Swap : yes or no, that means it shows or not in user end
- Fiat deposit enable disable
  - Enable Fiat Deposit : yes or no, that means it shows or not in user end
  - Enable Fiat Deposit 2FA : yes or no, that means it require or not in user end when try to send fiat deposit request

### Api Settings

- CryproCompare Api Details
  - CryptoCompare api key : for updating chart data, coin rate we use this api key
- Stripe Settings
  - Stripe Publishable key : public key
  - Stripe Secret key : secret key

### Landing Settings

- Landing Related Setting can find here with specific section
- Landing Banner Setting

  From here admin can add new banner also edit banner

- Landing Feature Setting

  From here admin can add new feature also edit feature

- Landing social media Setting
- Landing announcement Setting

## User Panel

Developed with Next Js

### User landing page

- User landing

### User Auth

- User Login
- User Signup
- User Forgot password
- User Reset password

### User exchange page

- User Exchange Dashboard

  this is the main page of this site, so explore this page perfectly please

### Profile

- User Profile
- Edit Profile
- User Change Password
- User KYC
- User Phone verification
- User Security
- User Gauth

### Wallet (Deposit/Withdrawal)

- User Wallet
- You can deposit any coin , and the deposit address generated with coinpayment. Here user can generate new address and copy it and send to others
- You can deposit any coin from bank,wallet,paypal and from credit card
- User can withdrawal to both internal and external address. Before withdrawal user must have activate gauth
- User withdrawal report
- User deposit report
- User wallet swap
- User wallet swap history

### Exchange

- Exchange dashboard, from here you can place buy, sell, and stop limit order

### Exchange Report

- User Buy order
- User Sell order
- User transaction report

### Referral

- User referral link. Copy the url and also share it to social media
- User referral user count and reference details
- User referral commission history

## Multi Language

only for admin end

- our system support multi language, for this you have some configuration
- How to add a new language ------>
To add a new language you need add the new language file in .json format
suppose i want to add Indonesian language
go to "project_name/resources/lang" and inside this add new file "id.json"

Then go to "project_name/app/Helper/helpers.php" file.
there is a function "langName()"
inside the function add your new language key, look like the below screenshot

then open the terminal of the project path and run this command to sync all language key ---

like "/var/www/tradexpro-exchange/"

"php artisan translation:sync-missing-translation-keys "

After this command now all language key automatically added to the new "id.json" file

then you need to add here, all the translated text one by one

We already added here some language json file, you can put here all the translated text one by one
for the es.json file ------

Now we can change the language from setting and check the translation

## Wallet notifier for personal node

- for the wallet external deposit you should have some configuration at you node config file. if you faces any problem contact with a node expert, or our team will try to help you

## Coin Payment Integration

# Integrating coinpayments (account setup)

### 1) Account Setup

- Account Settings and Important Information

  To start accepting cryptocurrency payments, the first step is the create a CoinPayments account! Get started by following along the steps below to sign up for a CoinPayments account and customize the account settings that are ideal for your business.

  SIGN UP

  Sign up for a CoinPayments account here or click the Sign Up button in the top right corner of the CoinPayments website .
  Fill out the appropriate details on the Create New Account form. Sign Up Form
  After signing up, verify your account by clicking the activation link in the email sent to the email address you used to register your account. Account Activation Email

  ### 2) ACCOUNT SETTINGS

  Find your profile and account settings here as well as the important merchant information (Merchant ID, IPN Key, etc…)
  Login to your CoinPayments account for the first time.
  Check your email for the verification code to login. Email Verification Code
  Go to: “ACCOUNT -> ACCOUNT SETTINGS“. Account Settings
  In the “BASIC SETTINGS” tab, you will find your Merchant ID. Save/Copy your Merchant ID somewhere for later use. Merchant ID
  In the “PUBLIC INFO” tab, you can enter your Name, Email, URL that will be displayed publicly to customers sending payments. Public Info
  In the “LOGIN & SECURITY” tab, change 2FA method from email to Google Authenticator or one of the other more convenient options. Login & Security
  In the “MERCHANT SETTINGS” tab, set your IPN Secret (this can be any strong/random string of characters). Save/Copy your IPN Secret somewhere for later use. Select your base currency and also toggle which notification emails to receive. Merchant Settings

  ### 3) COIN SETTINGS

  Modify which coins you want to accept as payment and what to do after receiving a payment
  Go to: “ACCOUNT -> COIN ACCEPTANCE SETTINGS“. Coin Acceptance Settings Navigation
  Select which coins you want to accept as payment by checking the box in front of each coin. Coin Acceptance Selection
  Make sure to scroll all the way to the bottom of the page and click “Update Coin Preferences”.
  This is the minimum you need to configure to begin accepting crypto payments to your store. Leave the rest of the options for later (ie. conversion, fiat settlement, payment forwarding)

  ### 4) API KEYS

  You will need the information in this section later to link your CoinPayments account to your eCommerce store. The API keys are what connects your store with the CoinPayments payment system.
  Go to: “ACCOUNT -> API KEYS“. API Keys Navigation
  click the edit permission button. here you need to allow the api access and save it , otherwise the coin payment api never work
  Use the API Key that’s already there, or generate a new key by clicking the “GENERATE NEW KEY” button. API Keys
  Save/Copy your API Public Key and your API Private Key somewhere for later use.
  By the time you have finished going through the above step-by-step process, you should have recorded the following information for future use:
  MERCHANT ID
  IPN SECRET
  API PUBLIC KEY
  API PRIVATE KEY

  This will add to your admin coin payment setting

  ### 5) Wallet Notifier

  Deposit with coin payment

  add here your IPN Secret and notifier url
  this will help you to deposit any coin to your site
  your url /api/coin-payment-notifier (example : https://tradexpro-laravel.cdibrandstudio.com/api/coin-payment-notifier)

## Public Api

- Get market price

  https://tradexpro-laravel.cdibrandstudio.com/api/v1/markets/price/BTC_USDT

  Request Parameter | Data Type | Required | Description
  --- | --- | --- | ---
  symbol | string | false | coin pair like BTC_USDT,LTC_USDT,ETH_USDT,USDT_BTC etc

- The response is a list of data values displayed in an array in the following order:

  if url is "https://tradexpro-laravel.cdibrandstudio.com/api/v1/markets/price/BTC_USDT" then response =

  ['success' => true/false, 'message' => 'success or error message', 'data' => {}

  if url is "https://tradexpro-laravel.cdibrandstudio.com/api/v1/markets/price" then response =

  ['success' => true/false, 'message' => 'success or error message', 'data' => [{},{},....]

  Data Field | Data Type | Description
  --- | --- | ---
  symbol | string | symbol name
  trade_coin | string | trade coin full name
  base_coin | string | base coin full name
  price | string | current price
  price_change_24h | string | price change in last 24 hour
  volume_24h | string | last 24 hour volume
  high_24h | string | highest price of last 24 hour
  low_24h | string | lowest price of last 24 hour

- Get market orderBook data

  https://tradexpro-laravel.cdibrandstudio.com/api/v1/markets/orderBook/BTC_USDT

  Request Parameter | Data Type | Required | Description
  --- | --- | --- | ---
  symbol | string | true | coin pair like BTC_USDT,LTC_USDT,ETH_USDT,USDT_BTC etc
  limit | Integer | false | maximum number of records returned
  type | string | false | order type buy, sell , buy_sell, default is buy_sell

- The response is a list of data values displayed in an array in the following order:

  ['success' => true/false, 'message' => 'success or error message', 'data' => ['type' => buy_sell,'limit' => 10, 'buys' => [{},{}..],, 'sells' => [{},{}..]]

  Data Field | Data Type | Description
  --- | --- | ---
  amount | string | quote units traded
  price | string | trade price
  total | string | total trade coin (amount * price)
  exchanged | string | already exchanged amount
  date_time | string | time the record was pushed

- Get market trade data

  https://tradexpro-laravel.cdibrandstudio.com/api/v1/markets/trade/BTC_USDT

  Request Parameter | Data Type | Required | Description
  --- | --- | --- | ---
  symbol | string | true | coin pair like BTC_USDT,LTC_USDT,ETH_USDT,USDT_BTC etc
  limit | Integer | false | maximum number of records returned

- The response is a list of data values displayed in an array in the following order:

  ['success' => true/false, 'message' => 'success or error message', 'data' => ['limit' => 10, 'trade' => [{},{}..]]

  Data Field | Data Type | Description
  --- | --- | ---
  amount | string | quote units traded
  price | string | trade price
  last_price | string | market last traded price
  price_order_type | string | taker's trade side (BUY, SELL)
  total | string | total trade coin
  time | string | time the record was pushed

- Get market chart data

  https://tradexpro-laravel.cdibrandstudio.com/api/v1/markets/chart/BTC_USDT

  Request

  Request Parameter | Data Type | Required | Description
  --- | --- | --- | ---
  symbol | string | true | coin pair like BTC_USDT,LTC_USDT,ETH_USDT,USDT_BTC etc
  start_time | long | false | filters by time. The default value is 0.
  end_time | long | false | filters by time. The default value is current time
  interval | Integer | false | 5 = 5minData, 15= 15 min Data, 30 = 30 min Data, 120 = 2 hour Data, 240 = 4 hour data, 1440 = 1 day data

- The response is a list of candles data values displayed in an array in the following order:

  ['success' => true/false, 'message' => 'success or error message', 'data' => [{},{},...]

  Data Field | Data Type | Description
  --- | --- | ---
  time | long | time the record was pushed
  low | string | lowest price over the interval
  high | string | highest price over the interval
  open | string | price at the start time
  close | string | price at the end time
  volume | string | base units traded over the interval

## Release log

                                Version 1.1 ( September 2022 )

## Thank You

Again, thank you for purchasing Tradexpro exchange. If you need some help, or support please use email or contact form via codecanyon Profile site.

Hope you happy with the Tradexpro Exchange , system, all the best with your business.

Copyright © 2022 . All rights reserved Tradexpro Exchange