Skip to content
Back to search

hydra-mcp-solana

hydra-ai

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/hydra-mcp--hydra-mcp-solana/badge.svg)](/listings/hydra-mcp--hydra-mcp-solana)

HTML

<a href="/listings/hydra-mcp--hydra-mcp-solana"><img src="/api/listings/hydra-mcp--hydra-mcp-solana/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

1. Clone the repository

git clone https://github.com/hydra-mcp/hydra-mcp-solana.git
cd hydra-mcp-solana

2. Install dependencies

pnpm install

3. Configure environment variables

Create a `.env.local` file (or edit the existing one):

VITE_API_BASE_URL=your_api_endpoint

4. Start the development server

pnpm dev

The application will run on [http://localhost:5173](http://localhost:5173).

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 277 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # HYDRA-AI Frontend
  2. HYDRA-AI is a modern AI chat application built with React, TypeScript, and Tailwind CSS. The project utilizes the latest web technology stack to provide a smooth, responsive user experience for blockchain project analysis and AI assistant interactions.
  3. ## Features
  4. - 🔐 User authentication system with token-based authorization and refresh functionality
  5. - 💬 Real-time AI chat functionality with SSE (Server-Sent Events) streaming responses
  6. - 🔍 Blockchain project analysis capabilities through specialized AI assistants
  7. - 📊 Multi-stage processing visualization for complex analysis tasks
  8. - 💾 Local chat history management with persistence
  9. - 🔔 Toast notifications and error handling system
  10. - 🎨 Modern UI using Tailwind CSS and Shadcn components
  11. - 📱 Responsive design with specialized layouts for different devices (including iOS)
  12. - 🚀 Built with Vite, providing a fast development experience
  13. - 👛 Wallet connectivity features for blockchain interactions
  14. - 💰 Solana payment integration with Phantom wallet
  15. - 📱 iOS desktop simulation with window management
  16. - 💸 Recharge and consumption history tracking
  17. ## Key Modules
  18. - **iOS Desktop Experience**: Simulated iOS desktop interface with app window management, context menus, and theme switching
  19. - **Solana Payment System**: Complete Solana blockchain integration for creating recharge orders, making payments, and tracking transaction history
  20. - **AI Chat Interface**: Advanced chat system with message streaming, history persistence, and context management
  21. - **Wallet Integration**: Phantom wallet connectivity for Solana blockchain interactions
  22. - **Authentication System**: Secure user auth with token management
  23. ## Tech Stack
  24. - **Framework**: React 18
  25. - **Routing**: React Router v7
  26. - **State Management**: React Context API
  27. - **Styling**: Tailwind CSS
  28. - **UI Components**: Radix UI / Shadcn
  29. - **Build Tool**: Vite
  30. - **Package Manager**: pnpm
  31. - **Language**: TypeScript
  32. - **Animation**: Framer Motion
  33. - **API Communication**: Fetch API with SSE support
  34. - **Blockchain**: Solana Web3.js
  35. - **Form Handling**: React Hook Form + Zod validation
  36. ## Development Environment Setup
  37. ### Prerequisites
  38. - Node.js (Recommended v18+)
  39. - pnpm (v10+)
  40. ### Installation
  41. 1. Clone the repository
  42. ```bash
  43. git clone https://github.com/hydra-mcp/hydra-mcp-solana.git
  44. cd hydra-mcp-solana
  45. ```
  46. 2. Install dependencies
  47. ```bash
  48. pnpm install
  49. ```
  50. 3. Configure environment variables
  51. Create a `.env.local` file (or edit the existing one):
  52. ```
  53. VITE_API_BASE_URL=your_api_endpoint
  54. ```
  55. 4. Start the development server
  56. ```bash
  57. pnpm dev
  58. ```
  59. The application will run on [http://localhost:5173](http://localhost:5173).
  60. ## Application Structure
  61. The application is organized into the following key components:
  62. ### Core Components
  63. - **Chat Interface**: A full-featured chat UI with message history, streaming responses, and context management
  64. - **Authentication System**: Login page with token-based authentication
  65. - **Wallet Integration**: Connection to blockchain wallets for crypto interactions
  66. - **Error Handling**: Global error boundary and API error handling system
  67. - **iOS Desktop Simulation**: Interactive iOS-like desktop environment with window management
  68. - **Solana Payment**: Complete payment flow with wallet connection, transaction processing, and history tracking
  69. ### Pages
  70. - **Home**: Landing page showcasing available features and system capabilities
  71. - **ChatPage**: Main chat interface with AI assistant
  72. - **IOSDesktop**: iOS-like desktop environment with multiple app windows and interactions
  73. - **SolanaPaymentPage**: Interface for Solana blockchain payments and recharge history
  74. ## Component Organization
  75. ```
  76. src/
  77. ├── components/ # Reusable UI components
  78. │ ├── chat/ # Chat-related components
  79. │ ├── ui/ # Core UI components (Shadcn)
  80. │ ├── phantom/ # Wallet connection components
  81. │ ├── ios/ # iOS-specific components
  82. │ └── SolanaPayment/ # Solana payment flow components
  83. ├── contexts/ # React contexts for state management
  84. ├── hooks/ # Custom React hooks
  85. ├── layouts/ # Layout components
  86. ├── lib/ # Utility functions and API clients
  87. │ ├── api.ts # API communication layer
  88. │ ├── sse.ts # Server-Sent Events implementation
  89. │ ├── walletService.ts # Wallet connection and management
  90. │ └── utils.ts # General utility functions
  91. ├── pages/ # Application pages
  92. ├── types/ # TypeScript type definitions
  93. ├── App.tsx # Main application component with routes
  94. ├── Login.tsx # Authentication page
  95. └── main.tsx # Application entry point
  96. ```
  97. ## Build and Deployment
  98. ### Production Build
  99. ```bash
  100. pnpm build
  101. ```
  102. The built files will be located in the `dist` directory.
  103. ### Deployment Process
  104. #### Using Caddy Server (Recommended)
  105. 1. Install Caddy Server
  106. Please refer to the [Caddy official documentation](https://caddyserver.com/docs/install) for installation.
  107. 2. Configure Caddyfile
  108. Create or edit the Caddyfile:
  109. ```
  110. your-domain.com {
  111. root * /path/to/hydra-front/dist
  112. # Set up SPA routing
  113. try_files {path} {path}/ /index.html
  114. # Define static resource matcher
  115. @static {
  116. path *.css *.js *.ico *.gif *.jpg *.jpeg *.png *.svg *.webp *.woff *.woff2
  117. }
  118. # Static resource cache settings
  119. header @static Cache-Control "public, max-age=31536000, immutable"
  120. # HTML file cache settings
  121. @html {
  122. path *.html
  123. }
  124. header @html Cache-Control "no-cache, no-store, must-revalidate"
  125. # API proxy settings (if needed)
  126. reverse_proxy /api/* your_backend_api_server
  127. # Enable file server
  128. file_server
  129. }
  130. ```
  131. 3. Start Caddy Server
  132. ```bash
  133. caddy run
  134. ```
  135. #### Using Docker Deployment
  136. 1. Use Dockerfile
  137. The project already includes a Dockerfile, which can be built directly:
  138. ```bash
  139. docker build -t hydra-front .
  140. docker run -d -p 80:80 hydra-front
  141. ```
  142. 2. Use docker-compose
  143. The project provides a docker-compose.yml file, which can be used to deploy both the frontend and backend:
  144. ```bash
  145. # Start the service
  146. docker-compose up -d
  147. # View logs
  148. docker-compose logs -f
  149. # Stop the service
  150. docker-compose down
  151. ```
  152. Note: Please adjust the configuration in docker-compose.yml according to your actual situation before using it.
  153. ## Environment Variables
  154. - `VITE_API_BASE_URL`: API server base URL
  155. - `VITE_BASE_URL`: Optional alternative API base URL (for development/testing)
  156. ## API Documentation
  157. HYDRA-AI frontend uses the `/agent/chat/completions` API endpoint to interact with the AI assistant, implementing blockchain project analysis functionality. This API is similar to the structure of OpenAI's Chat Completions API, suitable for frontend developers familiar with LLM APIs. For the complete API documentation, please refer to [API documentation](API.md).
  158. ### Endpoint
  159. ```
  160. POST /agent/chat/completions
  161. ```
  162. ### Authentication
  163. - Requires an authenticated user session
  164. - Uses JWT authentication (managed by the `get_current_active_user` dependency)
  165. ### Request Format
  166. ```json
  167. {
  168. "model": "gpt-4",
  169. "messages": [
  170. {
  171. "role": "system",
  172. "content": "You are a helpful assistant."
  173. },
  174. {
  175. "role": "user",
  176. "content": "Analyze the project at address 0x123..."
  177. }
  178. ],
  179. "stream": true,
  180. "temperature": 0.7,
  181. "max_tokens": 1024,
  182. "project_context": {
  183. "additional_context": "any relevant context"
  184. }
  185. }
  186. ```
  187. ### Response Types
  188. API provides two response modes:
  189. 1. **Non-streaming response** - Full response returned once
  190. 2. **Streaming response** - Returned in Server-Sent Events (SSE) format, containing the following event types:
  191. - **Stage event** - Represents different stages of the analysis process
  192. - **Content event** - Passes actual content blocks
  193. - **Error event** - Passes error information
  194. - **Done event** - Represents the end of the stream
  195. ## Contribution
  196. Welcome to contribute! Please follow the following steps:
  197. 1. Fork the repository
  198. 2. Create your feature branch: `git checkout -b feature/amazing-feature`
  199. 3. Commit your changes: `git commit -m 'Add some amazing feature'`
  200. 4. Push to the branch: `git push origin feature/amazing-feature`
  201. 5. Open a Pull Request
  202. ## License
  203. [Apache 2.0](LICENSE)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.