This repo includes the following packages/apps:
Contracts
: Soroban smart contracts for the app.Dapp
: a Next.js & Soroban React app to manage the indexes.Docs
: a Gitbook app to autogenerate the docs of the apps.Landing
: : a Next.js app thats shows relevant info about the project.@repo/ui
: a stub React component library shared by bothweb
anddocs
applications@repo/eslint-config
:eslint
configurations (includeseslint-config-next
andeslint-config-prettier
)@repo/typescript-config
:tsconfig.json
s used throughout the monorepo
Each package/app is crafted with 100% love by the paltalabs team🥑.
First run the following code in a new terminal located in the repo folder to initalize the container:
docker compose up -d
then, once the container is up, run:
bash run.sh
# or
docker exec --tty --interactive defindex-soroban bash
to explore and use the container.
Once inside the container, install the project dependencies by running:
yarn
To run the development instances of the apps simply run yarn dev
. Turbo repo will automatically run all the apps together.
If you need to run just one app add the flag --filter appname
. The code should look like:
yarn dev --filter dapp
while inside the docker container you can deploy build and test the smart contracts.
to make this happen, please move into the contracts app folder cd apps/contracts
and
run make build
.
To build the smart contracts simply run:
bash run
cd apps/contracts
make build
from the repo root folder.
Before deploying any contract, you need to setup your secrets:
So, create a .env
file in the apps/contracts
folder with the following content:
cp apps/contracts/.env.example apps/contracts/.env
and fill in the values for the ADMIN_SECRET_KEY
, DEFINDEX_RECEIVER_SECRET_KEY
and MAINNET_RPC_URL
variables.
To deploy the factory contract run:
bash run.sh
cd apps/contracts
yarn deploy-factory
Once you have deployed an instance of the factory contract. You can publish the addresses to be used by anyone on the network. To do this run:
bash run.sh
cd apps/contracts
yarn publish-addresses <network>
where <network>
is the network you are deploying to. The options are testnet
or mainnet
.
This Turborepo has some additional tools already setup for you:
- TypeScript for static type checking
- ESLint for code linting
- Prettier for code formatting
To build all apps and packages, run the following command:
cd my-turborepo
yarn build