Tentix: A Comprehensive Guide to the AI-Powered Efficient Customer Service Platform

In today’s digital era, customer service efficiency directly impacts a company’s competitiveness. As an AI-driven customer service platform built on FastGPT, Tentix redefines customer service experiences through its “10x Efficiency” philosophy—delivering 10x faster response times, 10x less manual intervention, and 10x higher user satisfaction. This article provides a complete breakdown of this modern system, which uses a Monorepo architecture, covering everything from technical implementation to real-world applications. Whether you’re a developer or a service manager, this guide will help you understand and use Tentix effectively.

What Is Tentix?

Tentix (short for “Ten (10x Efficiency) Tix (Ticket System)”) is an all-in-one customer service solution that combines a frontend interface, backend APIs, and AI processing capabilities. It uses a single codebase (Monorepo) architecture, supports integration with multiple channels (such as Feishu), and offers features like intelligent ticket management, automated responses, and seamless switching between AI and human agents.

To put it simply, Tentix acts as an “intelligent customer service hub”: AI handles most routine inquiries, and when complex issues arise, the system automatically routes them to human agents. Throughout the process, all interactions are recorded, creating a complete ticket management workflow. This model not only speeds up response times but also ensures consistent service quality.

Core Features of Tentix

Tentix’s “10x Efficiency” promise is made possible by its carefully designed core features:

  • AI-Powered Customer Service: A smart conversation system built on FastGPT that understands user intent and delivers accurate responses
  • Multi-Channel Integration: Unifies management of customer inquiries across platforms like Feishu and WeChat
  • Ticket Management: Covers the entire ticket lifecycle, from creation and assignment to resolution and archiving
  • Team Collaboration: Supports cross-department and cross-role cooperation to ensure issues reach the right handlers
  • Data Analysis: Real-time monitoring of service quality and efficiency, with data statistics and visual reports
  • Scalable Architecture: Modular design allows the system to expand functions based on business needs

Tentix Tech Stack Breakdown

Tentix is built using a set of modern technologies, and the choice of these tools directly affects the system’s performance and development efficiency. Below is a detailed breakdown of the frontend, backend, and development tools used:

Frontend Tech Stack

The frontend is the part users interact with directly, and Tentix prioritizes performance and development experience in its frontend technology choices:

  • React 19 + TypeScript: React handles UI rendering, while TypeScript provides type safety to reduce runtime errors
  • Vite 6.1: A build tool that replaces traditional webpack, offering fast startup times and instant hot updates
  • TanStack Router: Manages page routing, supporting nested routes and code splitting
  • Zustand + TanStack Query: Zustand manages client-side state, and TanStack Query handles server-side state and data caching
  • Custom UI Component Library + Tailwind CSS 4.0: Balances UI consistency with styling flexibility
  • TipTap: A feature-rich rich-text editor used for ticket content and responses
  • React Syntax Highlighter: Displays and highlights code, making it useful for technical support scenarios

Backend Tech Stack

The backend serves as the system’s “brain,” and Tentix uses a lightweight, efficient technology combination:

  • Bun: A JavaScript runtime faster than traditional Node.js, with built-in package management capabilities
  • Hono 4.7: A lightweight web framework ideal for building APIs, supporting edge computing environments
  • PostgreSQL + Drizzle ORM: PostgreSQL provides reliable relational data storage, and Drizzle ORM simplifies database operations
  • OpenAPI + Scalar: Automatically generates API documentation to facilitate frontend-backend collaboration and API testing
  • MinIO: Object storage compatible with the S3 protocol, used for storing attachments and other files
  • Node Cache: An in-memory caching tool that improves response times for frequently accessed data
  • Hono Rate Limiter: Prevents API abuse and protects system stability

Development Tools

To ensure efficient collaboration in large teams, Tentix uses the following development tools:

  • Turborepo: A Monorepo management tool that optimizes build and task execution efficiency
  • Bun: Serves as both a runtime and package manager, installing dependencies 28x faster than npm
  • ESLint + Prettier: Ensures consistent code style and reduces formatting conflicts in team collaboration
  • TypeScript 5.8: Enforces strict type checking to identify potential issues during development
  • Docker + Docker Compose: Enables containerized deployment to ensure consistency across development, testing, and production environments

Tentix Project Structure

Understanding the project structure is essential for efficient development. Tentix uses a clear Monorepo structure to organize different functional modules in a single codebase:

