Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ Thumbs.db
/QUICK_REFERENCE.md
/UI_IMPROVEMENTS.md
/UNDERSTANDING.md
*.tsbuildinfo
1 change: 1 addition & 0 deletions frontend/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.19.5
6 changes: 6 additions & 0 deletions frontend/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
dist
build
coverage
*.log
.vite
8 changes: 8 additions & 0 deletions frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"printWidth": 100,
"arrowParens": "always"
}
105 changes: 105 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# CreatorDirect Frontend

A professional React + TypeScript frontend for the CreatorDirect decentralized subscription platform.

## Features

- 🎨 Modern, responsive UI built with React 18
- 🔐 Polkadot.js wallet integration
- 📦 TypeScript for type safety
- 🎯 ESLint + Prettier for code quality
- ⚡ Vite for fast development and optimized builds
- 🧩 Component-based architecture
- 🪝 Custom React hooks for business logic
- 🎭 Toast notifications for user feedback
- 📱 Mobile-responsive design

## Tech Stack

- **React 18** - Modern React with hooks
- **TypeScript** - Type-safe development
- **Vite** - Next-generation frontend tooling
- **Polkadot.js** - Blockchain interaction
- **ESLint + Prettier** - Code quality and formatting

## Development

### Prerequisites

- Node.js 20.19.5 or higher (see `.nvmrc`)
- npm 10.8.2 or higher

### Setup

```bash
# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview
```

### Code Quality

```bash
# Run linter
npm run lint

# Fix linting issues
npm run lint:fix

# Format code
npm run format

# Check formatting
npm run format:check
```

## Project Structure

```
src/
├── components/ # Reusable UI components
├── hooks/ # Custom React hooks
├── types.ts # TypeScript type definitions
├── constants.ts # Application constants
├── utils.ts # Utility functions
├── App.tsx # Main application component
├── main.tsx # Application entry point
└── styles.css # Global styles
```

## Environment Variables

Copy `.env.example` to `.env.local` and adjust values:

```env
VITE_SHIBUYA_WS=wss://rpc.shibuya.astar.network
VITE_APP_NAME=CreatorDirect
VITE_BLOCK_TIME_MS=12000
```

## Building for Production

```bash
npm run build
```

The build output will be in the `dist/` directory, ready for deployment to any static hosting service.

## Browser Support

- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
- Polkadot.js browser extension required for wallet functionality

## License

MIT
30 changes: 30 additions & 0 deletions frontend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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 },
],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
},
},
)
30 changes: 29 additions & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,36 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CreatorDirect</title>
<meta
name="description"
content="Direct fan-to-creator subscriptions with zero platform fees. Built on Polkadot with ink! smart contracts."
/>
<meta
name="keywords"
content="creator, subscriptions, polkadot, blockchain, web3, astar, shibuya"
/>
<meta name="author" content="CreatorDirect" />
<meta name="theme-color" content="#667eea" />

<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:title" content="CreatorDirect - Zero-Fee Creator Subscriptions" />
<meta
property="og:description"
content="Direct fan-to-creator subscriptions with zero platform fees on Polkadot"
/>

<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="CreatorDirect - Zero-Fee Creator Subscriptions" />
<meta
name="twitter:description"
content="Direct fan-to-creator subscriptions with zero platform fees on Polkadot"
/>

<title>CreatorDirect - Zero-Fee Creator Subscriptions</title>
</head>
<body>
<div id="root"></div>
Expand Down
Loading