
Nine AI.ChatGPT is an advanced artificial intelligence tool built based on ChatGPT technology and specifically designed to understand and generate natural language text. It can imitate the way humans communicate, provide a smooth dialogue interaction experience, and be able to respond based on the conversation context. In addition to conducting daily conversations, Nine AI.ChatGPT also has the ability to perform a variety of text-generation tasks, such as writing emails, video scripts, marketing copywriting, translation and coding, and even writing academic papers.
Necessary environment configuration
In order to run Nine AI.ChatGPT smoothly, you need to ensure that the following environment configurations meet the requirements:
Node.js version must be higher than 16
The pnpm version needs to be higher than 6
MySQL version needs to be at least 5.7
Redis
project directory structure
The project consists of three main components:
chat: User interface code
admin: Management interface code
service: server code
Local Development Guide
In order to unify the development process, the project adopts the following commands:
Use pnpm install to install all dependencies.
Start the project using pnpm dev.
Use pnpm build to package your project.
Start Guide
Install dependencies separately for each part, using the command pnpm i.
Server settings: Enter the service directory, create a.env file, and configure the test database and Redis. After configuration, start the server using pnpm dev. ORM automatically maps the database and automatically creates the required database structure at startup.
Next, start chat and admin terminals respectively, using pnpm dev.
authorization processing
The authorization functions are located in the src/modules/globalConfig/globalConfig.service.ts file. You can remove authorization checking by removing the content of the nineAiCheckAuth function and its call in onModuleInit.
Correspondingly, the checkauth timing task in src/modules/task/task.service.ts should also be removed.
Packaging and deployment
Service: Run pnpm build to package, you only need to keep the seven packaged files, and refer to. env.example to set environment variables.
Client (chat) and management (admin): Packaged and configured in the.env.production file, and the server address needs to be configured as the online backend service address to adapt to separate deployment.
Solve the front-end refresh 404 problem
For front-end projects that use history mode, you may encounter a 404 error when refreshing the page. This requires specific configuration of Nginx to handle routing correctly.
Comments0