You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**refactor** - code change that neither fixes a bug nor adds a feature
31
32
32
-
**All PRs must include a commit message with the changes description!**
33
+
**All PRs must include a commit message with the changes description!**
33
34
34
35
For the initial start, fork the project and use git clone command to download the repository to your computer. A standard procedure for working on an issue would be to:
35
36
36
37
1.`git pull`, before creating a new branch, pull the changes from upstream. Your master needs to be up to date.
38
+
37
39
```
38
40
$ git pull
39
41
```
42
+
40
43
2. Create new branch from `master` like: `doc-548-submit-a-pull-request-section-to-contribution-guide`<br/>
44
+
41
45
```
42
46
$ git checkout -b [name_of_your_new_branch]
43
47
```
48
+
44
49
3. Work - commit - repeat ( be sure to be in your branch )
45
50
46
-
4. Push changes to GitHub
51
+
4. Before you push your changes, make sure your code follows the `PSR12` coding standards , which is the standard Appwrite follows currently. You can easily do this by running the formatter.
52
+
53
+
```bash
54
+
./vendor/bin/phpcbf <your file path>
55
+
```
56
+
57
+
Now, go a step further by running the linter by the following command to manually fix the issues the formatter wasn't able to fix.
58
+
59
+
```bash
60
+
./vendor/bin/phpcs <your file path>
61
+
```
62
+
63
+
This will give you a list of errors for you to rectify , if there is an instance you need more information on the errors being displayed you can pass in additional command line arguments. More list of available arguments can be found [here](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage). A very useful command line argument is `--report=diff`. This will give you the expected changes by the linter for easy fixing of formatting issues.
64
+
65
+
```bash
66
+
./vendor/bin/phpcs --report=diff <your file path>
67
+
```
68
+
69
+
5. Push changes to GitHub
70
+
47
71
```
48
72
$ git push origin [name_of_your_new_branch]
49
73
```
50
74
51
-
5. Submit your changes for review
52
-
If you go to your repository on GitHub, you'll see a `Compare & pull request` button. Click on that button.
53
-
6. Start a Pull Request
54
-
Now submit the pull request and click on `Create pull request`.
55
-
7. Get a code review approval/reject
56
-
8. After approval, merge your PR
57
-
9. GitHub will automatically delete the branch after the merge is done. (they can still be restored).
75
+
6. Submit your changes for review
76
+
If you go to your repository on GitHub, you'll see a `Compare & pull request` button. Click on that button.
77
+
7. Start a Pull Request
78
+
Now submit the pull request and click on `Create pull request`.
79
+
8. Get a code review approval/reject
80
+
9. After approval, merge your PR
81
+
10. GitHub will automatically delete the branch after the merge is done. (they can still be restored).
58
82
59
83
## Setup From Source
60
84
@@ -90,18 +114,20 @@ Appwrite uses an internal micro-framework called Litespeed.js to build simple UI
90
114
91
115
After finishing the installation process, you can start writing and editing code.
92
116
93
-
94
117
#### Advanced Topics
118
+
95
119
We love to create issues that are good for beginners and label them as `good first issue` or `hacktoberfest`, but some more advanced topics might require extra knowledge. Below is a list of links you can use to learn more about some of the more advance topics that will help you master the Appwrite codebase.
96
120
97
121
##### Tools and Libs
122
+
98
123
-[Docker](https://www.docker.com/get-started)
99
-
-[PHP FIG](https://www.php-fig.org/) - [PSR-1](https://www.php-fig.org/psr/psr-1/) and [PSR-4](https://www.php-fig.org/psr/psr-4/)
-[TCP vs UDP](https://www.guru99.com/tcp-vs-udp-understanding-the-difference.html#:~:text=TCP%20is%20a%20connection%2Doriented,speed%20of%20UDP%20is%20faster&text=TCP%20does%20error%20checking%20and,but%20it%20discards%20erroneous%20packets.)
@@ -110,10 +136,12 @@ Learn more at our [Technology Stack](#technology-stack) section.
110
136
-[gRPC](https://en.wikipedia.org/wiki/GRPC)
111
137
112
138
##### Architecture
139
+
113
140
-[Microservices vs Monolithic](https://www.mulesoft.com/resources/api/microservices-vs-monolithic#:~:text=Microservices%20architecture%20vs%20monolithic%20architecture&text=A%20monolithic%20application%20is%20built%20as%20a%20single%20unit.&text=To%20make%20any%20alterations%20to,formally%20with%20business%2Doriented%20APIs.)
@@ -124,8 +152,8 @@ Learn more at our [Technology Stack](#technology-stack) section.
124
152
Appwrite's current structure is a combination of both [Monolithic](https://en.wikipedia.org/wiki/Monolithic_application) and [Microservice](https://en.wikipedia.org/wiki/Microservices) architectures, but our final goal, as we grow, is to be using only microservices.
125
153
126
154
---
127
-

128
-
---
155
+
156
+
## 
129
157
130
158
### File Structure
131
159
@@ -204,15 +232,15 @@ Appwrite stack is combined from a variety of open-source technologies and tools.
204
232
205
233
### Other Technologies
206
234
207
-
* Redis - for managing cache and in-memory data (currently, we do not use Redis for persistent data)
208
-
* MariaDB - for database storage and queries
209
-
* InfluxDB - for managing stats and time-series based data
210
-
* Statsd - for sending data over UDP protocol (using Telegraf)
211
-
* ClamAV - for validating and scanning storage files
212
-
* Imagemagick - for manipulating and managing image media files.
213
-
* Webp - for better compression of images on supporting clients
214
-
* SMTP - for sending email messages and alerts
215
-
* Resque - for managing data queues and scheduled tasks over a Redis server
235
+
- Redis - for managing cache and in-memory data (currently, we do not use Redis for persistent data)
236
+
- MariaDB - for database storage and queries
237
+
- InfluxDB - for managing stats and time-series based data
238
+
- Statsd - for sending data over UDP protocol (using Telegraf)
239
+
- ClamAV - for validating and scanning storage files
240
+
- Imagemagick - for manipulating and managing image media files.
241
+
- Webp - for better compression of images on supporting clients
242
+
- SMTP - for sending email messages and alerts
243
+
- Resque - for managing data queues and scheduled tasks over a Redis server
Appwrite is following the [PHP-FIG standards](https://www.php-fig.org/). Currently, we are using both PSR-0 and PSR-4 for coding standards and autoloading standards. Soon we will also review the project for support with PSR-12 (Extended Coding Style).
255
+
Appwrite is following the [PHP-FIG standards](https://www.php-fig.org/). Currently, we are using both PSR-0 and PSR-12 for coding standards and autoloading standards.
228
256
229
257
We use prettier for our JS coding standards and auto-formatting our code.
230
258
@@ -236,14 +264,14 @@ We wish Appwrite will be as easy to set up and in a single, localhost, and easy
236
264
237
265
When contributing code, please take into account the following considerations:
238
266
239
-
* Response Time
240
-
* Throughput
241
-
* Requests per Seconds
242
-
* Network Usage
243
-
* Memory Usage
244
-
* Browser Rendering
245
-
* Background Jobs
246
-
* Task Execution Time
267
+
- Response Time
268
+
- Throughput
269
+
- Requests per Seconds
270
+
- Network Usage
271
+
- Memory Usage
272
+
- Browser Rendering
273
+
- Background Jobs
274
+
- Task Execution Time
247
275
248
276
## Security & Privacy
249
277
@@ -280,6 +308,7 @@ Before running the command, make sure you have proper write permissions to the A
The Runtimes for all supported cloud functions (multicore builds) can be found at the [open-runtimes/open-runtimes](https://github.com/open-runtimes/open-runtimes) repository.
@@ -299,11 +328,11 @@ For generating a new console SDK follow the next steps:
299
328
300
329
Things to remember when releasing SDKs
301
330
302
-
* Update the Changelogs in **docs/sdks** (right now only Dart and Flutter are using these)
303
-
* Update **GETTING_STARTED.md** in **docs/sdks** for each SDKs if any changes in the related APIs in there
304
-
* Update SDK versions as required on **app/config/platforms.php**
305
-
* Generate SDKs using the command `php app/cli.php sdks` and follow the instructions
306
-
* Release new tags on GitHub repository for each SDKs
331
+
- Update the Changelogs in **docs/sdks** (right now only Dart and Flutter are using these)
332
+
- Update **GETTING_STARTED.md** in **docs/sdks** for each SDKs if any changes in the related APIs in there
333
+
- Update SDK versions as required on **app/config/platforms.php**
334
+
- Generate SDKs using the command `php app/cli.php sdks` and follow the instructions
335
+
- Release new tags on GitHub repository for each SDKs
307
336
308
337
## Debug
309
338
@@ -315,13 +344,13 @@ First, you need to create an init file. Duplicate **dev/yasd_init.php.stub** fil
315
344
316
345
```json
317
346
{
318
-
"name": "Listen for Xdebug",
319
-
"type": "php",
320
-
"request": "launch",
321
-
"port": 9005,
322
-
"pathMappings": {
323
-
"/usr/src/code": "${workspaceRoot}"
324
-
},
347
+
"name": "Listen for Xdebug",
348
+
"type": "php",
349
+
"request": "launch",
350
+
"port": 9005,
351
+
"pathMappings": {
352
+
"/usr/src/code": "${workspaceRoot}"
353
+
}
325
354
}
326
355
```
327
356
@@ -354,65 +383,62 @@ To run end-2-end tests for a spcific service use:
354
383
```bash
355
384
docker-compose exec appwrite test /usr/src/code/tests/e2e/Services/[ServiceName]
356
385
```
386
+
357
387
## Benchmarking
358
388
359
389
You can use WRK Docker image to benchmark the server performance. Benchmarking is extremely useful when you want to compare how the server behaves before and after a change has been applied. Replace [APPWRITE_HOSTNAME_OR_IP] with your Appwrite server hostname or IP. Note that localhost is not accessible from inside the WRK container.
360
390
361
391
```
362
-
Options:
363
-
-c, --connections <N> Connections to keep open
364
-
-d, --duration <T> Duration of test
365
-
-t, --threads <N> Number of threads to use
366
-
367
-
-s, --script <S> Load Lua script file
368
-
-H, --header <H> Add header to request
369
-
--latency Print latency statistics
370
-
--timeout <T> Socket/request timeout
371
-
-v, --version Print version details
372
-
```
392
+
Options:
393
+
-c, --connections <N> Connections to keep open
394
+
-d, --duration <T> Duration of test
395
+
-t, --threads <N> Number of threads to use
396
+
397
+
-s, --script <S> Load Lua script file
398
+
-H, --header <H> Add header to request
399
+
--latency Print latency statistics
400
+
--timeout <T> Socket/request timeout
401
+
-v, --version Print version details
402
+
```
373
403
374
404
```bash
375
405
docker run --rm skandyla/wrk -t3 -c100 -d30 https://[APPWRITE_HOSTNAME_OR_IP]
376
406
```
377
407
378
-
## Code Maintenance
408
+
## Code Maintenance
379
409
380
410
We use some automation tools to help us keep a healthy codebase.
381
411
382
-
Improve PHP execution time by using [fully-qualified function calls](https://veewee.github.io/blog/optimizing-php-performance-by-fq-function-calls/):
From time to time, our team will add tutorials that will help contributors find their way in the Appwrite source code. Below is a list of currently available tutorials:
407
433
408
-
*[Adding Support for a New OAuth2 Provider](./docs/tutorials/add-oauth2-provider.md)
Searching for Appwrite on Discord, GitHub, or StackOverflow and helping someone else who needs help. You can also help by teaching others how to contribute to Appwrite's repo!
0 commit comments