The latest AI creation system ChatGPT source code + detailed graphic deployment tutorial/support GPT-4/AI painting/H5 terminal/Prompt knowledge base/mind map generation

1. AI system

How to build and deploy the AI ​​creation ChatGPT system? Write a detailed graphic tutorial here! SparkAi uses Nestjs and Vue3 framework technology to continuously integrate AI capabilities into the AIGC system!

1.1 Program Core Functions

The program already supports ChatGPT3.5/GPT-4 questioning, AI drawing, Midjourney drawing (full custom parameter adjustment), Midjourney drawing with pictures, Dall-E2 drawing, mind map generation, knowledge base (customizable training), AI painting plaza, invitation + agent distribution mode, user daily check-in function, session record preservation, WeChat official account + email + mobile phone number registration and login, and other free version function updates in the future.

1.2 Latest version update log

Version [V2.6.0] update function:

  • Optimize the lock logic of key pool exhaustion (updated on August 26)!
  • Optimize MJ painting connection, optimize CSS, modify some page styles (updated on August 26)!
  • Add the function of signing in to receive free times on the mobile phone, and optimize the logic of the total number of paintings in the background!
  • Added MJ official picture regeneration command function
  • Synchronize the official Vary command Single image contrast enhancement Vary(Strong) | Vary(Subtle)
  • Synchronize the official Zoom command Single picture unlimited zoom Zoom out 2x | Zoom out 1.5x

2. System Demonstration

https://ai.idcyli.com

3. Functional modules

3.1 GPT model question

GPT network question has been supported

3.2 Application Workbench

3.2.1 prompt knowledge base

3.2.2 Support user-defined knowledge base

3.3 Midjourney professional painting

Vincent diagram:

Generate a graph from a graph: 

3.4 Dall-E2 Painting

3.5 Mind map generation​

3.6 AI Painting Plaza

4. Source code system

4.1 Front Demo Site

4.2 SparkAi source code download

4.3 SparkAi System Documentation

5. Detailed construction tutorial

The following tutorial uses Linux Pagoda to build and deploy

5.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.

5.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

6. 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:

6.1 Determine the Node version

Use PM2 to switch Node version ( required )

Switch Node version to: v16.19.1

​​​​​​

6.2 Install pnpm module

6.3 Install Redis

​​​​​​

7. Deploy and run

7.1 Create a new site

Pagoda - Website - Add Site

7.2 Configuring SSL

7.2.1 Use your own ssl certificate and use HTTPS to install access

7.2.2 Let's Encrypt certificate application

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

​​​​​​

7.3 Upload system source code

7.3.1 Upload system source code

delete original file

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

​​​​7.3.2 Configuring 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

7.4 Starting the project

7.4.1 Pagoda open port

Enter the security settings of the pagoda panel, open  port 9520  and port 3306

7.4.2 Installation dependencies

Enter the ssh terminal in the root directory of the website
and use pnpm i to install dependencies

7.4.3 Starting the project

Start the project with pnpm start

7.4.4 Check the startup log

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

​​​​​​

7.4.5 Set reverse proxy

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

8. Test and use the system

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

8.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!

8.2 Accessing the test system

Thanks for watching, tutorial complete!

Guess you like

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