]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - .github/CONTRIBUTING.md
Improve contributing guide
[github/Chocobozzz/PeerTube.git] / .github / CONTRIBUTING.md
CommitLineData
7a7edb72
C
1# Welcome to the contributing guide for PeerTube
2
63bfad7e 3Interesting in contributing? Awesome!
7a7edb72
C
4
5**Quick Links:**
6
7 * [Give your feedback](#give-your-feedback)
7a7edb72 8 * [Write documentation](#write-documentation)
63bfad7e 9 * [Develop](#develop)
7a7edb72
C
10
11
12## Give your feedback
13
e755a63a
BB
14You don't need to know how to code to start contributing to PeerTube! Other
15contributions are very valuable too, among which: you can test the software and
16report bugs, you can give feedback on potential bugs, features that you are
63bfad7e 17interested in, user interface, design, decentralized architecture...
7a7edb72
C
18
19
63bfad7e 20## Write documentation
7a7edb72 21
63bfad7e 22You can help to write the documentation of the REST API, code, architecture,
d59a8da8
C
23demonstrations.
24
25For the REST API you can see the documentation in [/support/doc/api](/support/doc/api) directory.
26Then, you can just open the `openapi.yaml` file in a special editor like [http://editor.swagger.io/](http://editor.swagger.io/) to easily see and edit the documentation.
27
28Some hints:
29 * Routes are defined in [/server/controllers/](/server/controllers/) directory
30 * Parameters validators are defined in [/server/middlewares/validators](/server/middlewares/validators) directory
31 * Models sent/received by the controllers are defined in [/shared/models](/shared/models) directory
32
7a7edb72 33
63bfad7e 34## Develop
7a7edb72 35
7193ad10 36Don't hesitate to talk about features you want to develop by creating/commenting an issue
e755a63a 37before you start working on them :).
7a7edb72 38
63bfad7e 39### Prerequisites
7a7edb72 40
63bfad7e
C
41First, make sure that you have followed
42[the steps](/support/doc/dependencies.md)
43to install the dependencies.
e755a63a 44
63bfad7e 45Then clone the sources and install node modules:
e755a63a 46
afe81767 47```
c263f3b4 48$ git clone https://github.com/Chocobozzz/PeerTube
63bfad7e
C
49$ cd PeerTube
50$ yarn install --pure-lockfile
51```
e755a63a
BB
52
53Then, create a postgres database and user with the values set in the
54`config/default.yaml` file. For instance, if you do not change the values
55there, the following commands would create a new database called `peertube_dev`
56and a postgres user called `peertube` with password `peertube`:
57
afe81767 58```
63bfad7e
C
59# sudo -u postgres createuser -P peertube
60Enter password for new role: peertube
61# sudo -u postgres createdb -O peertube peertube_dev
e755a63a
BB
62```
63
63bfad7e
C
64In dev mode, administrator username is **root** and password is **test**.
65
e755a63a
BB
66### Server side
67
63bfad7e
C
68You can find a documentation of the server code/architecture [here](/support/doc/development/server/code.md).
69
e755a63a
BB
70To develop on the server-side:
71
afe81767 72```
63bfad7e 73$ npm run dev:server
e755a63a
BB
74```
75
76Then, the server will listen on `localhost:9000`. When server source files
77change, these are automatically recompiled and the server will automatically
19096851 78restart.
e755a63a
BB
79
80### Client side
81
63bfad7e
C
82You can find a documentation of the server code/architecture
83[here](/support/doc/development/client/code.md).
84
85
e755a63a
BB
86To develop on the client side:
87
afe81767 88```
63bfad7e 89$ npm run dev:client
e755a63a
BB
90```
91
92The API will listen on `localhost:9000` and the frontend on `localhost:3000`.
93Client files are automatically compiled on change, and the web browser will
94reload them automatically thanks to hot module replacement.
7a7edb72 95
19096851
C
96### Client and server side
97
98The API will listen on `localhost:9000` and the frontend on `localhost:3000`.
99File changes are automatically recompiled, injected in the web browser (no need to refresh manually)
100and the web server is automatically restarted.
101
102```
103$ npm run dev
104```
105
106### Federation
35a12fee 107
63bfad7e 108This will run 3 nodes:
7a7edb72 109
afe81767 110```
19096851 111$ npm run build
63bfad7e
C
112$ npm run clean:server:test
113$ npm run play
114```
7a7edb72 115
63bfad7e
C
116Then you will get access to the three nodes at `http://localhost:900{1,2,3}`
117with the `root` as username and `test{1,2,3}` for the password.
19096851
C
118
119
120### Unit tests
121
122To run unit tests, you need to build the application first:
123
124```
125$ npm run build
126$ npm test
127```