Code Monkey home page Code Monkey logo

verde's Introduction

Verde

A reasonable starter kit for building React and Node.js turn-based games.

Development

This is a standard full stack JavaScript monorepo build with `yarn` and organized with lerna. Frontend and backend are found in `client/` and `server/`, respectively.

Start developing:

If you have `nix` and `direnv` set up, just open this directory. Everything will ‘just work’. Otherwise:

  1. Make sure you have `yarn` installed globally and an `eslint` plugin, or a language server protocol plugin that will allow you to use `tsserver`, installed for your editor of choice. VSCode is your go-to option if you’re newer to software development.
  2. Run `yarn install` in the root directory of the entire project to install all dependencies.
  3. Run `yarn start` in the root directory to start up the hot reloading process.

Technologies

Front-end

  • React functional components for templating and structure. Industry standard.
  • CSS-in-JS (JSS): This is my personal preference, but it’s not something we have to use.

Backend

  • Express API with websockets. I think it’s best to use websockets and in-memory data as much as we can, because there isn’t much of a reason to create accounts and persist data yet (IMO).

Ops

  • All-in-one, strongly opinionated ESLint + Prettier linting and fixing. Feel free to convert errors into warnings if something is annoying you.
  • Some sort of deployment infrastructure

Design language

Mondrianesque, de Stijl inspired

verde's People

Contributors

aty1998 avatar denpang avatar dependabot[bot] avatar jakeisnt avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

tommy-mor denpang

verde's Issues

support chess

totally doable with the current game state, though may be annoying to implement the frontend
dependent on #34, as games can only have two players

Enable private game state

Store private game logic that can be seen by the game configuration language on the server side but not by any client.

upgrade backend to es6

it is currently a commonjs module and can likely be upgraded to use - at the least - consistent import and export syntax.

Enable private user state

Currently, the state of each user is broadcast to every single user (or not at all). This is not ideal. Users need to be able to have some private state (for example, their hand in a game of cards), as well as a public state that is visible to everyone.

This requires:

  • A way to individually message users or a way to encrypt data that only one of the users can decrypt
  • A way to separately store public and private user state in the Game engine
  • API modifications to make it easy to work with. Explore existing ideas for this!

Worth considering:

  • More settings for the game API to enable/disable these behaviors

show network error to client when http requests fail

ie: client is loaded but the user doesn't have internet connection or the server isn't started, and the client isn't currently in a room

  • catch the http error rather than letting it silently fail and print to console
  • send the client back to the main page
  • show the client an error telling them that they've been disconnected from the network

update and enhance documentation

to onboard people onto the project and encourage greater participation, documentation has to be enhanced and updated to ensure that people new to javascript, react, whatever they want to work on in this repository is easy to use and well documented

Improve provided hooks

"TODO: combination of useUser and useSocket hook that provides some user data"
Is this worthwhile?

improve logging

switch to using winston from morgan
replace all console logs with calls to winston
hide all logging on frontend in prod, minimal on backend

games should specify min and max number of players

the 'game.js' configuration object should have two optional fields to specify the minimum and maximum number of players for a game. the max number of players is min(moderator declared max, server declared max).

  • the maximum number of players should be presented to the person creating the room while they choose the (optional) number of players
  • when the maximum number of players has been reached, the server should refuse to add any more players to the game. any spectators are stuck as spectators and cannot be made players by anyone.
  • when the minimum number of players is not met, the game cannot be started until there are at least that many users; the 'start game' button should be greyed out with a tooltip or other message on the client side until the minimum number of players constraint has been met.

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.