The latest AI system ChatGPT website program source code + building tutorial/official account/H5 terminal/installation configuration tutorial/complete knowledge base

1 Introduction

The SparkAi system is an Ai intelligent question answering system developed based on the popular ChatGPT abroad. In this issue, the overall test of the source code system is perfect. It can be said that SparkAi is currently the first domestic ChatGPT docking OpenAI software system.

So how to build and deploy AI to create ChatGPT? Write a detailed graphic tutorial here!

The SparkAi program uses Nestjs and Vue3 framework technology to continuously integrate AI capabilities into the AIGC system!

The program already supports ChatGPT4.0, Midjourney painting, Midjourney generating pictures with pictures, Dall-E2 painting, mind map generation, knowledge base, AI painting square, user membership package, user daily check-in function, background management. Support different layout pages for mobile phones and computers to adapt. The program runs perfectly without BUG, ​​exclusive development.

2. Source code system demo

https://ai.idcyli.com

1. System functions

1.1 GPT model question

Support GPT networking questions

1.2 Application Workbench

Prompt knowledge base:

 Workbench:

Support user-defined knowledge base:

 

1.3 Midjourney professional painting

1.4 mind map

2. Source code system

2.1 Front Demo Site

2.2 SparkAi source code download

2.3 SparkAi system documentation

3. Detailed construction tutorial

The following tutorial uses Linux Pagoda to build

3.1 Basic env environment configuration

In the code, we provide the basic environment variable file configuration file env.example. Before using it, remove the suffix and change it to .env file. We only need to configure the following things in the env environment configuration file.

  • Authorization code, ip configuration

  • Mail service configuration

  • The three items of the mysql database are the basic configuration, mysql and authorization are necessary, the project can be started successfully only when the mysql and authorization are configured, and the mail service can be added later.

3.2 env.env file configuration

# 服务器ip (必填项)
SPARK_AI_HOST=
# 授权码 (授权码留空,可启动运行体验系统半小时)
SPARK_AI_KEY=

# mysql
DB_HOST=localhost
DB_PORT=3306
DB_USER=数据库用户名
DB_PASS=数据库密码·
DB_DATABASE=数据库名
DB_LOG=false
DB_SYNC=true

#  mailer 邮件服务
MAILER_HOST=smtp.163.com/smtp.qq.com (选择自己的发信服务器地址,网易邮箱或者qq邮箱)
MAILER_PORT=465
MAILER_USER=发信邮箱
MAILER_PASS=邮箱发信密钥
MAILER_FROM=发信邮箱

# Redis
REDIS_PORT=6379
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=

# mj并发数
CONCURRENCY=3

# jwt token
JWT_SECRET=chat-spark
# jwt token 过期时间
JWT_EXPIRESIN=7d
# 接口文档前缀
SWAGGERPREFIX=/docs
# 自定义端口
PORT=9520

4. Environmental installation

  • Nginx >= 1.19.8

  • MySQL >= 5.7 or MySQL 8.0

  • PHP-7.4

  • PM2 Manager 5.5

  • Redis 7.0.11

  • Node version: >=16.19.1

Detailed tutorial:

​​​​​

4.1 Node version

Use PM2 to switch Node version (required)

Switch Node version to: v16.19.1

​​​​​

4.2 Install pnpm module

​​​​​

4.3 Install Redis

​​​​​

5. Deploy and run

5.1 Create a new site

Pagoda - Website - Add Site

​​​​​

​5.2 Configuring SSL

5.2.1 Use your own ssl certificate

​​​​​

5.2.2 Let's Encrypt certificate application

If you don't have a certificate, use Pagoda's free certificate to apply for Let's Encrypt

​​​​​

​5.3 Upload source code

delete original file

​​​​​

​Upload and unzip the program to the root directory of the website

​​​​​

​5.3.1 Configure the .env file

Double-click the .env.example file to edit directly in the pagoda, or edit it in the terminal vim

After the configuration is complete, delete the file suffix and the file name is .env

​​​​​

​5.4 Start the project

5.4.1 Installation dependencies

Enter the ssh terminal in the root directory of the website

Use pnpm i to install dependencies

​​​​​

5.4.2 Start the project

Start the project with pnpm start

​​​​​

​5.4.3 View startup log

Enter pm2 log to view the detailed log, and see the picture below to indicate success!

​​​​​

5.4.4 Add port

Add port 9520. Pagoda security needs to open this port, otherwise it cannot be accessed

​​​​​

6. Test and use the system

Deployment complete! Now you can access the SparkAi system through the domain name!

6.1 Management background

The default foreground address is the domain name address, and the default background address is: domain name address/sparkai/admin

The default super administrator account is super spark123

At this point we are done installing!

​​​​

​​

Guess you like

Origin blog.csdn.net/2301_77931454/article/details/132288665