{"id":28600882,"url":"https://github.com/labring/tentix","last_synced_at":"2025-06-11T14:39:14.000Z","repository":{"id":294589624,"uuid":"963637599","full_name":"labring/tentix","owner":"labring","description":"TenTix (10x Efficiency Ticket System) - A FastGPT-powered AI native customer service platform with 10x accelerated resolution.","archived":false,"fork":false,"pushed_at":"2025-06-10T10:09:26.000Z","size":1520,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-10T11:25:31.040Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/labring.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-10T01:41:45.000Z","updated_at":"2025-06-10T10:08:17.000Z","dependencies_parsed_at":"2025-06-10T11:21:34.362Z","dependency_job_id":"d60f1cc6-6390-4549-baa1-3b197d2fa16b","html_url":"https://github.com/labring/tentix","commit_stats":null,"previous_names":["labring/tentix"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labring%2Ftentix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labring%2Ftentix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labring%2Ftentix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labring%2Ftentix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labring","download_url":"https://codeload.github.com/labring/tentix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labring%2Ftentix/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259280920,"owners_count":22833476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-11T14:39:13.169Z","updated_at":"2025-06-11T14:39:13.985Z","avatar_url":"https://github.com/labring.png","language":"TypeScript","funding_links":[],"categories":["📚 Projects (2474 total)"],"sub_categories":["MCP Servers"],"readme":"# Tentix = Ten (10x Efficiency) Tix (Ticket System)\n\nA FastGPT-powered AI customer service platform with 10x accelerated resolution.\n\n* 🚀 10x Faster Response Speed\n* 🤖 10x Reduced Human Intervention  \n* 😊 10x Improved User Satisfaction\n\n![image](https://github.com/user-attachments/assets/798dbbd3-4b78-4412-bf69-fda27f12d128)\n\n\n## 📋 Table of Contents\n\n- [Project Overview](#project-overview)\n- [Tech Stack](#tech-stack)\n- [Project Structure](#project-structure)\n- [Quick Start](#quick-start)\n- [Development Guide](#development-guide)\n- [Database Scripts](#database-scripts)\n- [Configuration Files](#configuration-files)\n- [Deployment Guide](#deployment-guide)\n- [API Documentation](#api-documentation)\n- [Contributing](#contributing)\n\n## 🎯 Project Overview\n\nTentix 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.\n\n### Core Features\n\n- 🤖 **AI Smart Customer Service**: Intelligent conversation system based on FastGPT\n- 📱 **Multi-Channel Integration**: Support for Feishu, WeChat and other platforms\n- 🎫 **Ticket Management**: Complete ticket lifecycle management\n- 👥 **Team Collaboration**: Support for multi-department, multi-role collaboration\n- 📊 **Data Analytics**: Real-time monitoring and data statistics\n- 🔧 **Scalable Architecture**: Modular design, easy to extend\n\n## 🛠 Tech Stack\n\n### Frontend Tech Stack\n- **Framework**: React 19 + TypeScript\n- **Build Tool**: Vite 6.1\n- **Routing**: TanStack Router\n- **State Management**: Zustand + TanStack Query\n- **UI Components**: Custom UI component library + Tailwind CSS 4.0\n- **Rich Text Editor**: TipTap\n- **Code Highlighting**: React Syntax Highlighter\n\n### Backend Tech Stack\n- **Runtime**: Bun\n- **Framework**: Hono 4.7\n- **Database**: PostgreSQL + Drizzle ORM\n- **API Documentation**: OpenAPI + Scalar\n- **File Storage**: MinIO\n- **Caching**: Node Cache\n- **Rate Limiting**: Hono Rate Limiter\n\n### Development Tools\n- **Monorepo**: Turborepo\n- **Package Manager**: Bun\n- **Code Standards**: ESLint + Prettier\n- **Type Checking**: TypeScript 5.8\n- **Containerization**: Docker + Docker Compose\n\n## 📁 Project Structure\n\n```\ntentix-v2/\n├── frontend/                 # Frontend application\n│   ├── src/\n│   │   ├── components/      # UI components\n│   │   ├── routes/          # Route pages\n│   │   ├── store/           # State management\n│   │   ├── hooks/           # Custom Hooks\n│   │   ├── lib/             # Utility libraries\n│   │   └── modal/           # Modal components\n│   ├── public/              # Static assets\n│   └── package.json\n├── server/                   # Backend service\n│   ├── api/                 # API routes\n│   ├── db/                  # Database configuration\n│   ├── utils/               # Utility functions\n│   ├── types/               # Type definitions\n│   ├── script/              # Script files\n│   ├── config.*.json        # Configuration files\n│   └── package.json\n├── packages/                 # Shared packages\n│   ├── ui/                  # UI component library\n│   ├── i18n/                # Internationalization\n│   ├── eslint-config/       # ESLint configuration\n│   └── typescript-config/   # TypeScript configuration\n├── docker-compose.yml        # Docker Compose configuration\n├── Dockerfile               # Docker image configuration\n├── Makefile                 # Build scripts\n├── turbo.json               # Turborepo configuration\n└── package.json             # Root package configuration\n```\n\n## 🚀 Quick Start\n\n### Environment Requirements\n\n- Node.js \u003e= 20\n- Bun \u003e= 1.2.15\n- PostgreSQL\n- Docker (optional)\n\n### Install Dependencies\n\n```bash\nbun install\n```\n\nThis Monorepo can only use Bun as the package manager.\n\n### Environment Configuration\n\n1. Generate encryption key:\n```bash\ncd server\nbun run script/getCryptoKey.ts\n```\n\n2. Copy configuration file template:\n```bash\ncp server/config.template.json server/config.dev.json\n```\n\n3. Configure environment variables:\n```bash\ncp .env.example .env.local\n# Add the generated encryption key to .env.local\n```\n\n4. Initialize database:\n```bash\ncd server\nbun run script/initDB.ts\n```\n\n5. (Optional) Generate seed data for development:\n```bash\ncd server\nbun run seed\n```\n\nFor detailed configuration instructions, see [Configuration Files](#configuration-files) and [Database Scripts](#database-scripts) sections.\n\n### Start Development Server\n\n```bash\n# Start development environment\nbun run dev\n\n# Or use Make command\nmake dev\n```\n\nVisit http://localhost:5173 to view the frontend application\nVisit http://localhost:3000/api/reference to view the backend API\n\n## 💻 Development Guide\n\n### Development Commands\n\n```bash\n# Development environment\nbun run dev              # Start development server\nbun run build            # Build project\nbun run lint             # Code linting\nbun run format           # Code formatting\nbun run typecheck        # Type checking\nbun run test             # Run tests\n\n# Database operations\ncd server\nbun run generate         # Generate database migrations\nbun run migrate          # Execute database migrations\nbun run studio           # Open Drizzle Studio\nbun run seed             # Database seed data\n\n# Database utility scripts\nbun run script/getCryptoKey.ts      # Generate encryption keys\nbun run script/initDB.ts            # Initialize database with users\nbun run script/resetDB.ts           # Reset database completely\nbun run script/migrateStaffList.ts  # Migrate staff from Feishu\n\n# Helpful Bash Command\nrm -rf ./**/turbo ./**/node_modules ./**/output ./**/dist\n```\n\n### Code Standards\n\nThe project uses ESLint + Prettier for code standards management:\n\n- Use TypeScript strict mode\n- Follow React Hooks conventions\n- Components use PascalCase naming\n- Files use kebab-case naming\n- Automatically run lint checks before commits\n\n### Development Workflow\n\n1. **Create feature branch**: `git checkout -b feature/your-feature`\n2. **Develop feature**: Follow code standards for development\n3. **Run tests**: `bun run test` to ensure tests pass\n4. **Code checking**: `bun run lint` to fix code issues\n5. **Commit code**: Use standardized commit messages\n6. **Create PR**: Submit Pull Request for code review\n\n## 🗄️ Database Scripts\n\nThe 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.\n\n### Available Scripts\n\n- **`getCryptoKey.ts`**: Generate secure AES-256 encryption keys for the application\n- **`initDB.ts`**: Initialize database with system users, AI user, and staff members\n- **`resetDB.ts`**: Completely reset database schema and regenerate migrations\n- **`migrateStaffList.ts`**: Fetch and migrate staff data from Feishu platform\n- **`seed.ts`**: Generate realistic seed data for development and testing\n\n### Quick Setup Workflow\n\n```bash\n# 1. Generate encryption key\ncd server \u0026\u0026 bun run script/getCryptoKey.ts\n\n# 2. Initialize database\nbun run script/initDB.ts\n\n# 3. (Optional) Generate test data\nbun run seed\n```\n\nFor detailed information about each script, including usage examples, configuration requirements, and troubleshooting, see the [**Scripts Documentation**](SCRIPTS.md).\n\n## ⚙️ Configuration Files\n\n### Server Configuration (`server/config.*.json`)\n\n```json\n{\n  \"$schema\": \"./config.schema.json\",\n  \"feishu_app_id\": \"your_feishu_app_id\",\n  \"feishu_app_secret\": \"your_feishu_app_secret\",\n  \"aiProfile\": {\n    \"uid\": \"0\",\n    \"name\": \"Tentix AI\",\n    \"nickname\": \"Tentix AI\",\n    \"role\": \"ai\",\n    \"avatar\": \"avatar_url\"\n  },\n  \"department_ids\": [\"department_id\"],\n  \"agents_ids\": [\"agent_id\"],\n  \"admin_ids\": [\"admin_id\"],\n  \"staffs\": [],\n  \"departments\": []\n}\n```\n\n### Environment Variables (`.env.local`)\n\n```bash\n# Database configuration\nDATABASE_URL=postgresql://username:password@localhost:5432/tentix\nENCRYPTION_KEY=\"q1cRtBG7J9YyFlPmeynwlJ1B+5Nu0SOa+hAUtUhh9lk=\"\n\n# MinIO configuration\nMINIO_ACCESS_KEY=your_access_key\nMINIO_SECRET_KEY=your_secret_key\nMINIO_BUCKET=your_bucket_name\nMINIO_ENDPOINT=your_minio_endpoint\n\n# FastGPT configuration\nFASTGPT_API_URL=your_fastgpt_api_url\nFASTGPT_API_KEY=your_fastgpt_api_key\nFASTGPT_API_LIMIT=50\n\n# Other configuration\nNODE_ENV=development\n```\n\n### Configuration File Description\n\n- `config.dev.json`: Development environment configuration\n- `config.prod.json`: Production environment configuration\n- `config.template.json`: Configuration template file\n- `config.schema.json`: Configuration file JSON Schema\n\n## 🚢 Deployment Guide\n\n### Docker Deployment (Recommended)\n\n#### Production Environment Deployment\n\n```bash\n# Deploy using Docker Compose\nmake docker-up\n\n# Or use docker-compose directly\ndocker-compose up -d --build\n```\n\n#### Development Environment Build Testing\n\n```bash\n# Start development environment\nmake docker-dev\n\n# Or use docker-compose\ndocker-compose --profile dev up --build\n```\n\n### Manual Deployment\n\n```bash\n# 1. Build project\nbun run build\n\n# 2. Start production server\nbun run start\n\n# Or use PM2\npm2 start bun --name tentix -- run start\n```\n\n### Deploy to Cloud Server\n\n```bash\n# 1. Build Docker image\nmake build\n\n# 2. Push to image registry\nmake push DOCKER_REGISTRY=your-registry\n\n# 3. Pull and run on server\ndocker pull your-registry/tentix:latest\ndocker run -d -p 3000:3000 your-registry/tentix:latest\n```\n\n### Health Check\n\nAfter deployment, you can check service status through the following endpoints:\n\n- Health check: `GET /health`\n- API documentation: `GET /api/reference`\n- Service status: `GET /api/status`\n\n## 📚 API Documentation\n\n### Access API Documentation\n\nAfter starting the service, visit the following addresses to view API documentation:\n\n- **Scalar UI**: http://localhost:3000/api/reference\n- **OpenAPI JSON**: http://localhost:3000/openapi.json\n\n### Main API Endpoints\n\n```\nGET    /api/health          # Health check\nPOST   /api/auth/login      # User login\nGET    /api/tickets         # Get ticket list\nPOST   /api/tickets         # Create ticket\nGET    /api/tickets/:id     # Get ticket details\nPUT    /api/tickets/:id     # Update ticket\nDELETE /api/tickets/:id     # Delete ticket\n```\n\n### Authentication Method\n\nAPI uses Bearer Token authentication:\n\n```bash\ncurl -H \"Authorization: Bearer your-token\" \\\n     http://localhost:3000/api/tickets\n```\n\n## 🤝 Contributing\n\n### Submit Code\n\n1. Fork the project to your GitHub account\n2. Create feature branch: `git checkout -b feature/amazing-feature`\n3. Commit changes: `git commit -m 'Add amazing feature'`\n4. Push branch: `git push origin feature/amazing-feature`\n5. Create Pull Request\n\n### Commit Message Standards\n\nUse [Conventional Commits](https://www.conventionalcommits.org/) standards:\n\n```\nfeat: add new feature\nfix: fix bug\ndocs: update documentation\nstyle: format code\nrefactor: refactor code\ntest: add tests\nchore: update dependencies\n```\n\n### Code Review\n\nAll code changes need to go through Pull Request review:\n\n- Ensure all tests pass\n- Follow project code standards\n- Add necessary documentation and comments\n- Update related test cases\n\n## 🆘 Support\n\nIf you encounter problems or have questions:\n\n1. Check if there are similar issues in [Issues](../../issues)\n2. Create a new Issue describing your problem\n3. Contact project maintainers\n\n---\n\n**Happy Coding! 🎉**\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabring%2Ftentix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabring%2Ftentix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabring%2Ftentix/lists"}