create-fogo-app 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +195 -54
- package/package.json +11 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rokan0-0
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,68 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# 🔥 create-fogo-app
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**The fastest way to build on Fogo Chain**
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
npm install
|
|
11
|
-
npm run dev
|
|
12
|
-
```
|
|
7
|
+
[](https://www.npmjs.com/package/create-fogo-app)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
[](https://www.npmjs.com/package/create-fogo-app)
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
Scaffold a production-ready Fogo dApp with Sessions SDK in seconds.
|
|
15
12
|
|
|
16
|
-
-
|
|
17
|
-
- **Fogo Sessions SDK** pre-configured for gasless transactions
|
|
18
|
-
- **Solana Wallet Adapters** (Phantom, Solflare, etc.)
|
|
19
|
-
- **TailwindCSS** + **shadcn/ui** for beautiful UI
|
|
20
|
-
- **SPL Memo Demo** to showcase session key signing
|
|
13
|
+
[Quick Start](#-quick-start) • [Features](#-features) • [Documentation](#-documentation) • [Examples](#-examples)
|
|
21
14
|
|
|
22
|
-
|
|
15
|
+
</div>
|
|
23
16
|
|
|
24
|
-
|
|
25
|
-
- ✅ Gasless transactions via Fogo Sessions
|
|
26
|
-
- ✅ Session key management out of the box
|
|
27
|
-
- ✅ Modern, responsive UI components
|
|
28
|
-
- ✅ TypeScript for type safety
|
|
29
|
-
- ✅ Production-ready configuration
|
|
17
|
+
---
|
|
30
18
|
|
|
31
|
-
##
|
|
19
|
+
## 🚀 Quick Start
|
|
32
20
|
|
|
33
|
-
|
|
21
|
+
Get started with a single command:
|
|
34
22
|
|
|
35
23
|
```bash
|
|
36
|
-
|
|
37
|
-
npx create-fogo-app
|
|
38
|
-
|
|
39
|
-
# With project name
|
|
40
|
-
npx create-fogo-app my-awesome-dapp
|
|
24
|
+
npx create-fogo-app my-fogo-app
|
|
41
25
|
```
|
|
42
26
|
|
|
43
|
-
|
|
27
|
+
Then:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
cd my-fogo-app
|
|
31
|
+
npm install
|
|
32
|
+
npm run dev
|
|
33
|
+
```
|
|
44
34
|
|
|
45
|
-
|
|
35
|
+
Open [http://localhost:3000](http://localhost:3000) and start building! 🎉
|
|
46
36
|
|
|
47
|
-
|
|
37
|
+
---
|
|
48
38
|
|
|
49
|
-
|
|
50
|
-
NEXT_PUBLIC_PAYMASTER_URL=your-paymaster-url
|
|
51
|
-
NEXT_PUBLIC_SPONSOR_PUBLIC_KEY=your-sponsor-key
|
|
52
|
-
```
|
|
39
|
+
## ✨ Features
|
|
53
40
|
|
|
54
|
-
|
|
41
|
+
- **⚡ Zero-Config Setup** - Start building immediately with sensible defaults
|
|
42
|
+
- **🔑 Fogo Sessions SDK** - Gasless transactions pre-configured
|
|
43
|
+
- **💳 Wallet Integration** - Phantom, Solflare, and all Solana wallets supported
|
|
44
|
+
- **🎨 Modern UI** - Beautiful components with shadcn/ui + TailwindCSS
|
|
45
|
+
- **📝 TypeScript** - Full type safety out of the box
|
|
46
|
+
- **🎯 Demo Included** - Working SPL Memo transaction example
|
|
47
|
+
- **🌐 Next.js 14** - App Router, Server Components, and more
|
|
48
|
+
- **📱 Responsive** - Mobile-first design that works everywhere
|
|
55
49
|
|
|
56
|
-
|
|
57
|
-
npm install
|
|
58
|
-
```
|
|
50
|
+
---
|
|
59
51
|
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
npm run dev
|
|
63
|
-
```
|
|
52
|
+
## 📦 What's Included
|
|
64
53
|
|
|
65
|
-
|
|
54
|
+
Your scaffolded project includes:
|
|
66
55
|
|
|
67
56
|
```
|
|
68
57
|
my-fogo-app/
|
|
@@ -85,25 +74,177 @@ my-fogo-app/
|
|
|
85
74
|
└── package.json
|
|
86
75
|
```
|
|
87
76
|
|
|
88
|
-
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 🎯 What You Get
|
|
80
|
+
|
|
81
|
+
### 1. **Session Management**
|
|
82
|
+
|
|
83
|
+
- One-click wallet connection
|
|
84
|
+
- Session key creation with scoped permissions
|
|
85
|
+
- Automatic session state management
|
|
86
|
+
|
|
87
|
+
### 2. **Gasless Transactions**
|
|
88
|
+
|
|
89
|
+
- No gas fees for users
|
|
90
|
+
- Paymaster integration ready
|
|
91
|
+
- Session keys sign transactions in background
|
|
92
|
+
|
|
93
|
+
### 3. **Production-Ready Stack**
|
|
94
|
+
|
|
95
|
+
- Next.js 14 with App Router
|
|
96
|
+
- TypeScript for type safety
|
|
97
|
+
- TailwindCSS for styling
|
|
98
|
+
- shadcn/ui for beautiful components
|
|
99
|
+
- Solana Web3.js integration
|
|
100
|
+
|
|
101
|
+
### 4. **Working Demo**
|
|
102
|
+
|
|
103
|
+
- SPL Memo transaction example
|
|
104
|
+
- "Say GM" button demonstrates gasless UX
|
|
105
|
+
- No wallet popup needed after session established
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 🛠️ Configuration
|
|
110
|
+
|
|
111
|
+
After creating your project, update `.env` with your paymaster details:
|
|
112
|
+
|
|
113
|
+
```env
|
|
114
|
+
# Fogo RPC (Testnet by default)
|
|
115
|
+
NEXT_PUBLIC_FOGO_RPC_URL=https://testnet.fogo.io
|
|
116
|
+
|
|
117
|
+
# Paymaster Configuration
|
|
118
|
+
NEXT_PUBLIC_PAYMASTER_URL=https://paymaster.testnet.fogo.io
|
|
119
|
+
NEXT_PUBLIC_SPONSOR_PUBLIC_KEY=YourSponsorPublicKeyHere
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
> **Note**: You need to set up a paymaster sponsor account. Visit [Fogo Documentation](https://fogo.io/docs) for instructions.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## 📚 Documentation
|
|
127
|
+
|
|
128
|
+
### How Fogo Sessions Work
|
|
129
|
+
|
|
130
|
+
1. **User connects wallet** (one-time)
|
|
131
|
+
2. **App requests session** with specific limits
|
|
132
|
+
3. **User approves** session creation
|
|
133
|
+
4. **Session key signs** transactions in background
|
|
134
|
+
5. **Paymaster covers** gas fees
|
|
89
135
|
|
|
90
|
-
|
|
91
|
-
- npm, yarn, or pnpm
|
|
136
|
+
### Key Concepts
|
|
92
137
|
|
|
93
|
-
|
|
138
|
+
- **Session Keys**: Temporary keys with scoped permissions
|
|
139
|
+
- **Paymaster**: Covers transaction fees for users
|
|
140
|
+
- **Gasless UX**: No wallet popups or gas fees after session established
|
|
94
141
|
|
|
95
|
-
|
|
142
|
+
### Learn More
|
|
143
|
+
|
|
144
|
+
- [Fogo Chain Documentation](https://fogo.io/docs)
|
|
96
145
|
- [Fogo Sessions SDK](https://github.com/fogo-foundation/sessions-sdk)
|
|
97
|
-
- [
|
|
146
|
+
- [Next.js Documentation](https://nextjs.org/docs)
|
|
147
|
+
- [Solana Web3.js](https://solana-labs.github.io/solana-web3.js/)
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 🎨 Examples
|
|
152
|
+
|
|
153
|
+
### Basic Usage
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# Create a new project
|
|
157
|
+
npx create-fogo-app my-dapp
|
|
158
|
+
|
|
159
|
+
# With custom name
|
|
160
|
+
npx create-fogo-app awesome-fogo-project
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### User Flow in Your App
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
// 1. Connect wallet
|
|
167
|
+
<WalletMultiButton />;
|
|
168
|
+
|
|
169
|
+
// 2. Establish session
|
|
170
|
+
const { establishSession } = useFogoSession();
|
|
171
|
+
await establishSession();
|
|
172
|
+
|
|
173
|
+
// 3. Send gasless transaction
|
|
174
|
+
const { sendTransaction } = useFogoSession();
|
|
175
|
+
await sendTransaction(transaction); // No wallet popup!
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 🔧 Requirements
|
|
181
|
+
|
|
182
|
+
- **Node.js** 18 or higher
|
|
183
|
+
- **npm**, **yarn**, or **pnpm**
|
|
184
|
+
- A Solana wallet (Phantom, Solflare, etc.)
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## 🚢 Deployment
|
|
189
|
+
|
|
190
|
+
### Vercel (Recommended)
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
npx vercel
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Make sure to add your environment variables in Vercel project settings.
|
|
197
|
+
|
|
198
|
+
### Other Platforms
|
|
199
|
+
|
|
200
|
+
The scaffolded app is a standard Next.js application and can be deployed to:
|
|
201
|
+
|
|
202
|
+
- Netlify
|
|
203
|
+
- Railway
|
|
204
|
+
- AWS
|
|
205
|
+
- Any platform supporting Next.js
|
|
206
|
+
|
|
207
|
+
---
|
|
98
208
|
|
|
99
209
|
## 🤝 Contributing
|
|
100
210
|
|
|
101
|
-
Contributions are welcome! Please
|
|
211
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
212
|
+
|
|
213
|
+
1. Fork the repository
|
|
214
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
215
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
216
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
217
|
+
5. Open a Pull Request
|
|
218
|
+
|
|
219
|
+
---
|
|
102
220
|
|
|
103
221
|
## 📄 License
|
|
104
222
|
|
|
105
|
-
MIT
|
|
223
|
+
MIT License - see the [LICENSE](LICENSE) file for details.
|
|
106
224
|
|
|
107
225
|
---
|
|
108
226
|
|
|
109
|
-
|
|
227
|
+
## 🙏 Acknowledgments
|
|
228
|
+
|
|
229
|
+
- [Fogo Chain](https://fogo.io) for the amazing Sessions SDK
|
|
230
|
+
- [Next.js](https://nextjs.org) for the incredible framework
|
|
231
|
+
- [shadcn/ui](https://ui.shadcn.com) for beautiful components
|
|
232
|
+
- [Solana](https://solana.com) for the underlying technology
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## � Support
|
|
237
|
+
|
|
238
|
+
- **Issues**: [GitHub Issues](https://github.com/Rokan0-0/create-fogo-app/issues)
|
|
239
|
+
- **Discussions**: [GitHub Discussions](https://github.com/Rokan0-0/create-fogo-app/discussions)
|
|
240
|
+
- **Fogo Discord**: [Join the community](https://discord.gg/fogo)
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
<div align="center">
|
|
245
|
+
|
|
246
|
+
**Built with 🔥 by [Rokan0-0](https://github.com/Rokan0-0)**
|
|
247
|
+
|
|
248
|
+
[npm](https://www.npmjs.com/package/create-fogo-app) • [GitHub](https://github.com/Rokan0-0/create-fogo-app)
|
|
249
|
+
|
|
250
|
+
</div>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-fogo-app",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "The easiest way to get started on Fogo Chain. Scaffolds a Next.js dApp with Fogo Sessions pre-configured.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"create-fogo-app": "bin/cli.js"
|
|
@@ -10,6 +10,14 @@
|
|
|
10
10
|
"bin",
|
|
11
11
|
"template"
|
|
12
12
|
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/Rokan0-0/create-fogo-app.git"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/Rokan0-0/create-fogo-app/issues"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/Rokan0-0/create-fogo-app#readme",
|
|
13
21
|
"keywords": [
|
|
14
22
|
"fogo",
|
|
15
23
|
"solana",
|
|
@@ -20,7 +28,7 @@
|
|
|
20
28
|
"cli",
|
|
21
29
|
"scaffold"
|
|
22
30
|
],
|
|
23
|
-
"author": "",
|
|
31
|
+
"author": "Rokan0-0",
|
|
24
32
|
"license": "MIT",
|
|
25
33
|
"dependencies": {
|
|
26
34
|
"chalk": "^5.3.0",
|