AIPEXBASE Documentation

repository·main·Indexed 23 days ago

https://github.com/kuafuai/aipexbase

A Backend-as-a-Service (BaaS) infrastructure for the AI era, providing Auth, Data Storage, and Context Management. Optimized for integration with AI coding tools like Cursor, Trae, Claude Code, and CodeFlying via an MCP (Model Context Protocol) server. Features include an AI-powered API Market for importing documentation, project management dashboards, and support for deployment via Docker Compose or source code (Java 1.8+, Node.js 18+, MySQL 8.0+).

Tokens
4.3K
Snippets
7
Records
28
Agent score
79%

What's inside AIPEXBASE

  1. Integrate AIPEXBASE with AI IDEs (Cursor, Trae, etc.)

    main

    AIPEXBASE is designed to work with AI-native coding tools like Cursor, Trae, Claude Code, and CodeFlying. You can integrate the AIPEXBASE SDK to enable end-to-end development from frontend to cloud using AI assistance.

    Refer to the Integration Guide for specific steps on how to connect your AI IDE to the AIPEXBASE backend capabilities.

  2. Install AIPEXBASE via Source Code

    main

    To install AIPEXBASE from source, ensure your system meets the following requirements:

    • Java: 1.8+
    • Node.js: 18+
    • MySQL: 8.0+

    Installation Steps

    1. Clone the repository:

      git clone https://github.com/kuafuai/aipexbase.git
      cd aipexbase
    2. Initialize Database: Import the SQL script located at ./install/mysql/init.sql into your local MySQL database.

    3. Configure Database Connection: Navigate to backend/src/main/resources and modify the default JDBC configuration in the application-mysql.yml file to match your local MySQL settings.

    4. Start the Backend Service: Run the following command to start the Spring Boot service. The service will be available at http://localhost:8080:

      mvn spring-boot:run
    5. Start the Management Console (Optional): To run the frontend locally:

      cd frontend
      npm install
      npm run dev
    git clone https://github.com/kuafuai/aipexbase.git
    cd aipexbase
    
    # After configuring application-mysql.yml
    mvn spring-boot:run
    
    # Optional frontend
    cd frontend
    npm install
    npm run dev
  3. Create an application and API Key in AIPEXBASE

    main

    Before integrating with an AI IDE, you must create an application and generate a unique API key within the AIPEXBASE admin panel.

    1. Navigate to the AIPEXBASE admin panel.
    2. Create a new application.
    3. Enter the application and click on API KEYS in the left sidebar.
    4. Fill in the required information to create a new API KEY.
    5. Copy and save the generated key; you will need it for the MCP server configuration.
  4. Use AIPEXBASE built-in prompts in Cursor

    main

    Once the MCP server is configured, you can use specialized software development prompts to drive the AI:

    1. Click Toggle AI Pane in the top right corner of Cursor to open the AI dialog.
    2. Enter / in the dialog to activate the prompt selector.
    3. Select the AIPEXBASE built-in software development prompts.
    4. Describe your requirements (e.g., "Build a community library reservation management web system using Vue3 + JavaScript + Vite").
    5. The AI will use aipexbase.js to generate frontend code and automatically invoke the AIPEXBASE backend to handle database schema creation and business logic.
  5. Deploy AIPEXBASE using Docker Compose

    main

    To deploy AIPEXBASE using Docker Compose, ensure you meet the prerequisites and follow the configuration steps for the services.

    Prerequisites

    • Linux
    • Docker
    • Docker Compose v2.5 or higher

    Configuration

    Edit the ./install/docker-compose.yaml file to customize the following:

    • backend-new service: Modify the log output mount directory.
    • mysql-new service: Modify the MySQL data directory.
    • Ports: Configure the port numbers for exposing services as needed.

    Running

    Start the deployment in detached mode using:

    docker-compose up -d
  6. Configure the AIPEXBASE MCP Server in Cursor

    main

    To enable rapid application development using AI in Cursor, you must add the AIPEXBASE MCP (Model Context Protocol) server configuration.

    Replace your-domain-or-ip with your actual AIPEXBASE server address and append your copied API key after token= in the URL.

    {
      "mcpServers": {
        "aipexbase-mcp-server": {
          "url": "http://your-domain-or-ip/mcp/sse?token=coding123"
        }
      }
    }
  7. Configure Nginx proxy for AIPEXBASE

    main

    If you are using an external proxy service (like Nginx) to forward requests to AIPEXBASE, you must configure specific locations for the frontend and the API/MCP endpoints to ensure correct routing and connection stability.

    API Routing (/baas-api)

    Forward requests to the backend and rewrite the path to strip the /baas-api prefix. Ensure headers like X-Real-IP and X-Forwarded-For are set to preserve the client's real IP.

    MCP Routing (/mcp)

    For the /mcp endpoint, you must disable proxy buffering and caching, and set the connection to HTTP 1.1 to maintain long-lived connections. Additionally, increase proxy_read_timeout and proxy_send_timeout to prevent connection drops during long operations.

        location / {
            root /usr/share/nginx;
            try_files $uri $uri/ /index.html;
        }
        location /baas-api {
            proxy_pass http://1.1.1.1:8080;
            rewrite ^/baas-api/(.*)$ /$1 break;
            proxy_set_header REMOTE-HOST $remote_addr;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
        location /mcp {
           proxy_pass http://1.1.1.1:8080;
           proxy_set_header Host $host;
    
           # Preserve client real IP
           proxy_set_header X-Real-IP $remote_addr;
           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
           proxy_set_header X-Forwarded-Proto $scheme;
           proxy_set_header Connection '';
           proxy_http_version 1.1;
           proxy_buffering off;
           proxy_cache off;
    
           # Maintain long connection
           proxy_read_timeout 86400s;
           proxy_send_timeout 86400s;
        }
  8. Manage projects in the Dashboard

    main

    The Dashboard view provides a centralized interface for managing AI projects (apps). Users can view a paginated list of projects, check their status (running vs. creating), and see when they were last active.

    Key project management actions available in the UI include:

    • Add Project: Create a new project by providing a name.
    • Import Project: Import existing project configurations via .json or .sql files.
    • Export Project: Download a project's configuration as a .json file.
    • Copy Project: Duplicate an existing project.
    • Recycle Project: Remove or archive projects that have been inactive for more than 15 days.
    • View Details: Navigate to a specific project's detail page using its appId.
  9. Project Management View Structure

    main

    The project management view in AIPEXBASE is organized around a specific appId (retrieved from route parameters) and provides a sidebar navigation for managing different aspects of an AI application.

    The sidebar contains the following menu items, which map to specific sub-routes under /project/${appId}/${path}:

    • Overview (overview): General project overview.
    • Tables (tables): Data table management.
    • Dynamic API (dynamicapi): Configuration for dynamic APIs.
    • API Keys (apikeys): Management of API access keys.
    • Settings (settings): Project-level settings.

    The view uses a breadcrumb pattern to show the current location: Home / {appId} / {Current Page Name}. The current page name is dynamically determined based on the active route matching the menu paths.