diff --git a/Cargo.toml b/Cargo.toml index 6a9a44689..6a67522ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,11 +12,13 @@ members = [ "src/logs", "src/xrc", "src/user", + "src/dialectica", "src/alex_wallet", "src/emporium", "src/logs", "src/asset_manager", "src/feed", "src/alex_revshare", + "src/kairos", ] resolver = "2" diff --git a/MONOREPO.md b/MONOREPO.md new file mode 100644 index 000000000..738dd0c0c --- /dev/null +++ b/MONOREPO.md @@ -0,0 +1,290 @@ +# Frontend Monorepo Migration Plan + +## Overview +Convert alex_frontend from single app to monorepo workspace with shared core library and individual apps (starting with lbry). + +## Status: ✅ COMPLETED +**Last Updated**: November 27, 2024 +**Current State**: Monorepo successfully set up with core library and lbry app + +## Goals +- ✅ Core library for shared components, hooks, services +- ✅ Self-contained apps (lbry, future sonora) +- ✅ @ alias pointing to core for all imports +- ✅ Minimal file changes, maximum safety + +## Safety Measures +- ✅ Complete backup option available +- ✅ Step-by-step approach with testing at each phase +- ✅ Preserve all existing functionality + +## Migration Steps + +### Phase 1: Safety & Structure Setup + +- [x] **Step 1: Create Backup** (Optional - structure preserved) + +- [x] **Step 2: Update Root package.json** + - ✅ Added workspace configuration: `"workspaces": ["src/alex_frontend/*"]` + - ✅ Kept all existing dependencies and scripts + - ✅ Added typecheck script: `"typecheck": "tsc --noEmit"` + +- [x] **Step 3: Create Core Directory** + - ✅ Core directory created at `src/alex_frontend/core` + - ✅ All shared code moved to core + +- [x] **Step 4: Create Core package.json** + ```json + { + "name": "core", + "version": "1.0.0", + "private": true, + "main": "index.ts" + } + ``` + +- [x] **Step 5: Create lbry app** + - ✅ Lbry app created at `src/alex_frontend/lbry` + - ✅ App-specific code preserved in lbry/src + +- [x] **Step 6: Create Lbry package.json** + - ✅ Full package.json with all dependencies + - ✅ Scripts configured for dev, build, and test + +### Phase 2: Config Updates (One by One) + +- [x] **Step 7: Update Root tailwind.config.js** + - ✅ Content paths include all workspace files + - ✅ Existing theme and plugins preserved + +- [x] **Step 8: Verify Root postcss.config.js** + - ✅ Works correctly for all apps + - ✅ No changes needed + +- [x] **Step 9: Update Root components.json** + - ✅ Core components.json exists in core directory + - ✅ Aliases configured for shadcn components + +- [x] **Step 10: Update Root tsconfig.json** + - ✅ @ alias configured: `"@/*": ["./src/alex_frontend/core/*"]` + - ✅ Include paths set for all workspace TypeScript files + - ✅ All existing configuration preserved + +### Phase 3: App-Specific Updates + +- [x] **Step 11: Copy webpack to lbry** + - ✅ Webpack config exists in lbry directory + +- [x] **Step 12: Update Lbry webpack.config.js** + - ✅ Entry path configured: `path.join(__dirname, "index.tsx")` + - ✅ @ alias configured: `"@": path.resolve(__dirname, "../core")` + - ✅ HTML plugin configured with correct public path + - ✅ All loaders and plugins properly configured + - ✅ Development and production modes working + +- [x] **Step 13: Clean Up Original Structure** + - ✅ Original src moved to core + - ✅ Lbry has its own src for app-specific code + - ✅ Public assets in lbry/public + +### Phase 4: Testing + +- [x] **Step 14: Install Dependencies** + - ✅ Dependencies installed at workspace root + - ✅ Workspace packages linked correctly + +- [x] **Step 15: Test Lbry App** + - ✅ TypeScript compilation passes without errors + - ✅ Webpack configuration validated + - ✅ App entry point (index.tsx) correctly configured + +- [x] **Step 16: Verify @ Imports Work** + - ✅ @ imports working in lbry/src/App.tsx + - ✅ Core providers imported successfully + - ✅ Core components imported successfully + - ✅ All TypeScript paths resolved correctly + +## Final Structure + +``` +ugd/ +├── src/ +│ ├── legacy_alex_frontend/ # BACKUP - Complete original +│ └── alex_frontend/ +│ ├── core/ # Shared library +│ │ ├── package.json # @alexandria/core +│ │ ├── components/ # Shared components +│ │ ├── lib/ # Shadcn components +│ │ ├── hooks/ # Shared hooks +│ │ ├── services/ # Shared services +│ │ ├── store/ # Redux logic +│ │ ├── utils/ # Utilities +│ │ ├── features/ # Feature slices +│ │ ├── contexts/ # React contexts +│ │ ├── providers/ # React providers +│ │ ├── guards/ # Auth guards +│ │ ├── types/ # TypeScript types +│ │ ├── styles/ # Global styles +│ │ ├── fonts/ # Font files +│ │ ├── data/ # Static data +│ │ └── config/ # Config files +│ └── lbry/ # Main app +│ ├── package.json # @alexandria/lbry +│ ├── webpack.config.js +│ ├── public/ # All public assets +│ │ ├── index.html +│ │ ├── fonts/ +│ │ ├── icons/ +│ │ ├── images/ +│ │ ├── logos/ +│ │ └── models/ +│ └── src/ # App-specific code +│ ├── index.js +│ ├── App.tsx +│ ├── apps/ # App modules +│ ├── pages/ # Page components +│ ├── layouts/ # Layout components +│ └── routes/ # Route definitions +├── package.json # UPDATED: workspace config +├── tailwind.config.js # UPDATED: content paths +├── components.json # UPDATED: core paths +├── postcss.config.js # UNCHANGED +├── tsconfig.json # UPDATED: @ paths +└── webpack.config.js # UNCHANGED (reference) +``` + +## Import Pattern Examples + +After migration, all apps will import from core: +```tsx +// Components +import { Button } from '@/lib/components/button'; +import { Dialog } from '@/lib/components/dialog'; + +// Custom components +import { Header } from '@/components/Header'; + +// Hooks +import { useAuth } from '@/hooks/useAuth'; + +// Services +import { apiService } from '@/services/apiService'; + +// Utils +import { formatDate } from '@/utils/formatDate'; + +// Types +import { User } from '@/types/User'; +``` + +## Future Steps (After Verification) + +1. **Create sonora app** + ```bash + cp -r src/alex_frontend/lbry src/alex_frontend/sonora + # Update package.json name + # Remove non-audio features + ``` + +2. **Create bibliotheca app** + ```bash + cp -r src/alex_frontend/lbry src/alex_frontend/bibliotheca + # Update package.json name + # Remove non-book features + ``` + +3. **Optimize core library** + - Create index.ts exports + - Tree-shaking optimization + - Remove app-specific code + +## Rollback Plan + +If issues occur, restore from backup: +```bash +rm -rf src/alex_frontend +cp -r src/legacy_alex_frontend src/alex_frontend +# Restore original configs if modified +``` + +## Notes + +- **Shadcn components**: All in core/lib/components +- **@ alias**: Points to core for all apps +- **Public assets**: Each app has its own +- **Shared configs**: Root level (tailwind, postcss, components.json) +- **App configs**: Webpack per app +- **Dependencies**: All in root package.json (workspace) +- **Testing**: Test lbry first before creating other apps + +## Common Issues & Solutions + +**Issue**: Module not found when importing from @/ +**Solution**: Check tsconfig.json paths and webpack alias + +**Issue**: Tailwind styles not applied +**Solution**: Verify tailwind.config.js content paths include all apps + +**Issue**: Shadcn component not found +**Solution**: Check components.json aliases point to core paths + +**Issue**: Webpack build fails +**Solution**: Verify webpack.config.js paths are relative to lbry directory + +## Verification Checklist + +- [x] Lbry app structure correct +- [x] Workspace configuration working +- [x] @ imports work correctly +- [x] TypeScript compilation passes +- [x] All paths resolve correctly +- [x] Core library accessible from lbry +- [x] Webpack configuration validated +- [x] Package.json scripts configured +- [x] All dependencies properly installed + +## What Has Been Achieved + +1. **Successful Monorepo Structure**: + - Core library at `src/alex_frontend/core` contains all shared code + - Lbry app at `src/alex_frontend/lbry` with app-specific code + - Workspace configuration functioning correctly + +2. **Import System Working**: + - @ alias properly configured in tsconfig.json and webpack + - All imports from core working in lbry app + - TypeScript paths resolving correctly + +3. **Configuration Files**: + - Root package.json has workspace configuration + - Individual package.json files for core and lbry + - Webpack, TypeScript, and other configs properly set up + +## Next Steps for Sonora App + +To create the Sonora audio NFT marketplace app: + +1. **Copy lbry structure**: + ```bash + cp -r src/alex_frontend/lbry src/alex_frontend/sonora + ``` + +2. **Update sonora/package.json**: + - Change name to "sonora" + - Keep all dependencies + +3. **Clean up sonora/src**: + - Remove book-specific components + - Keep routing structure + - Add audio-specific features + +4. **Update routes**: + - Modify routes for audio NFT functionality + - Keep authentication and common flows + +--- + +**Created**: November 2024 +**Status**: ✅ COMPLETED +**Last Updated**: November 27, 2024 +**Next Step**: Create Sonora app following the same pattern \ No newline at end of file diff --git a/Makefile b/Makefile index 63fcdc69f..9a444c19f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all clean fresh ii xrc icrc7 icrc7-scion nft-manager alex-backend perpetua feed icp-swap tokenomics user system-api alex-wallet vetkd emporium logs asset-manager alex-revshare ensure-identities clean-identities test icp-ledger lbry alex tokens frontend help +.PHONY: all clean fresh ii xrc icrc7 icrc7-scion nft-manager alex-backend perpetua feed icp-swap tokenomics user system-api alex-wallet vetkd emporium logs asset-manager alex-revshare dialectica kairos ensure-identities clean-identities test icp-ledger lbry alex tokens frontend help # Start dfx and basic setup clean: @@ -163,6 +163,22 @@ alex-revshare: candid-extractor target/wasm32-unknown-unknown/release/alex_revshare.wasm > src/alex_revshare/alex_revshare.did dfx deploy alex_revshare --specified-id e454q-riaaa-aaaap-qqcyq-cai +# Deploy Dialectica +dialectica: + @echo "Deploying Dialectica..." + cargo build --release --target wasm32-unknown-unknown --package dialectica + candid-extractor target/wasm32-unknown-unknown/release/dialectica.wasm > src/dialectica/dialectica.did + dfx deploy dialectica + dfx generate dialectica + +# Deploy Kairos +kairos: + @echo "Deploying Kairos..." + cargo build --release --target wasm32-unknown-unknown --package kairos + candid-extractor target/wasm32-unknown-unknown/release/kairos.wasm > src/kairos/kairos.did + dfx deploy kairos + dfx generate kairos + # Ensure all required identities exist (without switching current identity) ensure-identities: @echo "Ensuring identities exist..." @@ -277,6 +293,8 @@ help: @echo " logs - Deploy Logs" @echo " asset-manager - Deploy Asset Manager" @echo " alex-revshare - Deploy Alex Revshare" + @echo " dialectica - Deploy Dialectica canister" + @echo " kairos - Deploy Kairos canister" @echo " ensure-identities - Ensure all required identities, Create if don't exist" @echo " clean-identities - Remove all project identities" @echo " icp-ledger - Deploy ICP Ledger (LICP)" diff --git a/components.json b/components.json index 83ecefb26..d6a821da1 100644 --- a/components.json +++ b/components.json @@ -1,18 +1,18 @@ { - "$schema": "https://ui.shadcn.com/schema.json", - "style": "default", - "tailwind": { - "config": "tailwind.config.js", - "css": "src/alex_frontend/src/styles/tailwind.css", - "baseColor": "slate", - "cssVariables": true - }, - "rsc": false, - "tsx": true, - "aliases": { - "components": "@/lib/components", - "utils": "@/lib/utils", - "hooks": "@/lib/hooks", - "ui": "@/lib/components" - } + "$schema": "https://ui.shadcn.com/schema.json", + "style": "default", + "tailwind": { + "config": "tailwind.config.js", + "css": "src/alex_frontend/core/tailwind.css", + "baseColor": "slate", + "cssVariables": true + }, + "rsc": false, + "tsx": true, + "aliases": { + "components": "@/lib/components", + "utils": "@/lib/utils", + "hooks": "@/lib/hooks", + "ui": "@/lib/components" + } } \ No newline at end of file diff --git a/dfx.json b/dfx.json index db11b4cd4..e6379b498 100644 --- a/dfx.json +++ b/dfx.json @@ -32,6 +32,11 @@ "package": "user", "candid": "src/user/user.did" }, + "dialectica": { + "type": "rust", + "package": "dialectica", + "candid": "src/dialectica/dialectica.did" + }, "alex_backend": { "candid": "src/alex_backend/alex_backend.did", "package": "alex_backend", @@ -140,6 +145,11 @@ "package": "alex_revshare", "type": "rust", "specified_id": "e454q-riaaa-aaaap-qqcyq-cai" + }, + "kairos": { + "type": "rust", + "package": "kairos", + "candid": "src/kairos/kairos.did" } }, "defaults": { diff --git a/package.json b/package.json index 32dff423c..89778f392 100644 --- a/package.json +++ b/package.json @@ -1,454 +1,217 @@ { - - "name": "alex_frontend", - - "version": "0.1.0", - - "description": "Internet Computer starter application", - - "keywords": [ - - "Internet Computer", - - "Motoko", - - "JavaScript", - - "Canister" - - ], - - "scripts": { - - "dev": "webpack serve --mode development --open", - - "build": "NODE_ENV=production webpack --mode production", - - "prebuild": "dfx generate", - - "start": "webpack serve --mode development --env development", - - "deploy:local": "dfx deploy --network=local", - - "deploy:ic": "dfx deploy --network=ic", - - "generate": "dfx generate alex_backend", - - "typecheck": "tsc --noEmit", - - "test": "jest", - - "test:watch": "jest --watch", - - "test:coverage": "jest --coverage" - - }, - - "dependencies": { - - "@apollo/client": "^3.11.8", - - "@dfinity/agent": "^3.2.7", - - "@dfinity/assets": "^3.2.7", - - "@dfinity/auth-client": "^3.2.7", - - "@dfinity/candid": "^3.2.7", - - "@dfinity/identity": "^3.2.7", - - "@dfinity/ledger-icp": "^6.0.1", - - "@dfinity/principal": "^3.2.7", - - "@dfinity/utils": "^3.1.0", - - "@fortawesome/fontawesome-svg-core": "^6.6.0", - - "@fortawesome/free-regular-svg-icons": "^6.6.0", - - "@fortawesome/free-solid-svg-icons": "^6.6.0", - - "@fortawesome/react-fontawesome": "^0.2.2", - - "@irys/sdk": "^0.2.11", - - "@meilisearch/instant-meilisearch": "^0.20.0", - - "@radix-ui/react-accordion": "^1.2.2", - - "@radix-ui/react-alert-dialog": "^1.1.2", - - "@radix-ui/react-aspect-ratio": "^1.1.1", - - "@radix-ui/react-avatar": "^1.1.9", - - "@radix-ui/react-checkbox": "^1.1.2", - - "@radix-ui/react-collapsible": "^1.1.2", - - "@radix-ui/react-dialog": "^1.1.13", - - "@radix-ui/react-dropdown-menu": "^2.1.2", - - "@radix-ui/react-label": "^2.1.0", - - "@radix-ui/react-popover": "^1.1.2", - - "@radix-ui/react-progress": "^1.1.1", - - "@radix-ui/react-scroll-area": "^1.2.8", - - "@radix-ui/react-select": "^2.1.4", - - "@radix-ui/react-separator": "^1.1.1", - - "@radix-ui/react-slider": "^1.2.1", - - "@radix-ui/react-slot": "^1.1.0", - - "@radix-ui/react-switch": "^1.1.1", - - "@radix-ui/react-tabs": "^1.1.1", - - "@radix-ui/react-toast": "^1.2.2", - - "@radix-ui/react-toggle": "^1.1.0", - - "@radix-ui/react-toggle-group": "^1.1.0", - - "@radix-ui/react-tooltip": "^1.1.6", - - "@reduxjs/toolkit": "^2.5.0", - - "@slide-computer/signer": "^4.0.0", - - "@slide-computer/signer-extension": "^3.20.0", - - "@slide-computer/signer-web": "^4.0.0", - - "@solana/wallet-adapter-base": "^0.9.23", - - "@solana/wallet-adapter-react": "^0.15.35", - - "@solana/wallet-adapter-react-ui": "^0.9.35", - - "@tanstack/react-query": "^5.62.8", - - "@tanstack/react-query-devtools": "^5.83.0", - - "@tanstack/react-router": "^1.129.8", - - "@tanstack/react-router-devtools": "^1.120.16", - - "@tanstack/react-virtual": "^3.12.0", - - "@tensorflow/tfjs": "^4.21.0", - - "@types/dompurify": "^3.0.5", - - "@types/react-beautiful-dnd": "^13.1.8", - - "@xstate/store": "^3.9.2", - - "antd": "^5.20.5", - - "arweave": "^1.15.5", - - "autoprefixer": "^10.4.20", - - "axios": "^1.7.7", - - "babel-loader": "^9.2.1", - - "browserify-zlib": "^0.2.0", - - "class-variance-authority": "^0.7.0", - - "clsx": "^2.1.1", - - "cmdk": "^1.0.0", - - "date-fns": "^3.6.0", - - "dompurify": "^3.2.3", - - "echarts": "^5.6.0", - - "epubjs": "^0.3.93", - - "ethers": "^6.13.2", - - "flatted": "^3.3.1", - - "formik": "^2.4.6", - - "graphql": "^16.11.0", - - "html-to-text": "^9.0.5", - - "human-crypto-keys": "^0.1.4", - - "ic-mops": "^1.0.1", - - "ic-use-actor": "^0.3.1", - - "ic-vetkd-utils": "file:ic-vetkd-utils-0.1.0.tgz", - - "instantsearch.css": "^8.5.0", - - "instantsearch.js": "^4.74.0", - - "jwk-to-pem": "^2.0.7", - - "lodash": "^4.17.21", - - "lru-cache": "^11.0.2", - - "lucide-react": "^0.539.0", - - "meilisearch": "^0.42.0", - - "nanoid": "^5.0.7", - - "next-themes": "^0.3.0", - - "npm": "^10.8.3", - - "nprogress": "^0.2.0", - - "nsfwjs": "^4.2.0", - - "papaparse": "^5.4.1", - - "path": "^0.12.7", - - "path-browserify": "^1.0.1", - - "postcss": "^8.4.45", - - "react": "^18.3.1", - - "react-beautiful-dnd": "^13.1.1", - - "react-circle-flags": "^0.0.20", - - "react-csv": "^2.2.2", - - "react-day-picker": "^8.10.1", - - "react-dom": "^18.3.1", - - "react-error-boundary": "^5.0.0", - - "react-instantsearch-dom": "^6.40.4", - - "react-intersection-observer": "^9.16.0", - - "react-lazy-load-image-component": "^1.6.3", - - "react-markdown": "^9.1.0", - - "react-paginate": "^8.2.0", - - "react-pdf": "^10.0.1", - - "react-plock": "^3.5.1", - - "react-qr-code": "^2.0.15", - - "react-rating-star-with-type": "^1.2.2", - - "react-redux": "^9.1.2", - - "react-responsive-masonry": "^2.3.0", - - "react-syntax-highlighter": "^15.6.1", - - "react-viewer": "^3.2.2", - - "react-zoom-pan-pinch": "^3.7.0", - - "remark-gfm": "^4.0.1", - - "root": "github:tanstack/react-virtual", - - "sonner": "^1.5.0", - - "styled-components": "^6.1.13", - - "swiper": "^11.1.12", - - "swr": "^2.3.4", - - "tailwind-merge": "^2.5.3", - - "tailwind-scrollbar": "^3.1.0", - - "tailwindcss": "^3.4.10", - - "tailwindcss-animate": "^1.0.7", - - "ts-prune": "^0.10.3", - - "ts-unused-exports": "^11.0.1", - - "unist-util-visit": "^5.0.0", - - "viem": "^2.21.56", - - "wagmi": "^2.14.3", - - "yup": "^1.4.0" - - }, - - "devDependencies": { - - "@babel/core": "^7.25.2", - - "@babel/plugin-proposal-class-properties": "^7.18.6", - - "@babel/plugin-transform-runtime": "^7.27.1", - - "@babel/preset-env": "^7.25.4", - - "@babel/preset-react": "^7.24.7", - - "@babel/preset-typescript": "^7.26.0", - - "@pmmmwh/react-refresh-webpack-plugin": "^0.6.1", - - "@svgr/webpack": "^8.1.0", - - "@tanstack/router-plugin": "^1.120.16", - - "@testing-library/jest-dom": "^6.6.3", - - "@testing-library/react": "^16.2.0", - - "@testing-library/user-event": "^14.6.1", - - "@types/antd": "^1.0.0", - - "@types/html-to-text": "^9.0.4", - - "@types/human-crypto-keys": "^0.1.3", - - "@types/jest": "^29.5.14", - - "@types/jwk-to-pem": "^2.0.3", - - "@types/lodash": "^4.17.14", - - "@types/nprogress": "^0.2.3", - - "@types/pako": "^2.0.3", - - "@types/react": "^19.1.8", - - "@types/react-csv": "^1.1.10", - - "@types/react-dom": "^19.1.6", - - "@types/react-instantsearch-dom": "^6.12.8", - - "@types/react-lazy-load-image-component": "^1.6.4", - - "@types/react-responsive-masonry": "^2.1.3", - - "@types/react-syntax-highlighter": "^15.5.13", - - "@types/sjcl": "^1.0.34", - - "@types/text-encoding": "^0.0.39", - - "assert": "^2.1.0", - - "babel-jest": "^29.7.0", - - "buffer": "^6.0.3", - - "copy-webpack-plugin": "^12.0.2", - - "crypto-browserify": "^3.12.0", - - "css-loader": "^7.1.2", - - "dotenv": "^16.4.5", - - "events": "3.3.0", - - "file-loader": "^6.2.0", - - "html-webpack-plugin": "5.6.0", - - "https-browserify": "^1.0.0", - - "identity-obj-proxy": "^3.0.0", - - "imports-loader": "^5.0.0", - - "jest": "^29.7.0", - - "jest-environment-jsdom": "^29.7.0", - - "null-loader": "^4.0.1", - - "os-browserify": "^0.3.0", - - "postcss-loader": "^8.1.1", - - "postcss-nested": "^6.2.0", - - "process": "^0.11.10", - - "react-refresh": "^0.17.0", - - "stream-browserify": "^3.0.0", - - "stream-http": "^3.2.0", - - "style-loader": "^4.0.0", - - "terser-webpack-plugin": "^5.3.10", - - "ts-loader": "^9.5.1", - - "url": "^0.11.4", - - "util": "0.12.5", - - "vm-browserify": "^1.1.2", - - "webpack": "^5.94.0", - - "webpack-bundle-analyzer": "^4.10.2", - - "webpack-cli": "^5.1.4", - - "webpack-dev-server": "^5.1.0" - - }, - - "engines": { - - "node": "^12 || ^14 || ^16 || ^18 || ^20 || ^22" - - }, - - "browserslist": [ - - "last 2 chrome version", - - "last 2 firefox version", - - "last 2 safari version", - - "last 2 edge version" - - ] - + "name": "alex", + "workspaces": [ + "src/alex_frontend/*" + ], + "version": "0.1.0", + "description": "Alexandria workspace", + "keywords": [ + "Internet Computer", + "Motoko", + "JavaScript", + "Canister", + "Workspace" + ], + "scripts": { + "prebuild": "dfx generate", + "dev": "npm run dev --workspaces --if-present", + "test": "npm run test --workspaces --if-present", + "start": "npm run start --workspaces --if-present", + "build": "npm run build --workspaces --if-present", + "typecheck": "npm run typecheck --workspaces --if-present" + }, + "dependencies": { + "@apollo/client": "^3.11.8", + "@dfinity/agent": "^3.2.7", + "@dfinity/assets": "^3.2.7", + "@dfinity/auth-client": "^3.2.7", + "@dfinity/candid": "^3.2.7", + "@dfinity/identity": "^3.2.7", + "@dfinity/ledger-icp": "^6.0.1", + "@dfinity/principal": "^3.2.7", + "@dfinity/utils": "^3.1.0", + "@fortawesome/fontawesome-svg-core": "^6.6.0", + "@fortawesome/free-regular-svg-icons": "^6.6.0", + "@fortawesome/free-solid-svg-icons": "^6.6.0", + "@fortawesome/react-fontawesome": "^0.2.2", + "@irys/sdk": "^0.2.11", + "@meilisearch/instant-meilisearch": "^0.20.0", + "@radix-ui/react-accordion": "^1.2.2", + "@radix-ui/react-alert-dialog": "^1.1.2", + "@radix-ui/react-aspect-ratio": "^1.1.1", + "@radix-ui/react-avatar": "^1.1.9", + "@radix-ui/react-checkbox": "^1.1.2", + "@radix-ui/react-collapsible": "^1.1.2", + "@radix-ui/react-dialog": "^1.1.13", + "@radix-ui/react-dropdown-menu": "^2.1.2", + "@radix-ui/react-label": "^2.1.0", + "@radix-ui/react-popover": "^1.1.2", + "@radix-ui/react-progress": "^1.1.1", + "@radix-ui/react-scroll-area": "^1.2.8", + "@radix-ui/react-select": "^2.1.4", + "@radix-ui/react-separator": "^1.1.1", + "@radix-ui/react-slider": "^1.2.1", + "@radix-ui/react-slot": "^1.1.0", + "@radix-ui/react-switch": "^1.1.1", + "@radix-ui/react-tabs": "^1.1.1", + "@radix-ui/react-toast": "^1.2.2", + "@radix-ui/react-toggle": "^1.1.0", + "@radix-ui/react-toggle-group": "^1.1.0", + "@radix-ui/react-tooltip": "^1.1.6", + "@reduxjs/toolkit": "^2.5.0", + "@slide-computer/signer": "^4.0.0", + "@slide-computer/signer-extension": "^3.20.0", + "@slide-computer/signer-web": "^4.0.0", + "@solana/wallet-adapter-base": "^0.9.23", + "@solana/wallet-adapter-react": "^0.15.35", + "@solana/wallet-adapter-react-ui": "^0.9.35", + "@tanstack/react-query": "^5.62.8", + "@tanstack/react-query-devtools": "^5.83.0", + "@tanstack/react-router": "^1.129.8", + "@tanstack/react-router-devtools": "^1.120.16", + "@tanstack/react-virtual": "^3.12.0", + "@tensorflow/tfjs": "^4.21.0", + "@types/dompurify": "^3.0.5", + "@types/react-beautiful-dnd": "^13.1.8", + "@xstate/store": "^3.9.2", + "antd": "^5.20.5", + "arweave": "^1.15.5", + "autoprefixer": "^10.4.20", + "axios": "^1.7.7", + "babel-loader": "^9.2.1", + "browserify-zlib": "^0.2.0", + "class-variance-authority": "^0.7.0", + "clsx": "^2.1.1", + "cmdk": "^1.0.0", + "date-fns": "^3.6.0", + "dompurify": "^3.2.3", + "echarts": "^5.6.0", + "epubjs": "^0.3.93", + "ethers": "^6.13.2", + "flatted": "^3.3.1", + "formik": "^2.4.6", + "graphql": "^16.11.0", + "html-to-text": "^9.0.5", + "human-crypto-keys": "^0.1.4", + "ic-mops": "^1.0.1", + "ic-use-actor": "^0.3.1", + "ic-vetkd-utils": "file:ic-vetkd-utils-0.1.0.tgz", + "instantsearch.css": "^8.5.0", + "instantsearch.js": "^4.74.0", + "jwk-to-pem": "^2.0.7", + "lodash": "^4.17.21", + "lru-cache": "^11.0.2", + "lucide-react": "^0.539.0", + "meilisearch": "^0.42.0", + "nanoid": "^5.0.7", + "next-themes": "^0.3.0", + "npm": "^10.8.3", + "nprogress": "^0.2.0", + "nsfwjs": "^4.2.0", + "papaparse": "^5.4.1", + "path": "^0.12.7", + "path-browserify": "^1.0.1", + "postcss": "^8.4.45", + "react": "^18.3.1", + "react-beautiful-dnd": "^13.1.1", + "react-circle-flags": "^0.0.20", + "react-csv": "^2.2.2", + "react-day-picker": "^8.10.1", + "react-dom": "^18.3.1", + "react-error-boundary": "^5.0.0", + "react-instantsearch-dom": "^6.40.4", + "react-intersection-observer": "^9.16.0", + "react-lazy-load-image-component": "^1.6.3", + "react-markdown": "^9.1.0", + "react-paginate": "^8.2.0", + "react-pdf": "^10.0.1", + "react-plock": "^3.5.1", + "react-qr-code": "^2.0.15", + "react-rating-star-with-type": "^1.2.2", + "react-redux": "^9.1.2", + "react-responsive-masonry": "^2.3.0", + "react-syntax-highlighter": "^15.6.1", + "react-viewer": "^3.2.2", + "react-zoom-pan-pinch": "^3.7.0", + "remark-gfm": "^4.0.1", + "root": "github:tanstack/react-virtual", + "sonner": "^1.5.0", + "styled-components": "^6.1.13", + "swiper": "^11.1.12", + "swr": "^2.3.4", + "tailwind-merge": "^2.5.3", + "tailwind-scrollbar": "^3.1.0", + "tailwindcss": "^3.4.10", + "tailwindcss-animate": "^1.0.7", + "ts-prune": "^0.10.3", + "ts-unused-exports": "^11.0.1", + "unist-util-visit": "^5.0.0", + "viem": "^2.21.56", + "wagmi": "^2.14.3", + "yup": "^1.4.0" + }, + "devDependencies": { + "@babel/core": "^7.25.2", + "@babel/plugin-proposal-class-properties": "^7.18.6", + "@babel/plugin-transform-runtime": "^7.27.1", + "@babel/preset-env": "^7.25.4", + "@babel/preset-react": "^7.24.7", + "@babel/preset-typescript": "^7.26.0", + "@pmmmwh/react-refresh-webpack-plugin": "^0.6.1", + "@svgr/webpack": "^8.1.0", + "@tanstack/router-plugin": "^1.120.16", + "@testing-library/jest-dom": "^6.6.3", + "@testing-library/react": "^16.2.0", + "@testing-library/user-event": "^14.6.1", + "@types/antd": "^1.0.0", + "@types/html-to-text": "^9.0.4", + "@types/human-crypto-keys": "^0.1.3", + "@types/jest": "^29.5.14", + "@types/jwk-to-pem": "^2.0.3", + "@types/lodash": "^4.17.14", + "@types/nprogress": "^0.2.3", + "@types/pako": "^2.0.3", + "@types/react": "^19.1.8", + "@types/react-csv": "^1.1.10", + "@types/react-dom": "^19.1.6", + "@types/react-instantsearch-dom": "^6.12.8", + "@types/react-lazy-load-image-component": "^1.6.4", + "@types/react-responsive-masonry": "^2.1.3", + "@types/react-syntax-highlighter": "^15.5.13", + "@types/sjcl": "^1.0.34", + "@types/text-encoding": "^0.0.39", + "assert": "^2.1.0", + "babel-jest": "^29.7.0", + "buffer": "^6.0.3", + "copy-webpack-plugin": "^12.0.2", + "crypto-browserify": "^3.12.0", + "css-loader": "^7.1.2", + "dotenv": "^16.4.5", + "events": "3.3.0", + "file-loader": "^6.2.0", + "html-webpack-plugin": "5.6.0", + "https-browserify": "^1.0.0", + "identity-obj-proxy": "^3.0.0", + "imports-loader": "^5.0.0", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", + "null-loader": "^4.0.1", + "os-browserify": "^0.3.0", + "postcss-loader": "^8.1.1", + "postcss-nested": "^6.2.0", + "process": "^0.11.10", + "react-refresh": "^0.17.0", + "stream-browserify": "^3.0.0", + "stream-http": "^3.2.0", + "style-loader": "^4.0.0", + "terser-webpack-plugin": "^5.3.10", + "ts-loader": "^9.5.1", + "url": "^0.11.4", + "util": "0.12.5", + "vm-browserify": "^1.1.2", + "webpack": "^5.94.0", + "webpack-bundle-analyzer": "^4.10.2", + "webpack-cli": "^5.1.4", + "webpack-dev-server": "^5.1.0" + } } - diff --git a/src/alex_frontend/bibliotheca/index.tsx b/src/alex_frontend/bibliotheca/index.tsx new file mode 100644 index 000000000..af8e743b4 --- /dev/null +++ b/src/alex_frontend/bibliotheca/index.tsx @@ -0,0 +1,98 @@ +import React from "react"; +import { createRoot } from "react-dom/client"; +// import WebFont from "webfontloader"; +import App from "./src/App"; + +// Create a loading indicator +// const loadingIndicator = document.createElement('div'); +// loadingIndicator.id = 'app-loading-indicator'; +// loadingIndicator.innerHTML = ` +// +//
+//+ Book files from the permanent web, ready to discover + and mint. +
++ Transform any audio into a tradeable NFT on + Alexandria. +
++ Quick steps: +
++ {loading && books.length === 0 ? ( + "Loading files..." + ) : ( + <> + + {books.length} + {" "} + files available + > + )} +
++ No book files found +
++ Try refreshing the page +
++ Part of the Alexandria ecosystem - discover books + and ePub content from Arweave, create your own + digital library, and mint them as NFTs on LBRY. +
++ Transform literary content from the permanent web + into tradeable digital assets. +
++ Browse books and ePub content stored + permanently on the Arweave network and mint + them as NFTs +
++ Upload your ePub files, PDFs, or create new + literary content to mint as book NFTs +
++ Buy and sell book NFTs in the Alexandria + marketplace using LBRY tokens +
++ Powered by Alexandria's infrastructure - connecting + Arweave's permanent storage with LBRY's marketplace + for digital literature. +
++ Browse literary content from Arweave's permanent + web. Find books, ePubs, and documents that have + been stored forever on the decentralized + network. +
++ Upload your own ePub files, PDFs, or documents + to create original book NFTs. You can also mint + discovered Arweave books as NFTs for your + collection. +
++ List your book NFTs on the Alexandria + marketplace and trade with LBRY tokens. Connect + with readers and collectors in the ecosystem. +
++ Built on Alexandria's proven infrastructure, + connecting the permanent web with decentralized + literary commerce. +
++ Access literary content stored permanently on + Arweave. Discover and mint book transactions + that will never disappear from the web. +
++ Upload ePub files, PDFs, and documents. Create + your digital library and turn literary works + into valuable NFTs. +
++ Trade book NFTs using LBRY tokens in the + Alexandria ecosystem. Connect with a community + of readers and authors. +
++ True ownership through blockchain technology. + Your literary NFTs are yours forever, stored on + immutable networks. +
++ Choose your path and start your digital library + journey today +
++ Discover books and literature from Arweave + network +
++ Upload ePub files and documents to mint as + NFTs +
++ Manage your personal book NFT collection +
++ Manage your listings and trading activity +
++ Buy and sell book NFTs with LBRY tokens +
++ Read your books with our integrated ePub + reader +
++ Be part of Alexandria's vision for decentralized + literature. Discover books from the permanent web, + create your digital library, and trade in a truly + decentralized marketplace. +
++ Your personal book NFT collection and uploaded + content. +
++ Download, share, or list your book NFTs for sale. +
++ Available actions: +
++ + {books.length} + {" "} + of{" "} + + {pagination.totalCount} + {" "} + items +
+ + → View your listed books + ++ Loading your book NFTs... +
++ This may take a few moments +
++ Error loading NFTs +
++ {error} +
+ ++ You haven't minted any book NFTs yet. +
++ Discover and purchase book NFTs from creators + worldwide. +
++ Purchase book NFTs with ALEX or LBRY tokens and own + them forever. +
++ How it works: +
++ + {books.length} + {" "} + of{" "} + + {pagination.totalCount} + {" "} + items shown +
+ + → Manage your listings + ++ Loading marketplace book NFTs... +
++ Error loading marketplace +
++ {error} +
+ ++ There are currently no book NFTs listed in the + marketplace. +
++ Manage your listed book NFTs and marketplace + presence. +
++ Edit metadata, pricing, and availability of your + book NFTs. +
++ Available actions: +
++ + {books.length} + {" "} + of{" "} + + {pagination.totalCount} + {" "} + listings shown +
++ Loading your listed book NFTs... +
++ Error loading listed book NFTs +
++ {error} +
+ ++ You don't have any book NFTs listed for sale + yet. +
++ Share your book content with the world +
++ {selectedFile + ? selectedFile.name + : "Drop your book file here"} +
++ or click to browse • EPUB files only +
+{error}
+{success}
++ + {assetManager.userAssetCanister} + +
+ ++ For larger content, consider uploading your + markdown as an NFT. +
++ Add an existing shelf as an item in your + current shelf +
++ You don't have any other shelves that can be + added. Create a new shelf instead. +
+ )} ++ {comment.content} +
+Sign in to leave a comment
+