Try to improve documentations/readme
[oweals/peertube.git] / .github / CONTRIBUTING.md
1 # Welcome to the contributing guide for PeerTube
2
3 Interesting in contributing? Awesome!
4
5 **Quick Links:**
6
7   * [Give your feedback](#give-your-feedback)
8   * [Write documentation](#write-documentation)
9   * [Develop](#develop)
10
11
12 ## Give your feedback
13
14 You don't need to know how to code to start contributing to PeerTube! Other
15 contributions are very valuable too, among which: you can test the software and
16 report bugs, you can give feedback on potential bugs, features that you are
17 interested in, user interface, design, decentralized architecture...
18
19
20 ## Write documentation
21
22 You can help to write the documentation of the REST API, code, architecture,
23 demonstrations...
24
25 ## Develop
26
27 Don't hesitate to talk about features you want to develop by creating an issue
28 before you start working on them :).
29
30 ### Prerequisites
31
32 First, make sure that you have followed 
33 [the steps](/support/doc/dependencies.md) 
34 to install the dependencies.
35
36 Then clone the sources and install node modules:
37
38 ```bash
39 $ git clone -b master https://github.com/Chocobozzz/PeerTube
40 $ cd PeerTube
41 $ yarn install --pure-lockfile
42 ```
43
44 Then, create a postgres database and user with the values set in the
45 `config/default.yaml` file. For instance, if you do not change the values
46 there, the following commands would create a new database called `peertube_dev`
47 and a postgres user called `peertube` with password `peertube`:
48
49 ```bash
50 # sudo -u postgres createuser -P peertube
51 Enter password for new role: peertube
52 # sudo -u postgres createdb -O peertube peertube_dev
53 ```
54
55 In dev mode, administrator username is **root** and password is **test**.
56
57 ### Server side
58
59 You can find a documentation of the server code/architecture [here](/support/doc/development/server/code.md).
60
61 To develop on the server-side:
62
63 ```bash
64 $ npm run dev:server
65 ```
66
67 Then, the server will listen on `localhost:9000`. When server source files
68 change, these are automatically recompiled and the server will automatically
69 restart. Server is in `TEST` mode so it will run requests between instances more quickly.
70
71 ### Client side
72
73 You can find a documentation of the server code/architecture
74 [here](/support/doc/development/client/code.md).
75
76
77 To develop on the client side:
78
79 ```bash
80 $ npm run dev:client
81 ```
82
83 The API will listen on `localhost:9000` and the frontend on `localhost:3000`.
84 Client files are automatically compiled on change, and the web browser will
85 reload them automatically thanks to hot module replacement.
86
87 ### Test federation
88
89 This will run 3 nodes:
90
91 ```bash
92 $ npm run clean:server:test
93 $ npm run play
94 ```
95
96 Then you will get access to the three nodes at `http://localhost:900{1,2,3}`
97 with the `root` as username and `test{1,2,3}` for the password.