Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit adacdf6

Browse files
committed
doc: Fixed description about custom templates
1 parent b78e16d commit adacdf6

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

docs/quick-start/customize-your-own-dApp.mdx

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ These two directories together form the complete project structure, with `snfoun
1818
You can edit your smart contract file `YourContract.cairo` in the `packages/snfoundry/contracts/src` directory. This is where all the contract logic is stored. When modifying this file, ensure your contract logic meets the project requirements and is thoroughly tested before deployment.
1919

2020
2. **Deployment Scripts**:
21-
The deployment scripts are located in `packages/snfoundry/script-js/deploy.js`. This script is used to deploy your smart contract to the specified blockchain network. By editing this script, you can adjust the deployment process, such as specifying different networks or contract parameters.
21+
The deployment scripts are located in `packages/snfoundry/scripts-ts/deploy.ts`. This script is used to deploy your smart contract to the specified blockchain network. By editing this script, you can adjust the deployment process, such as specifying different networks or contract parameters.
2222

2323
3. **Test Smart Contracts**:
2424
To ensure your smart contracts work correctly, write and run tests in the `packages/snfoundry/contracts/src/test` directory. These tests can be executed using the `yarn test` command. This helps catch and fix potential errors before deployment.
@@ -27,25 +27,33 @@ These two directories together form the complete project structure, with `snfoun
2727

2828
### Customize Nextjs App
2929

30-
The `nextjs` directory is a critical part of your dApp, handling the frontend logic and user interface. It offers robust features and flexibility to build a dynamic and responsive application. Let's dive into the main characteristics and how you can leverage them for your project.
30+
The `nextjs` directory is a critical part of your dApp, handling the frontend logic and user interface. It offers robust features and flexibility to build a dynamic and responsive application.
31+
By following these steps, you can effectively customize the pre-built components and use preset hooks to create a unique and fully functional user interface for your decentralized application.
32+
Let's dive into the main characteristics and how you can leverage them for your project.
3133

3234
1. **Edit Frontend Homepage**:
33-
You can edit your frontend homepage in `packages/nextjs/app/page.tsx`. This file is one of the entry points of your application, and modifying it will change what users see when they visit your homepage. By customizing this file, you can tailor the first impression your users get, showcasing key features and information prominently.
35+
You can edit your frontend homepage in `packages/nextjs/app/page.tsx`.
36+
This file is one of the entry points of your application, and modifying it will change what users see when they visit your homepage.
37+
By customizing this file, you can tailor the first impression your users get, showcasing key features and information prominently.
3438

3539
2. **Routing and Page Layouts**:
36-
Next.js supports a powerful and flexible routing system. For configuring routing and page layouts, refer to the Next.js documentation. The documentation provides detailed guides to help you define routes and configure page layouts, ensuring your application has an intuitive and powerful user interface. Next.js enables both server-side and client-side components, allowing you to build a seamless user experience.
40+
Next.js supports a powerful and flexible routing system. For configuring routing and page layouts, refer to the [Next.js documentation](https://nextjs.org/docs/app/building-your-application/routing).
41+
The documentation provides detailed guides to help you define routes and configure page layouts, ensuring your application has an intuitive and powerful user interface. Next.js enables both server-side and client-side components, allowing you to build a seamless user experience.
3742

38-
3. **UI Styling Options**:
43+
3. **UI Styling**:
3944
The Next.js app supports various UI styling solutions including Tailwind CSS, CSS-in-JS (like styled-components or emotion), and traditional CSS. This flexibility allows you to choose the best styling approach that fits your project requirements and developer preferences.
4045

4146
4. **State Management**:
4247
For state management, the default solution provided is Zustand. Zustand is a small, fast, and scalable state-management solution that works well with React and Next.js. It simplifies managing global state in your application without the boilerplate often associated with other state management libraries.
4348

44-
5. **Server-side and Client-side Components**:
45-
Next.js allows you to utilize both server-side and client-side components. This hybrid approach can optimize performance and user experience by pre-rendering parts of your application on the server while enabling dynamic interactions on the client.
49+
5. **Scaffold-Stark Configuration**:
50+
The configuration for Scaffold-Stark is primarily contained in the `packages/nextjs/scaffold.config.ts` file.
51+
The folders such as utils, web3, and components under the scaffold-stark directory do not hold configurations but rather helper functions that implement the framework itself. These functions handle different aspects of the project, including utilities for smart contract interactions, web3 setup, and reusable UI components tailored for Starknet integration.
52+
These folders should mostly be untouched unless users have a deep understanding of the framework and aim to create their own dApp.
4653

47-
6. **Scaffold-Stark Configuration**:
48-
The configuration for Scaffold-Stark is contained within various folders such as `utils`, `web3`, and `components` under the `scaffold-stark` directory. These configurations handle different aspects of the project, including utilities for smart contract interactions, web3 setup, and reusable UI components tailored for Starknet integration.
54+
6. **Use pre-built components and hooks**
55+
Use the preset functionality provided under the components and hooks folder to form your own business logic by further encapsulating and including hooks and components.
56+
For more details on the available components and how to use them, please refer to the [components](../components) and [Interacting with Your Smart Contracts](../hooks) section.
4957

5058
### Custom Scaffold Stark Components
5159

@@ -103,11 +111,10 @@ In this example, the `MyBalance` component:
103111
4. **Integrate with Your Application**:
104112
Use your custom component in your application wherever needed. This allows you to maintain consistency while customizing components for specific business requirements.
105113

106-
By following these steps, you can effectively customize the pre-built components to create a unique and functional user interface for your decentralized application. For more details on the available components and how to use them, please refer to the [components](./components) section.
107114

108-
### Custom Scaffold Stark Hooks
115+
### Using Scaffold Stark Hooks
109116

110117
The `hooks` directory, located at `packages/nextjs/hooks/scaffold-stark`, offers several hooks.
111118
Scaffold-Stark 2 provides a collection of custom React hooks designed to simplify interactions with your deployed smart contracts.
112119
These hooks are wrappers around Starknet-React, an easy-to-use interface with TypeScript autocompletions for reading from, writing to, and monitoring events emitted by your smart contracts.
113-
For more details, please see the [Interacting with Your Smart Contracts](./hooks) section.
120+
For more details, please see the [Interacting with Your Smart Contracts](../hooks) section.

docs/quick-start/environment.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Visit your app on: `http://localhost:3000`. You can interact with your smart con
4545

4646
- Edit your smart contract `YourContract.cairo` in `packages/snfoundry/contracts/src`.
4747
- Edit your frontend homepage at `packages/nextjs/app/page.tsx`. For guidance on [routing](https://nextjs.org/docs/app/building-your-application/routing/defining-routes) and configuring [pages/layouts](https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts) checkout the Next.js documentation.
48-
- Edit your deployment scripts in `packages/snfoundry/script-js/deploy.js`.
48+
- Edit your deployment scripts in `packages/snfoundry/script-ts/deploy.ts`.
4949
- Edit your smart contract test in: `packages/snfoundry/contracts/src/test`. To run test use `yarn test`.
5050

5151
see more detail at [customize-your-own-dApp](./customize-your-own-dApp) to customize your own dApp.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@
4242
},
4343
"engines": {
4444
"node": ">=16.14"
45-
}
45+
},
46+
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
4647
}

0 commit comments

Comments
 (0)