Coder Social home page Coder Social logo

color-game's Introduction

The Color Game

A color trivia quiz game

Game can be found live here: https://color-game-1d4bf.web.app/

Storybook can be found live here: https://color-game-storybook.web.app/

Under active development

The Color Game is sadly lacking color at the moment. Also, there are only 18 questions. Color and more questions are soon to come!

How to play

Create a game room by giving it a name then share it with friends. Start the game once everyone has joined. Pick the colors that are the answer to the prompt. Players get a point for every player that answers incorrectly so if all players are correct no points are given. For 2 players, 10 points wins the game or for 3-4 players 15 points wins the game.

How it was built

A react app bundled with create-react-app and deployed with firebase. ChakraUI used for components and react-query used for fetching. Visual testing with Storybook and Chromatic. An MVP implmentation as game rules are enforced client side and cheating is possible from a mailicious actor but its just a game for fun :). I believe that cloud functions would be required to have a fully secure implementation with firestore rules but I'd have to think about it more and take a second stab at it.

Happy to discuss and have feedback!

Running locally

With the firebase emulators installed (https://firebase.google.com/docs/rules/emulator-setup):

firebase emulators:start --only firestore

With yarn installed, the code can be bundled with:

yarn
yarn start

With node installed, populate the questions in the local emulator with:

node system/populateQuestions.js

Running storybook locally:

STORYBOOK_MOCK_API=true yarn storybook

Env Variables

  • REACT_APP_MOCK_API or STORYBOOK_MOCK_API: Set to 'true' to use the mock API instead of the firebase API

color-game's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

color-game's Issues

Multi-user race conditions

Users will often have to re-submit answers if someone has submitted close to them. Either need to find a way to handle this nicely with react-query or change up the data model

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.