linkitylink 0.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/CLAUDE.md ADDED
@@ -0,0 +1,238 @@
1
+ # Linkitylink
2
+
3
+ A privacy-first link page service (formerly Glyphenge). Create beautiful, shareable link pages without tracking or surveillance.
4
+
5
+ ## Overview
6
+
7
+ Linkitylink creates beautiful SVG-based link pages from user-provided links. Users can share their pages via human-memorable emojicodes or browser-friendly alphanumeric URLs.
8
+
9
+ **Port**: 3010 (default)
10
+
11
+ ## Architecture
12
+
13
+ - **Server-Side SVG Rendering**: All SVG generation happens server-side
14
+ - **BDO Storage**: Links stored as public BDOs with emojicode identifiers
15
+ - **Three Adaptive Templates**:
16
+ - Compact (1-6 links)
17
+ - Grid (7-13 links)
18
+ - Dense (14-20 links)
19
+
20
+ ## Quick Start
21
+
22
+ ```bash
23
+ npm install
24
+ npm start
25
+ ```
26
+
27
+ Server runs on `http://localhost:3010`
28
+
29
+ ## API Endpoints
30
+
31
+ ### Create Link Page
32
+ ```bash
33
+ POST /create
34
+ Content-Type: application/json
35
+
36
+ {
37
+ "title": "My Links",
38
+ "links": [
39
+ {"title": "GitHub", "url": "https://github.com/user"},
40
+ {"title": "Twitter", "url": "https://twitter.com/user"}
41
+ ]
42
+ }
43
+
44
+ # Response
45
+ {
46
+ "success": true,
47
+ "emojicode": "🔗💎🌟🎨🐉📌🌍🔑",
48
+ "pubKey": "02a1b2c3...",
49
+ "uuid": "abc123..."
50
+ }
51
+ ```
52
+
53
+ ### View Link Page
54
+
55
+ By emojicode (persistent):
56
+ ```
57
+ GET /?emojicode=🔗💎🌟🎨🐉📌🌍🔑
58
+ ```
59
+
60
+ By alphanumeric URL (browser-friendly):
61
+ ```
62
+ GET /t/02a1b2c3d4e5f6a7
63
+ ```
64
+
65
+ ## Environment Variables
66
+
67
+ ```bash
68
+ PORT=3010
69
+ BDO_BASE_URL=http://localhost:3003
70
+ FOUNT_BASE_URL=http://localhost:3001
71
+ ADDIE_BASE_URL=http://localhost:3009
72
+ NODE_ENV=development
73
+ ```
74
+
75
+ ## Wiki Integration
76
+
77
+ Linkitylink is designed to be an optional add-on to federated wiki deployments. It provides link aggregation pages for wiki users without requiring the full Planet Nine ecosystem.
78
+
79
+ ## Development
80
+
81
+ ### Dependencies
82
+ - express
83
+ - express-session
84
+ - bdo-js (for BDO storage)
85
+ - sessionless-node (for key generation)
86
+ - addie-js (for payments)
87
+ - fount-js (for user data)
88
+
89
+ ### File Structure
90
+ ```
91
+ linkitylink/
92
+ ├── server.js # Main Express server
93
+ ├── package.json # Dependencies
94
+ ├── public/ # Static files
95
+ │ ├── index.html # Landing page
96
+ │ └── create.html # Create page
97
+ └── CLAUDE.md # This file
98
+ ```
99
+
100
+ ## Key Features
101
+
102
+ - Privacy-first: No tracking or surveillance
103
+ - Beautiful SVG templates with gradient colors
104
+ - Shareable via emojicodes or alphanumeric URLs
105
+ - Optional Stripe payment integration
106
+ - Session-based user accounts
107
+ - Linktree import capability
108
+ - **User-Submitted Templates**: Users can submit custom templates and earn revenue when they're used (November 2025)
109
+
110
+ ## User-Submitted Templates (November 2025)
111
+
112
+ Linkitylink supports a creator economy where users can design and submit custom SVG templates, earning a portion of each linkitylink purchase that uses their design.
113
+
114
+ ### How It Works
115
+
116
+ 1. **Template Submission** (600 MP)
117
+ - Users cast the `submitLinkitylinkTemplate` spell through The Advancement app
118
+ - Submit template with colors, linkColors, and a payee quad emojicode
119
+ - Template is stored as a public BDO with type `linkitylink-template`
120
+
121
+ 2. **Revenue Sharing**
122
+ - Template BDO contains the creator's `payeeEmojicode` (pointing to a payee quad BDO)
123
+ - When a linkitylink is purchased using that template, the template emojicode is passed as a `relevantBDO`
124
+ - Payment processing automatically fetches the template BDO and extracts the payee quad
125
+ - Creator receives their share via the existing payment splits system
126
+
127
+ 3. **Template Discovery**
128
+ - `GET /templates` endpoint queries BDO service for all templates with hash `Linkitylink-Template`
129
+ - BDO service maintains Redis SET index of template emojicodes
130
+ - Results cached for 5 minutes to reduce load
131
+ - Templates displayed in create.html carousel alongside built-in templates
132
+ - Users can select any template when creating their linkitylink
133
+
134
+ ### Multi-Instance Architecture
135
+
136
+ Templates are stored centrally in the BDO service, enabling template sharing across multiple linkitylink instances:
137
+
138
+ **Problem**: Multiple linkitylink instances (foo.linkityl.ink, bar.linkityl.ink, etc.) need access to the same template pool.
139
+
140
+ **Solution**: Templates stored as BDOs with centralized indexing:
141
+ - Template BDOs created with hash `Linkitylink-Template`
142
+ - BDO service maintains Redis SET: `templates:Linkitylink-Template`
143
+ - Linkitylink adds templates to index via POST `/templates/Linkitylink-Template/add`
144
+ - All linkitylink instances query same BDO service via GET `/templates/Linkitylink-Template`
145
+ - 5-minute cache reduces query load
146
+
147
+ This enables a federated template marketplace where templates submitted to any linkitylink instance are available to all instances sharing the same BDO service.
148
+
149
+ ### Template BDO Structure
150
+
151
+ ```json
152
+ {
153
+ "type": "linkitylink-template",
154
+ "name": "Sunset Gradient",
155
+ "colors": ["#ff6b6b", "#ee5a6f", "#feca57"],
156
+ "linkColors": ["#10b981", "#3b82f6", "#8b5cf6", "#ec4899"],
157
+ "payeeEmojicode": "🔗💎🌟🎨🐉📌🌍🔑",
158
+ "creatorPubKey": "02abc123...",
159
+ "submittedAt": "2025-11-30T...",
160
+ "status": "active"
161
+ }
162
+ ```
163
+
164
+ ### MAGIC Spell: `submitLinkitylinkTemplate`
165
+
166
+ **Cost**: 600 MP
167
+
168
+ **Payload**:
169
+ ```json
170
+ {
171
+ "paymentMethod": "mp",
172
+ "template": {
173
+ "name": "Sunset Gradient",
174
+ "colors": ["#ff6b6b", "#ee5a6f", "#feca57"],
175
+ "linkColors": ["#10b981", "#3b82f6", "#8b5cf6", "#ec4899"]
176
+ },
177
+ "payeeQuadEmojicode": "🔗💎🌟🎨🐉📌🌍🔑"
178
+ }
179
+ ```
180
+
181
+ **Response**:
182
+ ```json
183
+ {
184
+ "success": true,
185
+ "uuid": "template_uuid",
186
+ "pubKey": "02...",
187
+ "emojicode": "🎨💎🌟...",
188
+ "templateName": "Sunset Gradient",
189
+ "message": "Template submitted successfully!"
190
+ }
191
+ ```
192
+
193
+ ### Payment Flow with Templates
194
+
195
+ 1. User selects a template on create.html
196
+ 2. Template's emojicode is added to `relevantBDOs` array
197
+ 3. When payment intent is created:
198
+ - `relevantBDOsMiddleware` extracts template emojicode
199
+ - `fetchAndExtractPayees()` fetches template BDO
200
+ - Template BDO's `payeeEmojicode` is resolved to get payee quad
201
+ - Payee quad's payees are added to payment split
202
+ 4. Template creator receives their share automatically
203
+
204
+ This creates a self-sustaining design marketplace where creators earn from their contributions to the Linkitylink ecosystem.
205
+
206
+ ### iOS App Implementation
207
+
208
+ **Files**:
209
+ - `LinkitylinkTemplateSubmissionViewController.swift` - Main view controller
210
+ - `Resources/LinkitylinkTemplateSubmission.html` - UI with color pickers and live preview
211
+
212
+ **Features**:
213
+ - **Color Pickers**: Interactive color selectors for background and link colors
214
+ - **Live Preview**: Real-time SVG preview updates as colors change
215
+ - **Minimum Validation**: Requires at least 2 background colors and 2 link colors
216
+ - **Payee Quad Integration**: Users enter their payee quad emojicode to receive earnings
217
+ - **MAGIC Spell Casting**: Direct integration with Fount's spell resolver
218
+ - **Success Display**: Shows template emojicode after successful submission
219
+
220
+ **User Flow**:
221
+ 1. Open Template Submission view from CarrierBag
222
+ 2. Enter template name
223
+ 3. Add/edit background gradient colors (minimum 2)
224
+ 4. Add/edit link card colors (minimum 2)
225
+ 5. Preview updates in real-time
226
+ 6. Enter payee quad emojicode
227
+ 7. Tap "Submit Template (600 MP)"
228
+ 8. Spell is cast via Fount
229
+ 9. Template BDO created and made public
230
+ 10. Emojicode displayed (tap to copy)
231
+
232
+ **Navigation**: Accessible from CarrierBag or Enchantment Emporium
233
+
234
+ ## History
235
+
236
+ Originally named "Glyphenge" as part of The Advancement project. Extracted as standalone service in November 2025 to enable wiki integration without full ecosystem dependencies.
237
+
238
+ **November 2025**: Added user-submitted template system with revenue sharing to enable a creator economy for link page designs.
package/Dockerfile ADDED
@@ -0,0 +1,20 @@
1
+ FROM node:22.14.0
2
+
3
+ WORKDIR /usr/src/app
4
+
5
+ # Clone linkitylink repo
6
+ RUN git clone https://github.com/planet-nine-app/linkitylink.git
7
+
8
+ # Install dependencies
9
+ WORKDIR /usr/src/app/linkitylink
10
+ RUN npm install
11
+
12
+ # Expose port
13
+ EXPOSE 3010
14
+
15
+ # Set environment variables
16
+ ENV PORT=3010
17
+ ENV BDO_BASE_URL=http://localhost:3003
18
+
19
+ # Start server
20
+ CMD ["node", "server.js"]
@@ -0,0 +1,24 @@
1
+ FROM node:22.14.0
2
+
3
+ WORKDIR /usr/src/app/linkitylink
4
+
5
+ # Copy package files
6
+ COPY package.json ./
7
+
8
+ # Install dependencies
9
+ RUN npm install
10
+
11
+ # Copy application files
12
+ COPY server.js ./
13
+ COPY public/ ./public/
14
+ COPY README.md ./
15
+
16
+ # Expose port
17
+ EXPOSE 3010
18
+
19
+ # Set environment variables
20
+ ENV PORT=3010
21
+ ENV BDO_BASE_URL=http://localhost:3003
22
+
23
+ # Start server
24
+ CMD ["node", "server.js"]