Git Product home page Git Product logo

ai-adventure-1's Introduction

AI-Adventures

Codebase for text novel game built using AI.

Getting Started

Prerequisites

  • Open AI /chat/completions API
  • OPen AI /images/generations API
  • LokiJS (in memory Database)

Dependencies

Project structure

  • docs - code documentation folder
  • src
    • assets - contains images/fonts/queries and other media
    • backend - contains all "backend" code
      • modules
        • AI.ts - custom self-made library for making request to ChatGPT using official API
        • Database.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 application
    • scripts - scripts attached to corresponding screen
    • styles - all css styles
      • libs
      • pages
      • fonts.css - all font definitions
      • reset.css - reset some browser predefined styles
    • utils - helper functions
    • index.ts - application entry point
    • preload.ts - bridge between backend and client (internal "API")

Running locally

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

ai-adventure-1's People

Contributors

ziarmandhost avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.