Codebase for text novel game built using AI.
- Open AI
/chat/completions
API - OPen AI
/images/generations
API - LokiJS (in memory Database)
docs
- code documentation foldersrc
assets
- contains images/fonts/queries and other mediabackend
- contains all "backend" codemodules
AI.ts
- custom self-made library for making request to ChatGPT using official APIDatabase.ts
- custom self-made abstraction on top of lokijs db
auth.ts
- handlers of the auth events (register/login)story.ts
- handlers of the story events (new-story/continue-story/reset-story)
screens
- contains all html files, representing screens of applicationscripts
- scripts attached to corresponding screenstyles
- all css styleslibs
pages
fonts.css
- all font definitionsreset.css
- reset some browser predefined styles
utils
- helper functionsindex.ts
- application entry pointpreload.ts
- bridge between backend and client (internal "API")
Download project, enter root folder in terminal and run commands:
npm install
Then create .env
file in the root folder. Put here 2 values:
CHAT_GPT_API_KEY="OPEN_AI_API_KEY"
JWT_SECRET="YOUR_JWT_SECRET_VALUE"
To run app locally:
npm run start
To run build app locally to .exe file:
npm run package