English | 简体中文
Online Demo: https://chatvisualnovel.com/
Genshin Impact Doujin: https://genshin.chatvisualnovel.com/
Ace Attorney Doujin: https://ace.chatvisualnovel.com/
Join us:
Follow these steps to deploy ChatVisualNovel on Vercel with a serverless MySQL database provided by Planetscale:
- Clone ChatVisualNovel from GitHub.
- Create a Vercel account and connect it to your GitHub account.
- Create a Planetscale account.
- Set up your Planetscale database:
- Log in to your Planetscale account with
pscale auth login
. - Create a password with
pscale password create <DATABASE_NAME> <BRANCH_NAME> <PASSWORD_NAME>
. - Push your database to Planetscale with
npx prisma db push
.
- Log in to your Planetscale account with
- Configure your Vercel environment:
- Set
DATABASE_URL
to your Planetscale database URL. - Generate an encryption key with
node scripts/gen-enc.js
and set it asENC_KEY
.
- Set
With these steps completed, your ChatVisualNovel will be deployed on Vercel with a Planetscale serverless MySQL database.
- Clone the ChatVisualNovel repo from GitHub.
- Dependencies on Planetscale services still exist temporarily. Please register as mentioned in the previous section and configure
DATABASE_URL
in the.env
file. - Run
npm install
. - Generate an encryption key using
node scripts/gen-enc.js
and configure it in the.env
file in the formatENC_KEY=***
. (Note: You can copy the.env
file from env.template) - You can now use the application by running
npm run dev
.
- When an item is marked with (i18n). Either the key or value needs to be locale mapped in i18n configs.
{
"genres": string[], //(Required)(i18n) Genres, used in Prompt.
"player": { //(Optional) Player characters whose name will be generated by ChatGPT. Used only when there is no isPlayer: true in characters.
"images": {
[key: string]: string //(Required) Each key is a mood of the character. Can have any number of moods but there must be one named neutral. All possible moods of the first character will be used in Prompt for mood selection of all characters. Value is the URL to the image of corresponding mood.
},
"imageSettings": {
[key: string]: string //(Optional) CSS override to this character's image when displayed. Take highest priority.
}
},
"playerGender": string, //(Optional)(i18n) Gender of player, used in Prompt when there is no isPlayer: true in characters.
"girls": [{ //(Optional) Girl characters whose names will be generated by ChatGPT. Used only when there is no isPlayer: false in characters.
"images": {
[key: string]: string //(Required) Each key is a mood of the character. Can have any number of moods but there must be one named neutral. All possible moods of the first character will be used in Prompt for mood selection of all characters. Value is the URL to the image of corresponding mood.
},
"imageSettings": {
[key: string]: string //(Optional) CSS override to this character's image when displayed. Take highest priority.
}
}],
"characters": { //(Optional) Named characters.
[key: string]: { //(Required)(i18n) Character name, used in Prompt.
"isPlayer": boolean, //(Optional) When set to true, will be the player character. Please only set one character as isPlayer: true.
"images": {
[key: string]: string //(Required) Each key is a mood of the character. Can have any number of moods but there must be one named neutral. All possible moods of the first character will be used in Prompt for mood selection of all characters. Value is the URL to the image of corresponding mood.
},
"imageSettings": {
[key: string]: string //(Optional) CSS override to this character's image when displayed. Take highest priority.
}
}
},
"places": { //(Required) Location (Background).
[key: string]: { //(Required)(i18n) Each key is a location. There must be at least one location. All possible locations will be used in Prompt for location selection.
"image": string, //(Required) URL to the image of the location.
"bgm": string //(Optional) Background music of this location.
},
"imageSettings": { //(Optional) Global Character image settings (CSS).
[key: string]: string
},
"tts": { //(Optional) Online Text-to-speach service integration. Only basic GET is supported for now.
[key: string]: { //(Required) i18n locale, can set a default.
"method": string, //(Optional) GET or POST(not supported yet) or HuggingFaceSpace, defaults to GET.
"url": string, //(Required) API URL.
"params": { //(Optional) URL query param map. Required when method is GET.
"speaker": string, //(Required) Query param name for speaker.
"text": string, //(Required) Query param name for text(dialogue).
"additionalParams": string //(Optional) Additional parameters as a string.
},
"ws": { //(Optional) When method is HuggingFaceSpace, this is required.
url: string; //(Required) Hugging Face Space websocket URL.
data: string[]; //(Optional) Data payload schema. Each key name will be replaced by the corresponding value.
},
"voices": {
male: string[]; //(Optional) Collection of allowed male voice names.
female: string[]; //(Optional) Collection of allowed female voice names.
}
}
}
}
This code is distributed under the MIT license. See LICENSE in this directory.