Git Product home page Git Product logo

textcapades's Introduction

#Textcapades

This is a port of the original textcapades story to a format where you can play online, instead of via SMS or Slack.

Installing

$ git clone (git url)
$ cd textcapades
$ npm install
$ npm start

Then open your browser to localhost:3001

Layout

Config

Configuration is in the ./config folder. Everything in default.json is always set. If you want to override any of those settings put them into local.json. For instance, to make the server listen on port 8000 instead your local.json would look like:

{
    "hapi": {
        "port": 8000
    }
}

You should definitely at least change the auth password and crumb key in your own deployment.

Web content

All of the web content is in ./web. The index.js file defines the routes for all assets and pages. The ./web/controllers/ folder is where the handlers for all the web routes are defined. By default, everything in ./web/public is served relative to the / url. Css, js, and images are all assets found in this folder.

The ./web/templates folder is where the jade files for the handlers are defined. For example a handler that specifies reply.view('story') would serve the jade file found at ./web/templates/story.jade

Story API

The routes that power the story is in ./api. These are the routes that will interact with and affect the user session data that the ./web content will then render.

Engine

The actual engine powering the story is in ./engine These are methods that are passed the current user state in order to find out how to appropriately alter it, letting ./api then apply that state to the session.

Story data

The raw story messages are in ./engine/story

Notes

At this early phase, the idea is that ./engine contains all the things that could potentially be swapped out to "run" a new story. The methods exposed via ./engine that are called by ./api is the "story interface" as such.

textcapades's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

one000mph

textcapades's Issues

Figure out rendering of story

Ideally the user object will have a 'next messages' list associated with it. We need to figure out how to take that from template context to website content that feels somewhat like it's being sent message by message instead of just rendering it flatly.

Parse series messages

Currently the jade files have three parts that we care about: p, wait, and validOptions. These need to be parsed out of the jade files so that we can build the series to send to the user, and set validOptions on the user object so we know how to interpret the result of the input validator when it's next called.

Refactor user input validator

Trying to strike a balance between figuring out what a user meant and making them type more clearly, we have copied the legacy input validator into this codebase as a 'please refactor'.

It should accept the user input, and return an object that the engine can use to determine whether or not to pass the validated input to the decision function, or reply with a request for clarification.

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.