tentix-v2/
├── frontend/                 # Frontend application
│   ├── src/
│   │   ├── components/      # UI components
│   │   ├── routes/          # Route pages
│   │   ├── store/           # State management
│   │   ├── hooks/           # Custom hooks
│   │   ├── lib/             # Utility library
│   │   └── modal/           # Modal components
│   ├── public/              # Static assets
│   └── package.json
├── server/                   # Backend service
│   ├── api/                 # API routes
│   ├── db/                  # Database configuration
│   ├── utils/               # Utility functions
│   ├── types/               # Type definitions
│   ├── script/              # Script files
│   ├── config.*.json        # Configuration files
│   └── package.json
├── packages/                 # Shared packages
│   ├── ui/                  # UI component library
│   ├── i18n/                # Internationalization
│   ├── eslint-config/       # ESLint configuration
│   └── typescript-config/   # TypeScript configuration
├── docker-compose.yml        # Docker Compose configuration
├── Dockerfile               # Docker image configuration
├── Makefile                 # Build scripts
├── turbo.json               # Turborepo configuration
└── package.json             # Root package configuration

This structure offers several advantages:

  1. All code is managed centrally, eliminating the hassle of cross-repository collaboration
  2. Shared code (such as UI components and type definitions) can be reused directly without being published to npm
  3. Unified development processes and configurations reduce the learning curve for new team members
  4. Simplified dependency management reduces version conflicts

How to Get Started with Tentix?

If you want to run Tentix locally for development or testing, follow these steps:

Prerequisites

Before you start, make sure your computer has the following software installed:

  • Node.js ≥ 20
  • Bun ≥ 1.2.16
  • PostgreSQL database
  • Docker (optional, recommended for quickly deploying dependent services)

You can check if your versions meet the requirements using the following commands:

bun --version
node --version
psql --version

Installing Dependencies

Tentix only supports Bun as a package manager—npm, yarn, or pnpm cannot be used, as they will cause dependency conflicts. Installing dependencies is straightforward:

bun install

Bun installs dependencies much faster than npm, saving you significant waiting time.

Environment Configuration

  1. Generate an encryption key:
    The encryption key is used to securely store sensitive information. Run the following command to generate one:

    cd server
    bun run script/getCryptoKey.ts
    

    After generation, you will get a key similar to q1cRtBG7J9YyFlPmeynwlJ1B+5Nu0SOa+hAUtUhh9lk=. Save this key for later use.

  2. Copy the configuration file template:

    cp server/config.template.json server/config.dev.json
    

    This file contains various configuration items for the application, which you will need to modify based on your actual environment later.

  3. Configure environment variables:

    cp .env.template .env.local
    

    Open the .env.local file and add the encryption key you generated earlier. Also, configure database connection information and other settings:

    # Database configuration
    DATABASE_URL=postgresql://username:password@localhost:5432/tentix
    ENCRYPTION_KEY="Your generated key"
    
    # Fill in other configurations based on your actual situation
    
  4. Initialize the database:
    The database is essential for the system to run. Execute the following command to initialize it:

    cd server
    bun run script/initDB.ts
    

    This script creates the necessary database table structures and initial users.

  5. (Optional) Generate test data:
    If you need sample data to test the system, you can run:

    cd server
    bun run seed
    

Starting the Development Server

Once everything is ready, start the development environment:

# Method 1: Run directly
bun run dev

# Method 2: Use Make command
make dev

After successful startup, you can access Tentix through the following addresses:

  • Frontend application: http://localhost:5173
  • Backend API documentation: http://localhost:3000/api/reference

In-Depth Look at Core Technologies

Tentix’s efficient operation relies on several core technologies. Understanding how these technologies work will help you use and extend the system better.

Bun: More Than Just a Package Manager

Bun serves as the foundation for Tentix, acting as both a JavaScript runtime and a package manager. Compared to the traditional Node.js + npm combination, it offers several significant advantages:

  • Extremely fast installation: 28x faster than npm and 12x faster than Yarn, saving team members significant time when installing dependencies
  • Built-in bundler: Eliminates the need for additional webpack or rollup configuration in many cases
  • Native TypeScript support: Runs TypeScript files directly without prior compilation
  • First-class Monorepo support: Manages multiple packages through workspaces

Important notes for using Bun:

  • You must use bun install instead of npm install
  • Do not mix other package managers, as this will cause lock file conflicts
  • You can add package-manager=bun to the .npmrc file to enforce Bun usage within the team

Turborepo: A Helpful Tool for Monorepos

Turborepo coordinates Tentix’s build system, with core features including:

  • Task Graphs: Intelligently arranges task execution order based on dependencies
  • Remote Caching: Allows team members to share build artifacts, avoiding redundant builds
  • Incremental Builds: Only rebuilds changed parts, significantly improving build speed

