Git Product home page Git Product logo

windmill-client's Introduction

windmill-client

The Windmill is an interactive alternative to pen and paper for creating and playing puzzles based on the puzzle language of the 2016 video game The Witness.

This project exists for fans of the game who do not want to take out the IV drip just yet. The puzzle logic is original and exciting, and while reimplementing it is not original, it is nonetheless an exciting programming task.

The current status of The Windmill is that it is running at https://windmill.thefifthmatt.com.

Technical overview

Concretely, this is a codebase which includes an AngularJS app for editing and playing puzzles, as well as server interaction. Angular is responsible for everything in the UI except for the puzzle grid itself, which is rendered, played, and validated by plain old JS code. The grid is shown using SVG and rendered using the templating language Closure Templates, also known as Soy. All code uses Closure Library for utilities and is compiled for release using the Closure Compiler.

Development is currently only supported on Mac OS X and Linux. Development is active as of March 2016, and technical debt is mainly due to the build system and all of the existing code.

Additional functionality, for listing puzzles, publishing puzzles, and playing published puzzles, requires a server to implement an API and serve static files compiled by windmill-client.

Getting it running locally quickly

These commands will get it up and running on your system ASAP, given required tools (NPM, Java, Python, Bash).

How to build

Currently, a pile of Bash scripts. This should move to a build system. This may be in the npm ecosystem, or even npm itself. Alternatively, Bazel. Whatever has the best incremental compilation and custom scripting support.

Java 8 JDK and Python 2.7 are required for the client and server.

Required binaries and libraries

For running the client, either compiled or half-compiled, some dependencies must be present.

Almost are all available from npm:

  • npm install
  • sudo npm install -g html-minifier

There is additional external content which is already included in the repository. See NOTICE for more information.

Bash scripts

Intermediate (transpiled) targets:

  • ./proto.sh takes the contents of grid.proto and outputs JS to dist/proto.js containing the proto definitions.
  • ./soy.sh takes Soy in windmill.soy and constants in constants.js and grid.proto and compiles the templates. It notifies using notify-send on failures and success.
    • ./soy.sh static also regenerates SVG files in static/.

The three compile modes:

  • ./compile.sh all compiles HTML files and Angular templates. main.html becomes build.html, src/*.tmpl.html becomes static/*.tmpl.html. All JavaScript gets compiled to static/code.js (requires soy.sh and proto.sh output). This makes it possible to access build.html.
  • ./compile.sh only compiles HTML
  • ./compile.sh local outputs dist/runlocal.js and dependencies, which makes it possible to access main.html for live-editing uncompiled code.

It is recommended to use these commands in the background with entr for live-editing uncompiled code:

  • ls src/windmill.soy src/constants.js src/grid.proto | entr ./soy.sh
  • ls src/grid.proto | entr ./proto.sh

How to run

Most local development of the client involves running

  • python -m SimpleHTTPServer

From the repository root. Then, access

Finally, there is a third way to run, which is with a full-fledged API server. This requires a PostgreSQL database and a whole separate tech stack, coming soon as a sister repository on Github.

Contributing and testing

If you are interested in contributing in any form, go ahead and fork the repository and play around, file an issue or comment on one, or otherwise contact me! I will be responsive as work/home allows.

JavaScript tends to follow the Google JavaScript style guide.

Note that because there are many missing features, many parts of the code base are not very stable. There are several planned refactorings. The overall structure is stable.

Generally, released features should not be broken at HEAD. In other words, please avoid regressions. Unit tests are definitely planned, mainly for grid validation code. Meanwhile, the policy is to thoroughly manually test, both uncompiled and compiled.

windmill-client's People

Contributors

gracenotes avatar ianh avatar

Watchers

 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.