Giter Site home page Giter Site logo

netrunner's Introduction

Android: Netrunner in the browser

Hosted at http://www.jinteki.net. Example of gameplay.

screenshot

Card implementation status

Card rules implementation status

Development

Quickstart

(There's a docker section down there!)

Install Leiningen, NodeJS and MongoDB.

This project runs on Java 8. If you're on OSX or Linux, we recommend using jenv to manage your java environment.

You can check your setup by running:

$ lein version
Leiningen 2.9.6 on Java 16.0.1 OpenJDK 64-Bit Server VM

Your exact version numbers below may vary, but we require Java 1.8+.

Populate the database and create indexes using:

$ lein fetch [--no-card-images]
1648 cards imported

$ lein create-indexes
Indexes successfully created.

You can optionally pass --no-card-images if you don't want to download images from NetrunnerDB, as this takes a while. See lein fetch help for further options.

To install frontend dependencies, run:

$ npm ci
added 124 packages, and audited 125 packages in 2s

To compile CSS:

$ npm run css:build
compiled resources/public/css/netrunner.css

Optionally you can say npm run watch:css to watch for changes and automatically recompile.

Compile ClojureScript frontend:

$ npm run cljs:build
[:app] Compiling ...
[:app] Build completed. (238 files, 0 compiled, 0 warnings, 22.18s)

Finally, launch the webserver and the Clojure REPL:

$ lein repl
dev.user=>

and open http://localhost:1042/.

Using Docker

You'll need to install Docker and Docker-Compose. After that, just run $ docker-compose up --build in the project directory (or do the GUI-equivalent of this). If this fails because it "couldn't fetch dependencies", try again, it was just a networking error.

It can take a while. You'll see lots of messages, so just wait until you see something like netrunner-server-1 | nREPL server started on port 44867. After that, you can visit http://localhost:1042/ and the server should be running.

While coding clojure it's important to have a REPL connection going. The server's REPL is configured to always run on port 44867, so you can connect using $ lein repl :connect nrepl://localhost:44867 (or the program of your preference, like your code editor).

Now, let's populate the database and create indexes. First, let's open a terminal inside the server container: $ docker exec -it netrunner-server-1 /bin/bash. Now, inside this new therminal, we'll run these two commands: The --no-card-images is optional, and removing it causes the card images to be downloaded, which can be slower.

 $ lein fetch --no-card-images
    1648 cards imported

 $ lein create-indexes
    Indexes successfully created.

After this, just restart the server by running (restart) in the REPL.

To do testing, you run them inside the container: $ docker exec -it netrunner-server-1 /bin/bash and then $ lein test.

Tests

To run all tests:

$ lein test
Ran 2640 tests containing 44704 assertions.
0 failures, 0 errors.

To run a single test file:

$ lein test game.cards.agendas-test
Ran 216 tests containing 3536 assertions.
0 failures, 0 errors.

Or a single test:

$ lein test :only game.cards.agendas-test/fifteen-minutes
Ran 1 tests containing 29 assertions.
0 failures, 0 errors.

For more information refer to the development guide.

Further reading

License

Jinteki.net is released under the MIT License.

netrunner's People

Contributors

noahtheduke avatar mtgred avatar nealterrell avatar jwarwick avatar joelcfc25 avatar lostgeek avatar danhut avatar saintis avatar francescopellegrini avatar nbkelly avatar presheaf avatar zaroth avatar queueseven avatar strongoose avatar kevkcc avatar cardboardtech avatar erbridge avatar bjornestol avatar dersam avatar domtancredi avatar msbeck avatar merrickbrown avatar jove-m avatar tblackwe avatar dolmant avatar jhonaker avatar dkellner avatar kubik161 avatar osiccha avatar justinliew 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.