In Tentix, Turborepo primarily manages dependencies between the frontend, backend, and shared packages, ensuring an efficient and correct build process.

Hono: A Lightweight, Efficient API Framework

Hono is the framework used to build Tentix’s backend APIs, with the following features:

  • RPC support: Enables type-safe communication between frontend and backend to reduce API errors
  • Rich middleware: Simplifies common functions like request handling and authentication
  • Edge compatibility: Runs in various JavaScript runtime environments
  • Automatic API documentation: Generates interface documentation automatically through OpenAPI integration

Below is a simple example of Hono RPC, showing how frontend and backend achieve type-safe communication:

// Backend route definition
const route = app.post("/api/tickets", zValidator("json", ticketSchema), (c) =>
  c.json({ success: true }),
);

// Export types for frontend use
export type AppType = typeof route;

// Frontend usage with full type hints
const client = hc<AppType>("http://localhost:3000");
const result = await client.api.tickets.$post({
  json: { title: "New ticket" },
}).then(r => r.json());

This approach identifies API call errors during development, greatly improving development efficiency.

Development Guidelines and Best Practices

Following good development practices ensures project maintainability, especially in team collaboration environments.

Common Development Commands

Tentix provides a set of commands to simplify the development process:

# Development environment
bun run dev              # Start the development server
bun run build            # Build the project
bun run lint             # Check code for issues
bun run format           # Format code
bun run typecheck        # Check types
bun run test             # Run tests

# Database operations
cd server
bun run generate         # Generate database migration files
bun run migrate          # Execute database migrations
bun run studio           # Open Drizzle Studio (database visualization tool)
bun run seed             # Generate test data

Code Standards

Unified code standards are the foundation of team collaboration. Tentix follows these standards:

  • Use TypeScript strict mode to enforce type checking
  • Follow React Hooks rules to ensure correct component state management
  • Use PascalCase for component names (e.g., TicketList)
  • Use kebab-case for file names (e.g., ticket-detail.tsx)
  • Lint checks run automatically before code submission to ensure compliance with standards

Development Workflow

  1. Create a feature branch: git checkout -b feature/your-feature-name
  2. Develop the feature: Write code following the code standards
  3. Run tests: Use bun run test to ensure tests pass
  4. Check code: Use bun run lint to fix code issues
  5. Commit code: Use a standardized commit message (e.g., feat: add ticket search function)
  6. Create a PR: Submit a pull request and wait for code review

Database Management

The database stores all of Tentix’s business data, so proper database management is crucial.

Database Scripts

Tentix provides several useful scripts to simplify database operations. These scripts are located in the server/script/ directory:

  • getCryptoKey.ts: Generates an AES-256 encryption key for encrypting sensitive data
  • initDB.ts: Initializes the database, creating basic table structures and system users
  • resetDB.ts: Fully resets the database, deleting all data and regenerating table structures
  • migrateStaffList.ts: Syncs employee data from the Feishu platform
  • seed.ts: Generates sample data for development and testing

Database Operation Workflow

  1. Generate an encryption key (only required the first time):

    cd server && bun run script/getCryptoKey.ts
    
  2. Initialize the database:

    bun run script/initDB.ts
    
  3. Create database migrations (when table structures need to be modified):

    bun run generate  # Generate migration files
    bun run migrate   # Execute migrations
    
  4. (Optional) Generate test data:

    bun run seed
    

Configuration File Details

Tentix’s configuration files are used to adjust system behavior to adapt to different environments and requirements.

Server Configuration Files

Server configuration files (server/config.*.json) contain the application’s core configurations:

{
  "$schema": "./config.schema.json",
  "feishu_app_id": "Your Feishu app ID",
  "feishu_app_secret": "Your Feishu app secret",
  "aiProfile": {
    "uid": "0",
    "name": "Tentix AI",
    "nickname": "Tentix AI",
    "role": "ai",
    "avatar": "Avatar URL"
  },
  "department_ids": ["Department IDs"],
  "agents_ids": ["Agent IDs"],
  "admin_ids": ["Admin IDs"],
  "staffs": [],
  "departments": []
}

Different environments use different configuration files:

  • config.dev.json: Development environment
  • config.prod.json: Production environment
  • config.template.json: Configuration template used to create new configuration files

Environment Variables

Environment variables (.env.local) are used to store sensitive information and environment-specific configurations:

# Database configuration
DATABASE_URL=postgresql://username:password@localhost:5432/tentix
ENCRYPTION_KEY="Your encryption key"

# MinIO configuration
MINIO_ACCESS_KEY=Access key
MINIO_SECRET_KEY=Secret key
MINIO_BUCKET=Bucket name
MINIO_ENDPOINT=Service address

