This guide provides instructions for setting up and running the project on your local machine. The project consists of two parts:
- Smart Contracts (in the
/engine
directory) - Frontend (in the
/client
directory)
Make sure you have the following prerequisites installed on your system:
- pnpm
- dojo
- scarb
-
Clone the repository:
git clone https://github.com/SoarinSkySagar/stark-tic-tac-toe.git cd stark-tic-tac-toe
-
Install dependencies for the frontend:
cd client pnpm install
-
Create and switch into you own branch:
git branch <your-branch> git checkout <your-branch>
To run the entire project, including both smart contracts and the frontend:
-
Build and test the smart contracts:
pnpm run build-e pnpm run test-e
-
Run the frontend:
pnpm run dev-c
The frontend should now be running at http://localhost:3000
To work exclusively with the smart contracts:
-
Navigate to the
/engine
directory:cd engine
-
Build the contracts:
sozo build
-
Test the contracts:
sozo test
-
Format the contracts:
scarb fmt
If you want to check the formatting, use:
scarb fmt --check
To work exclusively with the frontend:
-
Navigate to the
/client
directory:cd client
-
Install dependencies:
pnpm install
-
Run the frontend in development mode:
pnpm run dev
-
To build the frontend for production:
pnpm run build
-
To test the frontend (linting):
pnpm run lint
pnpm run build-e
: Build the smart contracts.pnpm run test-e
: Test the smart contracts.pnpm run lint-e
: Format the smart contracts.pnpm run dev-c
: Run the frontend in development mode.pnpm run build-c
: Lint and build the frontend.pnpm run start-c
: Start the production build of the frontend.pnpm run lint-c
: Lint the frontend.
Run these commands from the /client
directory:
pnpm run dev
: Start the frontend in development mode.pnpm run build
: Build the frontend for production.pnpm run start
: Start the production build of the frontend.pnpm run lint
: Run linting checks.
- Follow our contributor's guide given here.
- Make sure to follow the respective commands for working on either the smart contracts or the frontend.
- Run
pnpm install
in the/client
directory before running the frontend for the first time. - Ensure the code is properly building, passing tests and formatted using
pnpm run check
at the root directory before making a pull request.