Coder Social home page Coder Social logo

cardjizzerapp / cardjizzerbackend Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 2.42 MB

:zap: Backend for the CardJizzerApp

Home Page: https://cardjizzerapp.github.io/Docs

License: GNU General Public License v3.0

Dockerfile 0.20% Python 1.50% JavaScript 94.23% Shell 0.79% Go 3.29%
game-rules humanity card cards-against-humanity game card-game app javascript

cardjizzerbackend's Introduction

CardJizzers' Backend

The backend of CardJizzer.

Build Status Gitter Maintainability


What is this?

What Is Cards Against Humanity?

The game, with its game rules was invented by a Kickstarter campaign in the year 2011. It is a turn based card game for the most parts played in real life.

Every player receives a specific amount of white cards that are used to fill placeholders provided in the black card.

At the end of the round, when all players played a card, the card czar (in our case the CardJizzer) picks the most hilarious card.

On the start of a new round every player gets the amount of whitecards he laid in the last round.

Although there are already clones out there we want to build a open source forgery for the App- and PlayStore.

We decided to bring fresh air in this game and created this hybrid app which allows anybody to play this beautiful game anywhere and anytime.

What is this repo about?

This repository is the backend part of the app. It will be deployed to our servers after your push.

Please follow this link for the frontend part of this project.

Motivation

Why are we doing this? We want the future of games to be more transparent and modifiable for any developer.

Installation

Environment variables

The following code segment shows the environment variables used. (See .env for a possible updated version).

NODE_ENV=dev

REDIS_HOST=localhost
REDIS_PORT=6379

MONGO_DATABASE=cardjizzer-testdb
MONGO_HOST=localhost
MONGO_PORT=27017

SENTRYDSN=INSERTSENTRYDSNHERE

PORT=8100

GOOGLE_OAUTH_CLIENT_ID=CLIENT_ID

Docker

We recommend running this service as a docker container.

Quickstart with Docker-compose

We need two databases: Redis and Mongo. One is used for temporary caching and the other for permanent storage such as users with their GoogleId and email.

Consequently we suggest using Docker-compose containing all those services named above.

version: '3'

services:
    backend:
        image: docker.pkg.github.com/cardjizzerapp/cardjizzerbackend/server
        ports:
            - "8100:8100"
        environment:
            - MONGO_HOST=mongo
            - REDIS_HOST=redis
            - PORT=8100
        links:
            - redis
            - mongo
    redis:
        image: redis
    mongo:
        image: mongo

Contributing

Getting a better understanding of the project will be essential before even thinking about contributing. Thus the commands you need in order to setup your environment.

$ npm i && npm run setup
# Checking if build succeeds
$ npm run test
# Building
$ npm run build
# Development
$ npm run dev

Resolved your issue? Contribute!

Please refer to each project's style and contribution guidelines for submitting patches and additions. In general, we follow the "fork-and-pull" Git workflow.

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

cardjizzerbackend's People

Contributors

ijustdev avatar

Stargazers

 avatar

Watchers

 avatar

cardjizzerbackend's Issues

Fix tests

The current build is failing due to not working tests. The code has been changed to work with callbacks. Not all commands are working with this.

Unit tests for Google oauth

Current situation

There is a command (setUsername) used for creating a link between the websocket and the user that wants to log in. Since this command is now deprecated and will be replaced by the login command there is now a need for using real Google oauth data in unit tests (or maybe not. Have a look at solutions).

Solutions

Multiple solutions are conceivable.

  • Create and insert a dummy user after the database was created and use those credentials.
  • Use real Google oauth data

Unfortunately Google doesn't provide such dummy data. The only possible way of implementing the second approach would be real users that need to provide a refresh token every 60 minutes.

Conclusion

Considering only the effort put in the first approach it would be the better one.
BUT
This will result in a lower test coverage and the oauth mechanism can then be broken easily.

Re-implement ssl

The current server (http-package) does not support SSL encryption. We should introduce the https package.

Files to change: app.js

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.