# FastGPT configuration
FASTGPT_API_URL=API address
FASTGPT_API_KEY=API key
FASTGPT_API_LIMIT=Call limit

# Other configurations
NODE_ENV=development

Deployment Guide

There are several ways to deploy Tentix to a production environment. Docker deployment is recommended to ensure environment consistency.

Docker Deployment (Recommended)

Docker deployment simplifies environment configuration and can be completed with just a few commands:

# Production environment deployment
make docker-up

# Or use docker-compose directly
docker-compose up -d --build

If you need to test the production environment build locally:

# Start Docker configuration for development environment
make docker-dev

# Or
docker-compose --profile dev up --build

Manual Deployment

If you need to deploy manually, follow these steps:

  1. Build the project:

    bun run build
    
  2. Start the production server:

    bun run start
    
    # Or use PM2 for process management
    pm2 start bun --name tentix -- run start
    

Cloud Server Deployment

The process for deploying Tentix to a cloud server is as follows:

  1. Build the Docker image:

    make build
    
  2. Push to the image repository:

    make push DOCKER_REGISTRY=Your image repository address
    
  3. Pull and run on the cloud server:

    docker pull Your image repository address/tentix:latest
    docker run -d -p 3000:3000 Your image repository address/tentix:latest
    

Post-Deployment Checks

After deployment, you can check the service status through these endpoints:

  • Health check: GET /health
  • API documentation: GET /api/reference
  • Service status: GET /api/status

API Documentation

Tentix’s API design follows RESTful specifications and provides detailed documentation.

Accessing API Documentation

After starting the service, you can view the API documentation through the following addresses:

  • Scalar UI (interactive documentation): http://localhost:3000/api/reference
  • OpenAPI JSON (machine-readable format): http://localhost:3000/openapi.json

Key API Endpoints

Tentix provides a rich set of API endpoints. Below are some core endpoints:

GET    /api/health          # Health check
POST   /api/auth/login      # User login
GET    /api/tickets         # Get ticket list
POST   /api/tickets         # Create a new ticket
GET    /api/tickets/:id     # Get ticket details
PUT    /api/tickets/:id     # Update a ticket
DELETE /api/tickets/:id     # Delete a ticket

Authentication Method

Tentix’s API uses Bearer Token authentication. Here’s an example of how to make a call:

curl -H "Authorization: Bearer Your token" \
     http://localhost:3000/api/tickets

Frequently Asked Questions (FAQ)

You may encounter the following questions when using Tentix:

1. Why is Bun required instead of npm?

Tentix’s dependency management and build processes are optimized for Bun. Bun’s workspace features and performance advantages are critical for the Monorepo architecture. Using other package managers may cause dependency conflicts, build failures, or performance degradation.

If you accidentally use npm, you can fix the issue by running:

rm -rf node_modules package-lock.json
bun install

2. What should I do if I get a “Cannot find module” error?

This error is usually caused by incorrect dependency installation or workspace configuration issues:

  • Check if the workspace configuration in package.json is correct
  • Ensure internal package names match directory names
  • Run bun install to refresh dependencies

3. How do I resolve database connection failures?

You can troubleshoot database connection issues by checking these areas:

  • Verify that the DATABASE_URL in .env.local is correct
  • Confirm that the PostgreSQL service is running
  • Check that the database user has sufficient permissions
  • Verify firewall settings to ensure the port is not blocked

4. What if changes to my code don’t take effect during development?

This may be caused by caching issues:

  • Try restarting the development server
  • Clear your browser cache
  • Check for unsaved files
  • Run bun run clean to clear build cache and rebuild

5. How do I add a new database table or modify an existing table structure?

Tentix uses migrations to manage changes to database structures:

  1. Modify the table definition in server/db/schema.ts
  2. Run bun run generate to generate migration files
  3. Check that the generated migration files are correct
  4. Run bun run migrate to apply the migrations

Conclusion

Through its modern tech stack and architectural design, Tentix achieves a “10x improvement” in customer service efficiency. It uses a Monorepo architecture to manage frontend and backend code, leverages Bun and Turborepo to optimize the development experience, implements efficient API communication through Hono, and provides reliable data storage with PostgreSQL.

Whether you’re developing new features, deploying to a production environment, or performing daily maintenance, following the processes and best practices outlined in this guide will help you use Tentix more efficiently. As business needs evolve, Tentix’s modular design also allows the system to scale flexibly, adapting to changing customer service scenarios.

If you encounter issues while using Tentix, in addition to referring to the FAQ section in this guide, you can also check the project’s Issues or contact the maintenance team for assistance.