Skip to content

Commit 6ec37df

Browse files
committed
dx: improve getting started
1 parent 64da7a6 commit 6ec37df

File tree

4 files changed

+35
-23
lines changed

4 files changed

+35
-23
lines changed

.env.example

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,44 @@
11
PORT=4000
2-
LOG_LEVEL=debug
3-
4-
LOGIN_CODE_TTL=600
5-
LOGIN_CODE_SALT="algora-login-code"
6-
LOCAL_STORE_TTL=3600
7-
LOCAL_STORE_SALT="algora-local-store"
2+
LOG_LEVEL=info
83

94
DATABASE_URL="postgresql://postgres:postgres@localhost:15432/algora_dev"
5+
TEST_DATABASE_URL="postgresql://postgres:postgres@localhost:15432/algora_test"
106

117
GITHUB_CLIENT_ID=""
128
GITHUB_CLIENT_SECRET=""
139
GITHUB_APP_HANDLE=""
1410
GITHUB_APP_ID=""
1511
GITHUB_WEBHOOK_SECRET=""
1612
GITHUB_PRIVATE_KEY=""
17-
GITHUB_PAT=""
18-
GITHUB_PAT_ENABLED=false
1913
GITHUB_OAUTH_STATE_TTL=600
2014
GITHUB_OAUTH_STATE_SALT="github-oauth-state"
2115

16+
STRIPE_PUBLISHABLE_KEY=""
17+
STRIPE_SECRET_KEY=""
18+
STRIPE_WEBHOOK_SECRET=""
19+
2220
AWS_ENDPOINT_URL_S3=""
2321
AWS_REGION=""
2422
AWS_ACCESS_KEY_ID=""
2523
AWS_SECRET_ACCESS_KEY=""
2624
BUCKET_NAME=""
2725

28-
STRIPE_PUBLISHABLE_KEY=""
29-
STRIPE_SECRET_KEY=""
30-
STRIPE_WEBHOOK_SECRET=""
31-
32-
STRIPE_TEST_CUSTOMER_ID=""
33-
STRIPE_TEST_ACCOUNT_ID=""
34-
35-
CLOUDFLARE_TUNNEL=""
36-
3726
APPSIGNAL_OTP_APP="algora"
3827
APPSIGNAL_PUSH_API_KEY="00000000-0000-0000-0000-000000000000"
3928
APPSIGNAL_APP_NAME="AlgoraConsole"
4029
APPSIGNAL_APP_ENV="dev"
4130

4231
SENDGRID_API_KEY="SG.x.x"
4332

44-
DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/1234567890/x"
45-
46-
PLAUSIBLE_EMBED_URL=""
33+
LOGIN_CODE_TTL=600
34+
LOGIN_CODE_SALT="algora-login-code"
35+
LOCAL_STORE_TTL=3600
36+
LOCAL_STORE_SALT="algora-local-store"
4737

38+
CLOUDFLARE_TUNNEL=""
4839
ASSETS_URL=""
4940
INGEST_URL=""
5041
INGEST_STATIC_URL=""
51-
INGEST_TOKEN=""
42+
INGEST_TOKEN=""
43+
PLAUSIBLE_EMBED_URL=""
44+
DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/1234567890/x"

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,24 @@ We also recommend using [direnv](https://github.com/direnv/direnv) to load envir
166166

167167
Some features of Algora rely on external services. If you're not planning on using these features, feel free to skip setting them up.
168168

169+
#### Tunnel
170+
171+
To receive webhooks from GitHub or Stripe on your local machine, you'll need a way to expose your local server to the internet. The easiest way to get up and running is to use a tool like [ngrok](https://ngrok.com/) or [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/).
172+
173+
Here's how you can setup a re-usable named tunnel on your own domain name so you have a consistent URL:
174+
175+
```sh
176+
cloudflared tunnel login
177+
cloudflared tunnel create local
178+
cloudflared tunnel route dns local http://local.yourdomain.com
179+
```
180+
181+
Once you have setup your tunnel, add it to your `.env` file and run `direnv allow .env`.
182+
183+
```env
184+
CLOUDFLARE_TUNNEL="local"
185+
```
186+
169187
#### GitHub
170188

171189
[Register new GitHub app](https://github.com/settings/apps/new) and set
@@ -182,7 +200,7 @@ Some features of Algora rely on external services. If you're not planning on usi
182200
- Read account email address
183201
- Events: issues, pull requests, issue comment, pull request review, pull request review comment
184202

185-
Once you have obtained your client ID and secret, add them to your `.env` file and run `direnv allow .env`
203+
Once you have obtained your client ID and secret, add them to your `.env` file.
186204

187205
```env
188206
GITHUB_CLIENT_ID=""

lib/algora/application.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ defmodule Algora.Application do
3232
children =
3333
case Application.get_env(:algora, :cloudflare_tunnel) do
3434
nil -> children
35+
"" -> children
3536
tunnel -> children ++ [{Algora.Tunnel, tunnel}]
3637
end
3738

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ defmodule Algora.MixProject do
129129
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"],
130130
"test.reset": ["cmd MIX_ENV=test mix do ecto.drop, ecto.create, ecto.migrate"],
131131
"assets.setup": ["tailwind.install --if-missing"],
132-
"assets.build": ["tailwind algora", "cmd --cd assets pnpm install"],
132+
"assets.build": ["cmd --cd assets pnpm install", "tailwind algora"],
133133
"assets.deploy": [
134134
"tailwind algora --minify",
135135
"cmd --cd assets node build.js --deploy",

0 commit comments

Comments
 (0)