Giter Site home page Giter Site logo

outpost18's Introduction

Unofficial Digital Outpost 18

Netlify Status

You can visit the production version here which is auto-deployed from the master branch. There's also a build based on the dev branch which lives here.

Screenshot of gameplay

What is Outpost 18?

Outpost is a micro-cardgame designed by Adam Wilk. The description from the official site:

Humanity has reached the asteroid belt. Warring nations fight for control over an endless cache of ion and ore. Supplies this far deep in space are limited, so each reinforcement must be deployed carefully. Make the wrong choice and you’ll end up lost in the expanse beyond.

In this turn based 18-card strategy game, players build their space station and fleet from dual-purpose supply cards. Each card is a choice deployed as either an upgrade to their station or a ship in their fleet.

Outpost 18 plays in 10-15 minutes and is designed to scratch the dueling strategy game itch. Opt for ore-based tactics to play aggressively, ion-based tactics to flood the field with effects and abilities, or labour-based tactics to overwhelm with card advantage.

Architecture

The frontend of the game is a React app, bundled using Parcel and hosted on Netlify. The backend of the game is serverless Node functions, hosted on Netlify's "functions" service which is a convenience wrapper around AWS Lambda and works much the same way. Real-time communications are handled via a Pusher websocket. All persistence is handled by FaunaDB which is a JSON document store similar to Mongo or DynamoDB.

The server operates as a stateless reducer, loading data from Fauna and saving it back after applying the game logic based on the dispatched action. It's my first time writing so much Functional Programming-ish JS, so that part is probably a bit messy.

The great part about this setup is a lot of the logic can be re-used by both client and server.

There's no auth yet but I think Netlify Identity will probably be a good solution if we go down that route eventually!

Running locally

  1. yarn install
  2. npm i -g netlify-cli
  3. netlify init and login so you'll have access to the environment variables
  4. netlify dev
  5. Browse to http://localhost:8888

Seeding a new database

  1. yarn run db:bootstrap

Environment Variables

Netlify will load the variables locally so the only one you will need on your machine is FAUNADB_SECRET_KEY if you're going to run the db:dump yarn task.

Environment Variable Description
COMMIT_REF Git SHA of the current HEAD, used as a version code on the live site
FAUNADB_SECRET_KEY_DEV dev key for Fauna, set in your local .env
FAUNADB_SECRET_KEY prod key for Fauna, comes from Netlify
PUSHER_APP_ID Pusher App used by the server-side websocket connection
PUSHER_KEY Pusher Key used by websocket client and server
PUSHER_SECRET
PUSHER_CLUSTER
SENTRY_DSN Sentry.io secret key for error reporting
DISCORD_WEBHOOK_URL Webhook for reporting public game results to a discord channel

Credits

outpost18's People

Contributors

chron avatar dependabot[bot] avatar

Stargazers

Wouter van der Gronde avatar Odin Dutton avatar  avatar Niall O'Brien avatar  avatar

Watchers

 avatar James Cloos avatar Sean Barnard avatar Jayesh Mistry 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.