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

Commit 022d9c7

Browse files
committed
chore: initial commit
0 parents  commit 022d9c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+14045
-0
lines changed

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.yarn/install-state.gz
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts
37+
tmp

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022-2024 Solana Foundation
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# template-next-tailwind-basic
2+
3+
This project is a preview. Please give feedback to [beeman](https://x.com/beeman_nl) on X.
4+
5+
## Getting Started
6+
7+
### Prerequisites
8+
9+
- Node v18.18.0 or higher
10+
11+
- Rust v1.77.2 or higher
12+
- Anchor CLI 0.30.1 or higher
13+
- Solana CLI 1.18.17 or higher
14+
15+
### Installation
16+
17+
#### Clone the repo
18+
19+
```shell
20+
git clone <repo-url>
21+
cd <repo-name>
22+
```
23+
24+
#### Install Dependencies
25+
26+
```shell
27+
pnpm install
28+
```
29+
30+
#### Start the web app
31+
32+
```
33+
pnpm dev
34+
```
35+
36+
## Apps
37+
38+
### anchor
39+
40+
This is a Solana program written in Rust using the Anchor framework.
41+
42+
#### Commands
43+
44+
You can use any normal anchor commands. Either move to the `anchor` directory and run the `anchor` command or prefix the command with `pnpm`, eg: `pnpm anchor`.
45+
46+
#### Sync the program id:
47+
48+
Running this command will create a new keypair in the `anchor/target/deploy` directory and save the address to the Anchor config file and update the `declare_id!` macro in the `./src/lib.rs` file of the program.
49+
50+
You will manually need to update the constant in `anchor/lib/basic-exports.ts` to match the new program id.
51+
52+
```shell
53+
pnpm anchor keys sync
54+
```
55+
56+
#### Build the program:
57+
58+
```shell
59+
pnpm anchor-build
60+
```
61+
62+
#### Start the test validator with the program deployed:
63+
64+
```shell
65+
pnpm anchor-localnet
66+
```
67+
68+
#### Run the tests
69+
70+
```shell
71+
pnpm anchor-test
72+
```
73+
74+
#### Deploy to Devnet
75+
76+
```shell
77+
pnpm anchor deploy --provider.cluster devnet
78+
```
79+
80+
### web
81+
82+
This is a React app that uses the Anchor generated client to interact with the Solana program.
83+
84+
#### Commands
85+
86+
Start the web app
87+
88+
```shell
89+
pnpm dev
90+
```
91+
92+
Build the web app
93+
94+
```shell
95+
pnpm build
96+
```

anchor/.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.anchor
2+
.DS_Store
3+
target/debug
4+
target/deploy
5+
target/release
6+
target/sbf-solana-solana
7+
target/test-ledger
8+
target/.rustc_info.json
9+
**/*.rs.bk
10+
node_modules
11+
test-ledger
12+
.yarn

anchor/.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.anchor
2+
.DS_Store
3+
target
4+
node_modules
5+
dist
6+
build
7+
test-ledger

anchor/Anchor.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[toolchain]
2+
anchor_version = "0.30.1"
3+
4+
[features]
5+
resolution = true
6+
skip-lint = false
7+
8+
[programs.localnet]
9+
basic = "6z68wfurCMYkZG51s1Et9BJEd9nJGUusjHXNt4dGbNNF"
10+
11+
[registry]
12+
url = "https://api.apr.dev"
13+
14+
[provider]
15+
cluster = "Localnet"
16+
wallet = "~/.config/solana/id.json"
17+
18+
[scripts]
19+
test = "../node_modules/.bin/jest --preset ts-jest"
20+
21+
[test]
22+
startup_wait = 5000
23+
shutdown_wait = 2000
24+
upgradeable = false
25+
26+
[test.validator]
27+
bind_address = "127.0.0.1"
28+
ledger = ".anchor/test-ledger"
29+
rpc_port = 8899

0 commit comments

Comments
 (0)