Coder Social home page Coder Social logo

pari-magique's Introduction

Pari-magique

Rails website for users to predict the result of soccer games.

Background

In 2008, I had an idea to create a website to bet with my friends on soccer games during major competitions (Euro and World Cup). I was using static html pages. Users were sending me their guesses by email and I modified the html pages manually. It was a lot of work. In 2012, more friends joined and I didn't want to do everything manually so I created a more dynamic PHP website (using Yii framework) where people could log in and enter their guesses. In 2017, I decided to switch to Rails because it is my favorite Web framework and I decided to use Github and Heroku.

Deployment

Production environment

The goal is to use Github with Heroku for easy deployment.

After creating an account and setting up Heroku, execute the following commands to deploy Pari-magique.

$ heroku create
$ git push heroku master
$ heroku addons:create rediscloud:30
$ heroku run rake db:migrate
$ heroku open
$ heroku logs

The version of bundler of this project should match with the version of bundler used on Heroku.

Access database on Heroku

You need to install postgres on your machine

$ sudo apt-get update
$ sudo apt-get install postgresql
$ heroku pg:backups:capture
$ heroku pg:psql
=> select * from users;
\q

Development environment

Redis

Please follow the tutorial from Digital Ocean to install Redis otherwise the chat will failed.

Start the server

Execute the following commands to start the server:

$ bundle install --without production
$ rake db:migrate
$ rake db:seed
$ rails s

Tests

How to run the test suite. TODO

Database

For a better understanding of the relations between the models, please have a look to the diagram db/DatabaseSchema.png.

To create the database run: rake db:migrate

To insert data run: rake db:seed

Roles and authorization

Site wide

admin
  • manage all
  • promote members to manager or admin
manager
  • manage games (set result)
member
  • see factions
  • create a faction (and becomes coach)
  • send a request to join a faction (and becomes player)
unregistered user
  • create an account (and becomes member)

Faction wide

A faction is a group of users. For example, you can be a member of a faction with your friends and a member of a second faction with your coworkers.

coach
  • add tournaments to a faction
  • accept requets from players to join the faction
  • promote players to coach
player
  • see tournaments
  • see games
  • create guesses
  • see rankings

pari-magique's People

Contributors

aklein-dex avatar

Watchers

 avatar  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.