This is a frontend web application designed to interact with the FuClaude Pool Manager Cloudflare Worker backend.
It provides a user-friendly interface for both end-users to log in to Claude instances and for administrators to manage the pool of accounts.
- Backend Project: https://github.com/f14XuanLv/fuclaude-pool-manager
This project is built with React and TypeScript, structured for use with Vite as the build tool.
If you find this project helpful, please consider giving it a star on GitHub! ⭐
Important: When deploying with Vercel, you will be prompted to enter the VITE_WORKER_URL environment variable during the setup process.
Use the following template for the VITE_WORKER_URL value: https://<your-worker-name>.<your-account-id>.workers.dev
- User Interface:
- Random Login: Allows users to quickly get a login URL using a randomly selected account from the pool.
- Specific Account Login: Lists available email accounts. Users can select an account and provide a unique session identifier to log in.
- Token Expiration: Users can specify a desired token expiration time in seconds when logging in.
- Random session identifier generation if left blank.
- Admin Interface (
/adminpath):- Password protected.
- Account Listing: View all configured email accounts and previews of their session keys (SKs). List automatically refreshes after add/update/delete/batch actions.
- Add Account: Add new email-SK pairs to the pool.
- Update Account: Modify existing email addresses or update their SKs.
- Delete Account: Remove accounts from the pool.
- Batch Operations: Perform bulk additions or deletions of accounts using a JSON input.
- Configurable Worker URL:
- The application needs the URL of your deployed FuClaude Pool Manager worker. This can be configured in multiple ways (see "Configuring Worker URL" section below).
- Configuration UI accessible via a gear icon (⚙️) in the header.
- Responsive Design: Adapts to various screen sizes.
- User Feedback: Loading indicators and toast notifications for API interactions.
- Theme: Light, creamy-white theme with orange accents.
- A modern web browser.
- Node.js and npm/yarn (for development/building).
- A deployed instance of the FuClaude Pool Manager Cloudflare Worker.
-
Clone the Repository:
git clone <repository-url> # Replace <repository-url> with this project's URL cd <repository-directory>
-
Install Dependencies:
npm install # or yarn installEnsure
viteis installed as a dev dependency. -
Configure Worker URL (Development):
- The easiest way for local development is to create a
.env.localfile in the project root:Replace the URL with your actual development worker URL. Vite will automatically pick this up.VITE_WORKER_URL=http://localhost:8787
- Alternatively, you can configure it via the UI after starting the app.
- The easiest way for local development is to create a
-
Run Development Server:
npm run dev # or yarn devThis will start the Vite development server, typically at
http://localhost:5173. -
TypeScript & Vite Types Note:
- This project uses
/// <reference types="vite/client" />insrc/vite-env.d.tsfor Vite-specific type definitions likeimport.meta.env. - If you encounter TypeScript errors related to this (e.g., "Cannot find type definition file for 'vite/client'"), ensure:
viteis correctly installed as a development dependency in yourpackage.json.- Your
tsconfig.jsonin the project root is properly configured. A typicalcompilerOptions.typesarray might include"vite/client", or it might be picked up automatically iftypeRootsare standard. If you have customtypesortypeRootsintsconfig.json, ensure they don't exclude Vite's types.
- This project uses
- Ensure
VITE_WORKER_URLis set in your environment if you want to bake it into the build (e.g., in your CI/CD pipeline or deployment platform's build settings). - Run the Build Command:
This will generate optimized static assets in the
npm run build # or yarn builddistfolder.
Deploy the contents of the dist folder (after running npm run build) to any static web hosting service that can serve Single Page Applications (SPAs), such as Cloudflare Pages, Vercel, Netlify, or Azure Static Web Apps.
Configure VITE_WORKER_URL on your hosting platform for the deployed application (see Quick Deploy section or platform-specific documentation).
The application determines the WORKER_URL in the following order of precedence:
- User Configuration (via UI): If you set the URL using the gear icon (⚙️) in the UI, this value is saved in your browser's
localStorageand used subsequently. - Vite Environment Variable (Recommended for Deployment & Development):
- Set an environment variable named
VITE_WORKER_URLin your development environment (e.g., in a.env.localfile) or in your deployment platform's settings. - Example:
VITE_WORKER_URL=https://your-actual-worker.workers.dev. - Vite will embed this value into the application during the build process (for production builds) or make it available in
import.meta.env(for development).
- Set an environment variable named
- Deployment-Time Configuration (via
index.html- Alternative Fallback):- The
index.htmlfile includes a script:<script> window.__PRECONFIGURED_WORKER_URL__ = "%%PLACEHOLDER_WORKER_URL%%"; </script>
- A custom deployment process (if not using Vite's env vars) could replace
"%%PLACEHOLDER_WORKER_URL%%"with your actual worker URL string. This is less common with Vite projects.
- The
- Example URL (Final Fallback): If none of the above methods provide a URL, the application will use a non-functional example URL:
https://<your-worker-name>.<your-account-id>.workers.dev. You will then need to configure it via the UI.
- User View (Default):
- Access the application by navigating to its root URL.
- Use the "Random Login" button or select a specific email account.
- Admin View:
- Navigate to the
/adminpath of your frontend's URL. For example, if your site ishttps://example.com, the admin panel is athttps://example.com/admin. - Enter your admin password. The admin password for API calls is now included by each admin action component directly in the request payload.
- Navigate to the
index.html: The main HTML entry point.src/main.tsx: The main React/TypeScript application entry point (renders the App).src/App.tsx: The root application component (layout, routing, context providers).src/components/: Reusable UI components.src/views/: Page-level view components.src/hooks/: Custom React hooks.src/contexts/: React context for global state.src/types/: TypeScript type definitions.vite.config.ts(if you customize Vite): Vite configuration file.index.css: Global styles.
This project is licensed under the MIT License. See the LICENSE file for details.
Created by f14xuanlv





