Merge: concurrent_collections: Add implementation of has method
[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 ~~~raw
46         ./listener <host> <port>
47 ~~~
48
49 The arguments `host` and `port` must correspond to what you entered in your
50 GitHub hook settings.
51
52 ### Starting the web server
53
54 The `web` program act as a [nitcorn](http://nitlanguage.org/doc/stdlib/module_nitcorn__nitcorn.html) webserver that display the game results live.
55
56 To run the webserver:
57
58 ~~~raw
59         ./web <host> <port> <root>
60 ~~~
61
62 The arguments `host` and `port` must correspond to what you entered in your
63 GitHub hook settings.
64 The `root` argument is used to specify the path from the domain url to the
65 NitRPG root.
66
67 For example, if NitRPG is installed in `yourdomain.com/nitrpg`:
68
69 ~~~raw
70         ./web localhost 3000 "/nitrpg"
71 ~~~
72
73 Leave it empty if NitRPG is installed at the root of the domain:
74
75 ~~~raw
76         ./web localhost 3000 ""
77 ~~~
78
79 The webserver can then be accessed at `http://yourdomain.com:3000/nitrpg/`.
80
81 ## RoadMap
82
83 NitRPG stills under heavy development.
84 Incomming features contain (but are not limited to):
85
86 * Periodized stats (weekly, monthly, yearly, overall)
87 * Display graphs with stats
88 * More achievements
89 * Shop: exchange Nitcoins against glorifying items
90
91 You can suggest new achievements or ideas in the
92 [NitRPG RoadMap Issue](https://github.com/nitlang/nit/issues/1161).