You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 23, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: docs/quick-start/customize-your-own-dApp.mdx
+19-12Lines changed: 19 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ These two directories together form the complete project structure, with `snfoun
18
18
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.
19
19
20
20
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.
22
22
23
23
3.**Test Smart Contracts**:
24
24
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
27
27
28
28
### Customize Nextjs App
29
29
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.
31
33
32
34
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.
34
38
35
39
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.
37
42
38
-
3.**UI Styling Options**:
43
+
3.**UI Styling**:
39
44
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.
40
45
41
46
4.**State Management**:
42
47
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.
43
48
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.
46
53
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.
49
57
50
58
### Custom Scaffold Stark Components
51
59
@@ -103,11 +111,10 @@ In this example, the `MyBalance` component:
103
111
4.**Integrate with Your Application**:
104
112
Use your custom component in your application wherever needed. This allows you to maintain consistency while customizing components for specific business requirements.
105
113
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.
107
114
108
-
### Custom Scaffold Stark Hooks
115
+
### Using Scaffold Stark Hooks
109
116
110
117
The `hooks` directory, located at `packages/nextjs/hooks/scaffold-stark`, offers several hooks.
111
118
Scaffold-Stark 2 provides a collection of custom React hooks designed to simplify interactions with your deployed smart contracts.
112
119
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.
Copy file name to clipboardExpand all lines: docs/quick-start/environment.mdx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ Visit your app on: `http://localhost:3000`. You can interact with your smart con
45
45
46
46
- Edit your smart contract `YourContract.cairo` in `packages/snfoundry/contracts/src`.
47
47
- 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`.
49
49
- Edit your smart contract test in: `packages/snfoundry/contracts/src/test`. To run test use `yarn test`.
50
50
51
51
see more detail at [customize-your-own-dApp](./customize-your-own-dApp) to customize your own dApp.
0 commit comments