|
1 |
| -# Contributing to Phase |
| 1 | +# Contributing to Phase 🫡 |
2 | 2 |
|
3 |
| -Thanks for taking the time to contribute! ❤️ |
| 3 | +Thanks for taking the time to contribute! |
4 | 4 |
|
5 | 5 | We welcome any contributions to Phase, big or small.
|
6 | 6 |
|
7 |
| -## Community |
| 7 | +## Minimum System Requirements 🦕 |
8 | 8 |
|
9 |
| -It's the early days of Phase and we're working hard to build an awesome, inclusive community. |
| 9 | +To run Phase locally, ensure your system meets the following minimum requirements: |
| 10 | +- **System** !=🥔 |
| 11 | +- **RAM:** >= 8GB (preferably 16GB) |
10 | 12 |
|
11 |
| -## Bugs and issues |
12 | 13 |
|
13 |
| -Bug reports help make Phase a better experience for everyone. When you report a bug, a template will be created automatically containing information we'd like to know. |
| 14 | +## Prerequisites 🛠️ |
| 15 | + |
| 16 | +Before setting up your development environment, ensure you have the following prerequisites installed 🐳: |
| 17 | +- Docker |
| 18 | +- Docker Compose |
| 19 | +- Git |
| 20 | + |
| 21 | +## Bugs and Issues 🧶 |
| 22 | + |
| 23 | +Bug reports help make Phase a better experience for everyone. When you report a bug, a template will be created automatically containing the information we'd like to know. |
14 | 24 |
|
15 | 25 | Before raising a new issue, please search existing ones to make sure you're not creating a duplicate.
|
16 | 26 |
|
17 |
| -**If the issue is related to security, please email us directly at [email protected]** |
| 27 | +**If the issue is related to security, please email us directly at `[email protected]`** |
18 | 28 |
|
19 |
| -For more information see: [SECURITY.md](/SECURITY.md) |
| 29 | +For more information, see: [SECURITY.md](/SECURITY.md) |
20 | 30 |
|
21 |
| -## Deciding what to work on |
| 31 | +## Deciding What to Work On 🏋️ |
22 | 32 |
|
23 |
| -You can start by browsing through our list of issues or adding your own that improves on the platform experience. Once you've decided on an issue, leave a comment and wait to get approved; this helps avoid multiple people working on the same issue. |
| 33 | +You can start by browsing through our list of issues or adding your own that suggests a new feature or improves the platform experience. Once you've decided on an issue, leave a comment and wait to get approved; this helps avoid multiple people working on the same issue. |
24 | 34 |
|
25 | 35 | If you're ever in doubt about whether or not a proposed feature aligns with Phase as a whole, feel free to raise an issue about it and we'll get back to you promptly.
|
26 | 36 |
|
27 |
| -## Writing and submitting code |
| 37 | +## Writing and Submitting Code 🏗️ |
28 | 38 |
|
29 |
| -Anyone can contribute code to Phase. To get started, check out the local development guide, make your changes, and submit a pull request to the main repository. When committing code, please try and use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). |
| 39 | +Anyone can contribute code to Phase. To get started, check out the local development guide, make your changes, and submit a pull request to the main repository. When committing code, please try to use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). |
30 | 40 |
|
31 |
| -## Licensing |
| 41 | +## Licensing ⚖️ |
32 | 42 |
|
33 |
| -Most of Phase's code is under the MIT license, though some paid feature restrictions are covered by a proprietary license. |
| 43 | +Most of Phase's code is under the MIT license, though some paid feature restrictions may be covered by a proprietary license. |
34 | 44 |
|
35 |
| -Any third party components incorporated into our code are licensed under the original license provided by the applicable component owner. |
| 45 | +Any third-party components incorporated into our code are licensed under the original license provided by the applicable component owner. |
36 | 46 |
|
37 |
| -## Setup local development environment |
38 |
| -### Dev server with hot reload |
39 |
| -1. Create a **.env.dev** file using |
40 |
| - ``` |
| 47 | +## Get Phase running locally 👩💻 |
| 48 | + |
| 49 | +### Dev Server with Hot Reload |
| 50 | + |
| 51 | +1. Create a **.env.dev** file using: |
| 52 | + ```bash |
41 | 53 | cp .env.dev.example .env.dev
|
42 | 54 | ```
|
43 |
| -2. Add atleast one OAuth provider in your **.env.dev**. Follow the [docs](https://docs.phase.dev/self-hosting/configuration/envars) |
44 |
| -3. Verify that **dev-docker-compose.yml** file is populated with the correct environment variables by running |
| 55 | + |
| 56 | +2. Add at least one of the available OAuth provider credentials in your **.env.dev**. Follow the [Phase Docs](https://docs.phase.dev/self-hosting/configuration/envars#single-sign-on-sso). |
| 57 | + |
| 58 | +3. Install the dependencies: |
| 59 | + ```bash |
| 60 | + docker compose -f dev-docker-compose.yml build |
| 61 | + ``` |
| 62 | + |
| 63 | +4. Start the containers in dev mode using: |
| 64 | + ```bash |
| 65 | + docker compose -f dev-docker-compose.yml up |
| 66 | + ``` |
| 67 | + |
| 68 | +5. The Console is now running at <https://localhost> with [HMR (Hot Module Replacement)](https://webpack.js.org/concepts/hot-module-replacement) and a self-signed certificate. |
| 69 | + |
| 70 | + >**Note:** Your browser might warn you about the self-signed certificate. You can safely accept the certificate and proceed. |
| 71 | + |
| 72 | +### Set Up a Staging Environment |
| 73 | + |
| 74 | +1. Create a **.env** file using: |
| 75 | + ```bash |
| 76 | + cp .env.example .env |
45 | 77 | ```
|
46 |
| - docker compose -f dev-docker-compose.yml --env-file .env.dev config |
| 78 | + |
| 79 | +2. Add at least one of the available OAuth provider credentials in your **.env**. Follow the [Phase Docs](https://docs.phase.dev/self-hosting/configuration/envars#single-sign-on-sso). |
| 80 | + |
| 81 | +3. Build the image locally with: |
| 82 | + ```bash |
| 83 | + docker compose -f staging-docker-compose.yml build |
47 | 84 | ```
|
48 |
| -4. Start the containers using |
| 85 | + |
| 86 | +4. Start the Phase Console with: |
| 87 | + ```bash |
| 88 | + docker compose -f staging-docker-compose.yml up -d |
49 | 89 | ```
|
50 |
| - docker-compose -f dev-docker-compose.yml --env-file .env.dev up |
| 90 | + |
| 91 | +5. The Console is now running at <https://localhost> with a self-signed certificate. |
| 92 | + |
| 93 | + >**Note:** Your browser might warn you about the self-signed certificate. You can safely accept the certificate and proceed. |
| 94 | + |
| 95 | +### Common Problems / Issues 🗿 |
| 96 | + |
| 97 | +1. **Certificate Errors** |
| 98 | + - Caused by a self-signed certificate. |
| 99 | + - Solved by adding a valid certificate to the NGINX config in `nginx/default.conf`. |
| 100 | + - Use a reverse proxy that will add a valid certificate like `cloudflared` or `tailscale serve`. |
| 101 | + |
| 102 | +2. **NGINX 503 / Timeouts / Hot Reloading Not Working** |
| 103 | + - Caused by a slow system. |
| 104 | + - Please check how much leftover RAM you have after starting all the containers. |
| 105 | + - Additionally, for slower systems facing timeout issues, try increasing NGINX proxy timeouts by adding the following code snippet: |
| 106 | + |
| 107 | + ```nginx |
| 108 | + server { |
| 109 | + listen 80; |
| 110 | + listen 443 ssl http2; |
| 111 | +
|
| 112 | + ssl_certificate /etc/nginx/ssl/nginx.crt; |
| 113 | + ssl_certificate_key /etc/nginx/ssl/nginx.key; |
| 114 | + |
| 115 | + # Increase the timeout to 3 minutes |
| 116 | + proxy_connect_timeout 180s; |
| 117 | + proxy_send_timeout 180s; |
| 118 | + proxy_read_timeout 180s; |
| 119 | + } |
| 120 | +
|
| 121 | + # Rest of your config |
| 122 | + # ... |
51 | 123 | ```
|
52 |
| -5. The Console is now running at <https://localhost> with [HMR(Hot Module Replacement)](https://webpack.js.org/concepts/hot-module-replacement) and a self-signed certificate. |
53 |
| - >**Note : Your browser might warn you about the self-signed certificate. You can safely accept the certificate and proceed. |
54 | 124 |
|
55 |
| -### Staging env to test production builds |
| 125 | +3. **Having Issues Signing In (Redirected Back to the Phase Console Log-In Screen Even After OAuth Authentication)** |
| 126 | + - Please make sure the OAuth credentials and the callback URL are correct and as described in the docs: [Phase Docs](https://docs.phase.dev/self-hosting/configuration/envars#single-sign-on-sso) |
| 127 | + |
| 128 | +Need help? |
| 129 | +[Join our Slack](https://slack.phase.dev) |
56 | 130 |
|
57 |
| -1. Set up a `.env` file with `cp .env.example` and add atleast one OAuth provider. View the [docs](https://docs.phase.dev/self-hosting/configuration/envars) for more info. |
58 |
| -2. Build the image locally with `docker-compose -f staging-docker-compose.yml build` |
59 |
| -3. Bring docker compose up with `docker-compose -f staging-docker-compose.yml up` |
60 |
| -4. The Console is now running at `https://localhost`. |
| 131 | +Thank you for contributing to Phase! |
0 commit comments