react-dex
The react-dex is a decentralized exchange built using React and NodeJS. It allows users to connect their digital wallet and exchange digital tokens. It also presents the available tokens for swapping in the Tokens page.
Before you begin, ensure you have met the following requirements:
- Clone the project repository:
git clone https://github.com/hadesbaker/nextjs-dex.git
cd nextjs-dex- Install the required frontend dependencies:
cd dex
npm install
# or
yarn installAnd then install the required backend dependencies:
cd ..
cd dexBack
npm install
# or
yarn installIn the dexBack folder, create a file called .env. Within the .env file, add a MORALIS_KEY variable with the moralis api key you can get from here.
i.e. MORALIS_KEY=dwindwdiwndiwniwndiwdinwdinwdidindiwn
In a seperate terminal window, run the backend node server:
Run the backend server:
cd dexBack
node index.jsIn another terminal window, run the development server::
cd ..
cd dex
npm run start
# or
yarn startFinally, open http://localhost:3000 with your browser to see the result.
API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.js.
The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.
Check out our Next.js deployment documentation for more details.

