A modern, decentralized content platform frontend built with SvelteKit and deployed on Cloudflare Pages. This application provides a user-friendly interface for the Open Content Protocol, enabling creators and users to interact with blockchain-based content in a censorship-resistant environment.
- Decentralized Content Platform: Built on Sui blockchain for censorship resistance
- Creator Economy: Support for content creators with subscription and membership models
- Wallet Integration: Seamless connection with Sui wallets
- Responsive Design: Modern UI that works across all devices
- Dark Mode Support: Automatic dark/light theme switching
- Real-time Updates: Dynamic content loading and state management
- Access Control: Tiered content access (Public, Subscriber, Member)
- Framework: SvelteKit - Modern web framework
- Styling: Tailwind CSS - Utility-first CSS framework
- Blockchain: Sui - High-performance blockchain platform
- SDK: @mysten/sui - Sui TypeScript SDK
- Icons: Lucide Svelte - Beautiful icon library
- Deployment: Cloudflare Pages - Edge deployment platform
- Package Manager: pnpm - Fast, disk space efficient package manager
Before you begin, ensure you have the following installed:
- Node.js (version 18 or higher)
- pnpm (version 8 or higher)
- A Sui wallet extension (e.g., Sui Wallet, Suiet)
-
Clone the repository
git clone https://github.com/memenow/ocp-webui.git cd ocp-webui -
Install dependencies
pnpm install
-
Set up environment variables
pnpm run setup:env
Edit
.env.localwith your configuration values. -
Start the development server
pnpm dev
-
Open your browser Navigate to
http://localhost:5173to see the application.
src/
βββ lib/
β βββ components/ # Reusable Svelte components
β β βββ Header.svelte # Navigation header
β β βββ WalletConnect.svelte # Wallet connection component
β βββ stores/ # Svelte stores for state management
β β βββ wallet.ts # Wallet connection state
β βββ types/ # TypeScript type definitions
β β βββ ocp.ts # Open Content Protocol types
β βββ config.ts # Application configuration
βββ routes/ # SvelteKit routes (pages)
β βββ +layout.svelte # Root layout component
β βββ +page.svelte # Home page
β βββ creators/ # Creator discovery page
β βββ posts/ # Content browsing page
β βββ dashboard/ # User dashboard
βββ app.html # HTML template
βββ app.css # Global styles
βββ app.d.ts # TypeScript declarations
The application uses environment variables for configuration. Copy .env.example to .env.local for local development:
pnpm run setup:env# Sui Network Configuration
PUBLIC_SUI_NETWORK=testnet
PUBLIC_SUI_RPC_URL=https://fullnode.testnet.sui.io:443
# Application Configuration
PUBLIC_APP_NAME="Open Content Protocol"
PUBLIC_APP_URL=https://ocp.memenow.xyz
PUBLIC_APP_DESCRIPTION="A decentralized content platform built on Sui blockchain"
# Smart Contract Configuration
PUBLIC_OCP_PACKAGE_ID=0x...
PUBLIC_OCP_CREATOR_MODULE=ocp_creator
PUBLIC_OCP_POST_MODULE=ocp_post
PUBLIC_OCP_MEMBER_MODULE=ocp_member
PUBLIC_OCP_SUBSCRIBER_MODULE=ocp_subscriber
PUBLIC_OCP_PAID_MODULE=ocp_paid
# Feature Flags
PUBLIC_ENABLE_DARK_MODE=true
PUBLIC_ENABLE_ANALYTICS=false
PUBLIC_ENABLE_NOTIFICATIONS=truepnpm dev- Start development serverpnpm build- Build for productionpnpm preview- Preview production build locallypnpm check- Run TypeScript checkspnpm lint- Run ESLintpnpm format- Format code with Prettierpnpm test- Run unit testspnpm setup:env- Copy environment variables template
The project uses GitHub Actions for automated deployment to Cloudflare Pages:
-
Fork or clone the repository to your GitHub account
-
Set up repository secrets in GitHub:
- Go to your repository settings
- Navigate to Secrets and variables > Actions
- Add the following secrets:
CLOUDFLARE_API_TOKEN: Your Cloudflare API tokenCLOUDFLARE_ACCOUNT_ID: Your Cloudflare account ID
-
Configure repository variables (optional):
- In the same section, go to Variables tab
- Add any environment variables you want to override:
PUBLIC_SUI_NETWORKPUBLIC_APP_URLPUBLIC_OCP_PACKAGE_ID- etc.
-
Deploy automatically:
- Push to the
mainbranch to trigger deployment - Pull requests will create preview deployments
- Push to the
-
API Token:
- Go to Cloudflare Dashboard
- Create a custom token with:
- Permissions:
Cloudflare Pages:Edit - Account resources:
Include - Your Account
- Permissions:
-
Account ID:
- Go to your Cloudflare Dashboard
- Copy the Account ID from the right sidebar
This frontend integrates with the Open Content Protocol smart contracts on the Sui blockchain:
- Creator Management: Create and update creator profiles
- Content Publishing: Mint and manage posts with access controls
- Subscription System: Handle memberships and subscriber relationships
- Payment Processing: Manage SUI token transactions
- Access Control: Verify user permissions for content access
The application uses the Sui TypeScript SDK to:
- Connect to Sui wallets
- Query blockchain state
- Submit transactions
- Handle smart contract calls
- Connect Wallet: Use the "Connect Wallet" button in the header
- Create Profile: Set up your creator profile with description and pricing
- Publish Content: Create posts with different access levels
- Manage Subscribers: Track and manage your audience
- Monitor Earnings: View analytics and payment history
- Browse Creators: Discover creators on the platform
- View Content: Access free content or subscribe for premium
- Manage Subscriptions: Track your subscriptions and memberships
- Support Creators: Subscribe or purchase memberships
- Wallet Security: All transactions require user approval
- Access Control: Smart contract-enforced content permissions
- Data Privacy: Minimal data collection, blockchain-based identity
- Censorship Resistance: Decentralized content storage
We welcome contributions to improve the Open Content Protocol Web UI! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow the existing code style and conventions
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
- Ensure all checks pass before submitting
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
- Live Demo: https://ocp-webui.pages.dev
- Backend Repository: Open Content Protocol
- Sui Documentation: https://docs.sui.io
- SvelteKit Documentation: https://kit.svelte.dev
- Cloudflare Pages: https://pages.cloudflare.com
If you encounter any issues or have questions:
- Check the documentation above
- Search existing issues on GitHub
- Create a new issue with detailed information
- Join our community discussions
- Sui Foundation for the blockchain infrastructure
- Svelte Team for the amazing framework
- Cloudflare for the deployment platform
- Open Source Community for the tools and libraries
Built with β€οΈ for the decentralized web