Skip to content

Commit 707de29

Browse files
committed
feat: add wallet authentication and vault protection
- Integrate Reown AppKit for Solana wallet connections - Add wallet-guard component with Phantom/Solflare support - Create SNS domain resolution hook - Add server monitor script for auto-restart - Update metadata for SEO (robots, sitemap, OG images) - Add privacy/terms pages with metadata - Configure static export for GitHub Pages deployment
1 parent bb667df commit 707de29

23 files changed

Lines changed: 11172 additions & 1369 deletions

.env.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Reown AppKit Project ID
2+
# Get yours at: https://cloud.reown.com
3+
NEXT_PUBLIC_REOWN_PROJECT_ID=your_project_id_here
4+
5+
# Optional: Custom Solana RPC endpoint (defaults to mainnet)
6+
# NEXT_PUBLIC_SOLANA_RPC=https://api.mainnet-beta.solana.com
7+
8+
# Optional: Base path for GitHub Pages deployment
9+
# Leave empty for custom domains like rektsafe.com
10+
# BASE_PATH=""

AGENTS.md

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@
1717
rektsafe/
1818
├── app/ # Next.js App Router
1919
│ ├── vault/ # Crypto vault (TSS app)
20+
│ │ ├── page.tsx # Vault page component
21+
│ │ └── metadata.ts # Page-specific metadata
2022
│ ├── privacy/ # Privacy policy page
23+
│ │ ├── page.tsx
24+
│ │ └── metadata.ts
2125
│ ├── terms/ # Terms of service page
26+
│ │ ├── page.tsx
27+
│ │ └── metadata.ts
2228
│ ├── globals.css # Cypherpunk theme variables
2329
│ ├── layout.tsx # Root layout with navbar/footer
24-
│ └── page.tsx # Landing page
30+
│ ├── page.tsx # Landing page
31+
│ └── metadata.ts # Shared metadata configs
2532
├── components/ # React components
2633
│ ├── navbar.tsx # Navigation with glitch effects
2734
│ ├── footer.tsx # Minimal footer
@@ -30,9 +37,21 @@ rektsafe/
3037
│ ├── how-it-works.tsx # Process steps
3138
│ ├── tech-stack.tsx # Technology showcase
3239
│ ├── cta.tsx # Call to action
40+
│ ├── wallet-provider.tsx # Wallet connection provider
41+
│ ├── wallet-guard.tsx # Wallet auth guard for vault
3342
│ └── ui/ # shadcn/ui components
43+
├── hooks/ # Custom React hooks
44+
│ └── use-sns-name.ts # SNS domain resolution
3445
├── lib/
3546
│ └── utils.ts # Utility functions (cn, etc.)
47+
├── public/ # Static assets
48+
│ ├── favicon.svg # Main favicon
49+
│ ├── favicon-32x32.svg # Small favicon
50+
│ ├── apple-touch-icon.svg # Apple touch icon
51+
│ ├── og-image.svg # Open Graph image
52+
│ ├── site.webmanifest # PWA manifest
53+
│ ├── robots.txt # SEO robots
54+
│ └── sitemap.xml # SEO sitemap
3655
├── .github/workflows/ # GitHub Actions
3756
│ └── deploy.yml # Deploy to GitHub Pages
3857
├── dist/ # Build output (excluded from git)
@@ -52,6 +71,7 @@ rektsafe/
5271
| Animation | Framer Motion |
5372
| Icons | Lucide React |
5473
| Crypto | Web Crypto API |
74+
| Wallet | Reown AppKit + Solana |
5575

5676
## Theme Colors
5777

@@ -180,6 +200,66 @@ Static files are generated in `/dist/`:
180200
- Users responsible for key management
181201
- Uses standard, audited algorithms only
182202

203+
## Wallet Integration
204+
205+
Reown AppKit (formerly WalletConnect) is integrated for Solana wallet connections.
206+
207+
### Supported Wallets
208+
- Phantom
209+
- Solflare
210+
211+
### Environment Variables
212+
213+
```bash
214+
# Required: Get from https://cloud.reown.com
215+
NEXT_PUBLIC_REOWN_PROJECT_ID=your_project_id
216+
217+
# Optional: Custom Solana RPC endpoint
218+
NEXT_PUBLIC_SOLANA_RPC=https://api.mainnet-beta.solana.com
219+
```
220+
221+
See `.env.example` for reference.
222+
223+
### Vault Access Control
224+
225+
The `/vault/` route is protected by `WalletGuard` component:
226+
- Users must connect a Solana wallet before accessing vault features
227+
- Wallet address is displayed in the navbar when connected
228+
- Uses `<appkit-button />` web component for connect/disconnect
229+
- **SNS Support**: If wallet has a .sol domain, it displays the domain name instead of address
230+
231+
### Components
232+
233+
| Component | Purpose |
234+
|-----------|---------|
235+
| `wallet-provider.tsx` | Initializes AppKit with Solana adapter |
236+
| `wallet-guard.tsx` | Blocks vault access until wallet connected |
237+
| `<appkit-button />` | Reown's wallet connect button (web component) |
238+
239+
### Hooks
240+
241+
| Hook | Purpose |
242+
|------|---------|
243+
| `useSnsName(address)` | Resolves wallet address to SNS (.sol) domain name |
244+
245+
### Usage in Components
246+
247+
```tsx
248+
import { useAppKitAccount } from "@reown/appkit/react";
249+
import { useSnsName } from "@/hooks/use-sns-name";
250+
251+
function MyComponent() {
252+
const { isConnected, address } = useAppKitAccount();
253+
const { snsName, isLoading } = useSnsName(address);
254+
255+
if (isConnected) {
256+
return <div>Connected: {snsName || address}</div>;
257+
}
258+
259+
return <appkit-button size="sm" />;
260+
}
261+
```
262+
183263
---
184264

185265
Last updated: January 2026

0 commit comments

Comments
 (0)