0a451f7876770120bef620ab79b67893c4795cda
[nit.git] / contrib / nitrpg / README.md
1 # Welcome to NitRPG!
2
3 NitRPG is a Role Playing Game that takes place on [GitHub](https://github.com/).
4
5 In NitRPG, GitHub users are represented by players that battle on repo for
6 nitcoins and glory.
7
8 ## Features
9
10 * Auto-update with GitHub hooks
11 * Display repo statistics
12 * Display players statsitics
13 * Repo actions are rewarded by nitcoins
14 * Players can unlock achievements
15
16 ## How to install
17
18 From the `nit` root:
19
20 ~~~bash
21 > cd contrib/nitrpg
22 > make
23 ~~~
24
25 ### Configuring the GitHub hook
26
27 NitRPG needs you to add a new GitHub hook on your repo to keep the game
28 `listener` up-to-date automatically.
29
30 Hook configuration:
31
32 * **Payload URL**: URL and port to the listener (ex: `http://yourdomain.com:8080`)
33 * **Content type**: `application/json`
34 * **Wich events**: `Send me everything`
35
36 Be sure to set the hook as `Active` in the GitHub admin panel.
37
38 ### Starting the listener
39
40 The `listener` program is used to listen to GitHub hooks and update game data.
41 It should alwaysd be up if you want your game to be kept up-to-date.
42
43 To run the listener:
44
45         ./listener <host> <port>
46
47 The arguments `host` and `port` must correspond to what you entered in your
48 GitHub hook settings.
49
50 ### Starting the web server
51
52 The `web` program act as a [nitcorn](http://nitlanguage.org/doc/stdlib/module_nitcorn__nitcorn.html) webserver that display the game results live.
53
54 To run the webserver:
55
56         ./web <host> <port> <root>
57
58 The arguments `host` and `port` must correspond to what you entered in your
59 GitHub hook settings.
60 The `root` argument is used to specify the path from the domain url to the
61 NitRPG root.
62
63 For example, if NitRPG is installed in `yourdomain.com/nitrpg`:
64
65         ./web localhost 3000 "/nitrpg"
66
67 Leave it empty if NitRPG is installed at the root of the domain:
68
69         ./web localhost 3000 ""
70
71 The webserver can then be accessed at `http://yourdomain.com:3000/nitrpg/`.
72
73 ## RoadMap
74
75 NitRPG stills under heavy development.
76 Incomming features contain (but are not limited to):
77
78 * Add a homepage that lists openened games
79 * Periodized stats (weekly, monthly, yearly, overall)
80 * Display graphs with stats
81 * More achievements
82 * Shop: exchange Nitcoins against glorifying items
83
84 You can suggest new achievements or ideas in the
85 [NitRPG RoadMap Issue](https://github.com/privat/nit/issues/1161).