tentix
Tentix is an AI-driven customer service platform that achieves 10x efficiency. Built with a monorepo architecture, it integrates frontend, backend, and AI processing capabilities. The system supports multi-channel integration and offers intelligent ticket processing and automatic reply functionalities.
GitHub Stars
6
User Rating
Not Rated
Forks
3
Issues
7
Views
1
Favorites
0
Tentix = Ten (10x Efficiency) Tix (Ticket System)
A FastGPT-powered AI customer service platform with 10x accelerated resolution.
- ๐ 10x Faster Response Speed
- ๐ค 10x Reduced Human Intervention
- ๐ 10x Improved User Satisfaction
๐ Table of Contents
- Project Overview
- Tech Stack
- Project Structure
- Quick Start
- Development Guide
- Database Scripts
- Configuration Files
- Deployment Guide
- API Documentation
- Contributing
๐ฏ Project Overview
Tentix is a modern AI-driven customer service system built with Monorepo architecture, integrating frontend interface, backend API, and AI processing capabilities. The system supports multi-channel integration (Feishu, etc.) and provides intelligent ticket processing, automatic replies, and seamless human-AI handover functionality.
Core Features
- ๐ค AI Smart Customer Service: Intelligent conversation system based on FastGPT
- ๐ฑ Multi-Channel Integration: Support for Feishu, WeChat and other platforms
- ๐ซ Ticket Management: Complete ticket lifecycle management
- ๐ฅ Team Collaboration: Support for multi-department, multi-role collaboration
- ๐ Data Analytics: Real-time monitoring and data statistics
- ๐ง Scalable Architecture: Modular design, easy to extend
๐ Tech Stack
Frontend Tech Stack
- Framework: React 19 + TypeScript
- Build Tool: Vite 6.1
- Routing: TanStack Router
- State Management: Zustand + TanStack Query
- UI Components: Custom UI component library + Tailwind CSS 4.0
- Rich Text Editor: TipTap
- Code Highlighting: React Syntax Highlighter
Backend Tech Stack
- Runtime: Bun
- Framework: Hono 4.7
- Database: PostgreSQL + Drizzle ORM
- API Documentation: OpenAPI + Scalar
- File Storage: MinIO
- Caching: Node Cache
- Rate Limiting: Hono Rate Limiter
Development Tools
- Monorepo: Turborepo
- Package Manager: Bun
- Code Standards: ESLint + Prettier
- Type Checking: TypeScript 5.8
- Containerization: Docker + Docker Compose
๐ Project Structure
tentix-v2/
โโโ frontend/ # Frontend application
โ โโโ src/
โ โ โโโ components/ # UI components
โ โ โโโ routes/ # Route pages
โ โ โโโ store/ # State management
โ โ โโโ hooks/ # Custom Hooks
โ โ โโโ lib/ # Utility libraries
โ โ โโโ 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
๐ Quick Start
Environment Requirements
- Node.js >= 20
- Bun >= 1.2.15
- PostgreSQL
- Docker (optional)
Install Dependencies
bun install
This Monorepo can only use Bun as the package manager.
Environment Configuration
- Generate encryption key:
cd server
bun run script/getCryptoKey.ts
- Copy configuration file template:
cp server/config.template.json server/config.dev.json
- Configure environment variables:
cp .env.example .env.local
# Add the generated encryption key to .env.local
- Initialize database:
cd server
bun run script/initDB.ts
- (Optional) Generate seed data for development:
cd server
bun run seed
For detailed configuration instructions, see Configuration Files and Database Scripts sections.
Start Development Server
# Start development environment
bun run dev
# Or use Make command
make dev
Visit http://localhost:5173 to view the frontend application Visit http://localhost:3000/api/reference to view the backend API
๐ป Development Guide
Development Commands
# Development environment
bun run dev # Start development server
bun run build # Build project
bun run lint # Code linting
bun run format # Code formatting
bun run typecheck # Type checking
bun run test # Run tests
# Database operations
cd server
bun run generate # Generate database migrations
bun run migrate # Execute database migrations
bun run studio # Open Drizzle Studio
bun run seed # Database seed data
# Database utility scripts
bun run script/getCryptoKey.ts # Generate encryption keys
bun run script/initDB.ts # Initialize database with users
bun run script/resetDB.ts # Reset database completely
bun run script/migrateStaffList.ts # Migrate staff from Feishu
# Helpful Bash Command
rm -rf ./**/turbo ./**/node_modules ./**/output ./**/dist
Code Standards
The project uses ESLint + Prettier for code standards management:
- Use TypeScript strict mode
- Follow React Hooks conventions
- Components use PascalCase naming
- Files use kebab-case naming
- Automatically run lint checks before commits
Development Workflow
- Create feature branch:
git checkout -b feature/your-feature
- Develop feature: Follow code standards for development
- Run tests:
bun run test
to ensure tests pass - Code checking:
bun run lint
to fix code issues - Commit code: Use standardized commit messages
- Create PR: Submit Pull Request for code review
๐๏ธ Database Scripts
The project includes several utility scripts for database management and system initialization. These scripts are located in server/script/
and handle various aspects of database setup, user management, and data migration.
Available Scripts
getCryptoKey.ts
: Generate secure AES-256 encryption keys for the applicationinitDB.ts
: Initialize database with system users, AI user, and staff membersresetDB.ts
: Completely reset database schema and regenerate migrationsmigrateStaffList.ts
: Fetch and migrate staff data from Feishu platformseed.ts
: Generate realistic seed data for development and testing
Quick Setup Workflow
# 1. Generate encryption key
cd server && bun run script/getCryptoKey.ts
# 2. Initialize database
bun run script/initDB.ts
# 3. (Optional) Generate test data
bun run seed
For detailed information about each script, including usage examples, configuration requirements, and troubleshooting, see the Scripts Documentation.
โ๏ธ Configuration Files
Server Configuration (server/config.*.json
)
{
"$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_id"],
"agents_ids": ["agent_id"],
"admin_ids": ["admin_id"],
"staffs": [],
"departments": []
}
Environment Variables (.env.local
)
# Database configuration
DATABASE_URL=postgresql://username:password@localhost:5432/tentix
ENCRYPTION_KEY="q1cRtBG7J9YyFlPmeynwlJ1B+5Nu0SOa+hAUtUhh9lk="
# MinIO configuration
MINIO_ACCESS_KEY=your_access_key
MINIO_SECRET_KEY=your_secret_key
MINIO_BUCKET=your_bucket_name
MINIO_ENDPOINT=your_minio_endpoint
# FastGPT configuration
FASTGPT_API_URL=your_fastgpt_api_url
FASTGPT_API_KEY=your_fastgpt_api_key
FASTGPT_API_LIMIT=50
# Other configuration
NODE_ENV=development
Configuration File Description
config.dev.json
: Development environment configurationconfig.prod.json
: Production environment configurationconfig.template.json
: Configuration template fileconfig.schema.json
: Configuration file JSON Schema
๐ข Deployment Guide
Docker Deployment (Recommended)
Production Environment Deployment
# Deploy using Docker Compose
make docker-up
# Or use docker-compose directly
docker-compose up -d --build
Development Environment Build Testing
# Start development environment
make docker-dev
# Or use docker-compose
docker-compose --profile dev up --build
Manual Deployment
# 1. Build project
bun run build
# 2. Start production server
bun run start
# Or use PM2
pm2 start bun --name tentix -- run start
Deploy to Cloud Server
# 1. Build Docker image
make build
# 2. Push to image registry
make push DOCKER_REGISTRY=your-registry
# 3. Pull and run on server
docker pull your-registry/tentix:latest
docker run -d -p 3000:3000 your-registry/tentix:latest
Health Check
After deployment, you can check service status through the following endpoints:
- Health check:
GET /health
- API documentation:
GET /api/reference
- Service status:
GET /api/status
๐ API Documentation
Access API Documentation
After starting the service, visit the following addresses to view API documentation:
- Scalar UI: http://localhost:3000/api/reference
- OpenAPI JSON: http://localhost:3000/openapi.json
Main API Endpoints
GET /api/health # Health check
POST /api/auth/login # User login
GET /api/tickets # Get ticket list
POST /api/tickets # Create ticket
GET /api/tickets/:id # Get ticket details
PUT /api/tickets/:id # Update ticket
DELETE /api/tickets/:id # Delete ticket
Authentication Method
API uses Bearer Token authentication:
curl -H "Authorization: Bearer your-token" \
http://localhost:3000/api/tickets
๐ค Contributing
Submit Code
- Fork the project to your GitHub account
- Create feature branch:
git checkout -b feature/amazing-feature
- Commit changes:
git commit -m 'Add amazing feature'
- Push branch:
git push origin feature/amazing-feature
- Create Pull Request
Commit Message Standards
Use Conventional Commits standards:
feat: add new feature
fix: fix bug
docs: update documentation
style: format code
refactor: refactor code
test: add tests
chore: update dependencies
Code Review
All code changes need to go through Pull Request review:
- Ensure all tests pass
- Follow project code standards
- Add necessary documentation and comments
- Update related test cases
๐ Support
If you encounter problems or have questions:
- Check if there are similar issues in Issues
- Create a new Issue describing your problem
- Contact project maintainers
Happy Coding! ๐
841
Followers
54
Repositories
0
Gists
66
Total Contributions