Giter VIP home page Giter VIP logo

magejosh / mythweaver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bitmischief/mythweaver

0.0 0.0 0.0 123.79 MB

MythWeaver is a web application that helps Dungeon Masters' by auto-generating helpful and engaging content on the fly during your roleplaying sessions.

Home Page: https://mythweaver.co

License: GNU General Public License v3.0

Shell 0.02% JavaScript 0.75% TypeScript 51.56% CSS 0.61% HTML 0.20% Vue 46.86%

mythweaver's Introduction

MythWeaver

MythWeaver is a web application that helps Dungeon Masters' by auto-generating helpful and engaging content on the fly during your roleplaying sessions.

Check out the application at app.mythweaver.co

codecov

DISCLAIMER

This repo is in the early stages of development and may be subject to drastic changes until we make it to v1.0.

Getting Started

Prerequisites

  1. Docker
  2. Docker Compose
  3. (optional) NodeJS
  4. (optional) Yarn

Local Development

We are working toward providing better support for development Dockerfiles that will allow you to develop locally without installing any dependencies other than Docker and Docker Compose. While you can certainly develop locally as is, in order to get the debugger working for the API, it can be beneficial to have NodeJS running locally. If you do this, just make sure to run yarn install in the API directory to install the dependencies. Then run yarn run dev to start the API server.

Database migrations

We are using Prisma as our ORM. To run migrations, you will need to install the Prisma CLI. You can do this by running yarn global add prisma in the API directory. To add a new migration, modify the schema.prisma file (see Prisma docs for more info) and run prisma migrate dev --name <migration-name> in the API directory. This will create a new migration file in the prisma/migrations directory. You can then run prisma migrate dev to apply the migration to the database.

After creating new database migrations, you will need to have Prisma generate the new/updated types for the API. You can do this by running prisma generate in the API directory.

Set UI environment variables

  • Use example.env as a template to create a .env file in the root of the UI directory

Set API environment variables

Local Development

  • Use example.env as a template to create a .env file in the root of the API directory
  • DATABASE_URL
    • In most cases this can stay unchanged, as the default value is set to the Postgres container that is created by Docker Compose
  • CORS_ALLOWED_ORIGINS
    • For local development this can remain the default ["http://localhost:3000"]. For production deployments, this would be the URL of your frontend UI.
  • JWT_SECRET_KEY
    • This should be a unique alphanumeric string that is used to sign the JWT tokens that are created by the API. This can be any string you want, but it should be kept secret.
    • We typically recommend using openssl to generate the keys like so: openssl rand -base64 32
  • JWT_REFRESH_SECRET_KEY
    • Same as JWT_SECRET_KEY above, but used to sign the refresh tokens that are created by the API. DO NOT USE THE SAME KEY FOR BOTH JWT_SECRET_KEY AND JWT_REFRESH_SECRET_KEY.
  • GOOGLE_CLIENT_ID
    • You will either need to create a Google OAuth2 client ID and secret, or use our "test" Google OAuth Client. You can do this by following the instructions here.
    • The MythWeaver test Google OAuth Client ID is 676157131038-nt4ldb3psc6rnt6onhbd397trr6ut09c.apps.googleusercontent.com
  • GOOGLE_CLIENT_SECRET
    • You will either need to create a Google OAuth2 client ID and secret, or use our "test" Google OAuth Client. You can do this by following the instructions here.
    • The MythWeaver test Google OAuth Client Secret is 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
  • OPENAI_API_KEY
    • You will need to create an OpenAI API key. You can do this by following the instructions here.
  • STABILITY_API_KEY
    • You will need to create a Stability.ai API key. You can do this by following the instructions here.

Production deployments

Using the concepts above, we can set the environment variables for the API in a production environment. We recommend these environment variables for production systems be stored in a secrets manager of your choosing.

Run the application

  • Make sure you've followed the steps above to ensure you have the proper environment variables set, and dependencies installed.
  • Run docker-compose up --build to build the containers for the UI and API, and stand up our Postgres database as well.
  • At first, your database will be entirely empty. Run cd api && prisma migrate dev to apply the migrations to the database. (Make sure you have installed the Prisma CLI first)
  • You can also run prisma db seed to seed the database with some initial data. (Make sure you have run prisma migrate up first). You may also need to install ts-node by running: yarn global add ts-node.
  • The UI will be available at localhost:3000
  • The API will be available at localhost:8000
  • The database will be available at localhost:5432

mythweaver's People

Contributors

dependabot[bot] avatar zurfluha avatar jgwin avatar unknownstranger avatar code-factor 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.