Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions cooky/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
102 changes: 102 additions & 0 deletions cooky/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Cooky - The Pubky SDK Cookbook

A developer-friendly, interactive cookbook for building on the Pubky ecosystem. Cooky provides ready-to-use code snippets and practical examples for working with the Pubky SDK.

## What is Cooky?

Cooky is an interactive web application that serves as a comprehensive guide for developers learning to build with Pubky. It features:

- **Working Code Snippets**: Every recipe includes production-ready Rust code that compiles against Pubky 0.6 series
- **Syntax Highlighting**: Color-coded code for better readability
- **Copy & Paste Ready**: One-click copying of code snippets with instant feedback
- **Interactive Flipbook**: Smooth page-turning animations create an engaging cookbook experience
- **Organized Categories**: Recipes grouped by Identity, Storage, Authentication, Discovery, and Testing
- **Search Functionality**: Quick search across recipes, commands, and code
- **Responsive Design**: Works seamlessly on desktop and mobile devices

## Why Cooky Matters

Building decentralized applications requires understanding new protocols and patterns. Cooky bridges the gap between documentation and implementation by:

1. **Reducing Friction**: Developers can immediately copy working examples instead of piecing together documentation
2. **Teaching Best Practices**: Each recipe demonstrates proper usage patterns, security considerations, and common pitfalls
3. **Accelerating Development**: Quick access to common operations (signup, file storage, authentication) speeds up prototyping
4. **Lowering the Learning Curve**: Structured, progressive examples help newcomers understand the Pubky ecosystem

## What is Pubky?

Pubky is a decentralized identity and data storage protocol that enables users to own and control their data. It provides:

- Cryptographic identities (keypairs)
- Distributed storage (homeservers)
- Public key infrastructure for data access
- Authentication and authorization capabilities

Cooky helps developers leverage these capabilities to build the next generation of user-controlled applications.

## Getting Started

### Prerequisites

- Node.js (v18 or higher)
- npm or yarn

### Installation

```bash
npm install
```

### Development

```bash
npm run dev
```

Visit `http://localhost:5173` to explore the cookbook.

### Build

```bash
npm run build
```

## Using the Recipes

1. **Browse**: Navigate through categories using the sidebar or flip through pages
2. **Search**: Use the search bar to find specific operations or concepts
3. **Copy**: Click the copy button on any code snippet
4. **Implement**: Paste the code into your Rust project and customize as needed

## Technology Stack

- **React**: UI framework
- **TypeScript**: Type-safe development
- **Vite**: Fast build tool and dev server
- **Tailwind CSS**: Utility-first styling
- **Framer Motion**: Smooth animations
- **react-pageflip**: Interactive flipbook experience
- **Lucide React**: Beautiful icons

## Recipe Categories

- **Introduction**: Getting started with Pubky and Cooky
- **Identity**: Creating clients, signing up, generating keypairs
- **Storage**: Writing, reading, listing, and deleting files
- **Authentication**: Managing capabilities and tokens
- **Discovery**: Resolving homeservers and discovering peers
- **Testing**: Local development with pubky-testnet

## Contributing

Cooky is designed to grow with the Pubky ecosystem. Contributions for new recipes, improvements to existing examples, or documentation enhancements are welcome. Cooky was built by Aldert.

## License

MIT

## Links

- [Pubky.org](https://pubky.org)
- [Pubky App](https://pubky.app)
- [Pubkyring App](https://pubkyring.app)
1 change: 1 addition & 0 deletions cooky/dist/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* /index.html 200
1 change: 1 addition & 0 deletions cooky/dist/assets/apple-touch-icon-CURoy3cQ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions cooky/dist/assets/favicon-96x96-D730OAgd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions cooky/dist/assets/favicon-kJBMLEID.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
522 changes: 522 additions & 0 deletions cooky/dist/assets/index-B35vrJRm.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cooky/dist/assets/index-Bgo_tuuw.css

Large diffs are not rendered by default.

Binary file added cooky/dist/cooky-logo-animated.mp4
Binary file not shown.
Binary file added cooky/dist/cooky-logo-big.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cooky/dist/cooky-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions cooky/dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cooky</title>
<link rel="icon" type="image/png" href="/assets/favicon-96x96-D730OAgd.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="/assets/favicon-kJBMLEID.svg" />
<link rel="shortcut icon" href="/favicon/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon-CURoy3cQ.png" />
<link rel="manifest" href="/favicon/site.webmanifest" />
<script type="module" crossorigin src="/assets/index-B35vrJRm.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Bgo_tuuw.css">
</head>
<body>
<div id="root"></div>
</body>
</html>
28 changes: 28 additions & 0 deletions cooky/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
);
1 change: 1 addition & 0 deletions cooky/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions cooky/favicon/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions cooky/favicon/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions cooky/favicon/web-app-manifest-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions cooky/favicon/web-app-manifest-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions cooky/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cooky</title>
<link rel="icon" type="image/png" href="/favicon/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="/favicon/favicon.svg" />
<link rel="shortcut icon" href="/favicon/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png" />
<link rel="manifest" href="/favicon/site.webmanifest" />
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading