Skip to content

Commit

Permalink
First commi[t
Browse files Browse the repository at this point in the history
  • Loading branch information
leomorpho committed Sep 3, 2024
0 parents commit b0268fa
Show file tree
Hide file tree
Showing 658 changed files with 319,779 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .air.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
root = "."
testdata_dir = "testdata"
tmp_dir = "tmp"

[build]
exclude_dir = [
"assets",
"tmp",
"vendor",
"testdata",
"e2e_tests",
"node_modules",
"javascript",
"pwabuilder-ios-wrapper",
"pwabuilder-android-wrapper",
"schemaspy-output",
"scripts",

]
args_bin = []
bin = "./tmp/main"
cmd = "templ generate && go build -o ./tmp/main cmd/web/main.go"
delay = 1000
exclude_file = []
exclude_regex = [".*_templ.go", "_test.go"]
exclude_unchanged = false
follow_symlink = false
full_bin = ""
include_dir = []
include_ext = ["go", "tpl", "tmpl", "templ", "html"]
include_file = []
kill_delay = "0s"
log = "build-errors.log"
poll = false
poll_interval = 0
post_cmd = []
pre_cmd = []
rerun = false
rerun_delay = 500
send_interrupt = false
stop_on_error = false

[color]
app = ""
build = "yellow"
main = "magenta"
runner = "green"
watcher = "cyan"

[log]
main_only = false
time = false

[misc]
clean_on_exit = false

[screen]
clear_on_rebuild = false
keep_scroll = true
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.env*
.air*
.gitignore
*.md
Dockerfile
LICENSE
Makefile
tailwind*
*.csv
.github
.kamal
schemaspy*
testdata
tmp
57 changes: 57 additions & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#######################################
# NOTE:
# For production, copy-paste this file to `./.env` and make sure not to commit it
# to your git repo...except if you want to one day regret it lol.
#
# If some env vars are not being pushed by kamal to the containers, it is likely because they
# have not been added to the "secret" section of the kamal config (./config/deploy-cherie.yaml)
#######################################

KAMAL_REGISTRY_USERNAME=username
KAMAL_REGISTRY_PASSWORD=ghp_123

# TODO: set the below env var
PAGODA_APP_ENCRYPTIONKEY=abcdefghijklmnopqrstuv

# PAGODA_DATABASE_HOSTNAME=
# PAGODA_DATABASE_USER=
# PAGODA_DATABASE_PASSWORD=
PAGODA_DATABASE_DATABASE=postgres

PAGODA_MAIL_RESENDAPIKEY=re_123

PAGODA_STORAGE_S3ACCESSKEY=123
PAGODA_STORAGE_S3SECRETKEY=123

# For DB Backups
S3_ACCESS_KEY_ID=123
S3_SECRET_ACCESS_KEY=123

# Sentry
PAGODA_APP_SENTRYDSN=FILL

# VAPID
PAGODA_APP_VAPIDPUBLICKEY=
PAGODA_APP_VAPIDPRIVATEKEY=pZ-FILL

# Stripe
PAGODA_APP_PUBLICSTRIPEKEY=pk_
PAGODA_APP_PRIVATESTRIPEKEY=sk_
PAGODA_APP_STRIPEWEBHOOKSECRET=whsec_

# E3Kit
PAGODA_APP_E3KIT_APPID=2132131
PAGODA_APP_E3KIT_APPKEYID=12313
PAGODA_APP_E3KIT_APPKEY=123143

# Generate an AEAD keyset using the AES256-GCM key template:
# $ tinkey create-keyset --key-template AES256_GCM --out-format JSON --out tmp/keyset.json
# Convert the Keyset to Base64
# $ cat tmp/keyset.json | jq -c .key | base64
PAGODA_APP_APPENCRYPTIONKEY="FILL"

# Only for dev for docker-compose
HOST_CACHE_PORT=6379
HOST_DB_PORT=5432
HOST_MAILPIT_HTTP_PORT=8025
HOST_MAILPIT_SMTP_PORT=1025
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
static/* -diff
*_templ.go -diff
86 changes: 86 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Test

# TODO: Earthly (which I've used before) can be used to create platform-agnostic CI tests,
# in case we want to move away from Github seamlessly.
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
backend_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.22.2

- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-go-
- name: Start containers
run: |
docker compose up -d
sleep 3
- name: Test
run: go test -p 1 ./...

# TODO: these were never set up in the CI
# e2e_tests:
# needs: backend_tests
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3

# - name: Set up Node.js
# uses: actions/setup-node@v3
# with:
# node-version: 18

# - name: Set up Go
# uses: actions/setup-go@v3
# with:
# go-version: 1.21.3

# - name: Check if app is running
# run: |
# until curl --output /dev/null --silent --head --fail http://localhost:8000; do
# echo "Waiting for app to be up..."
# sleep 5
# done

# - name: Install dependencies
# run: npm ci
# working-directory: ./e2e_tests

# - name: Install Playwright Browsers
# run: npx playwright install --with-deps
# working-directory: ./e2e_tests

# - name: Seed Database
# run: make seed

# - name: Run app
# run: make watch

# - name: Run Playwright tests
# run: npx playwright test
# working-directory: ./e2e_tests

# - uses: actions/upload-artifact@v3
# if: always()
# with:
# name: playwright-report
# path: playwright-report/
# retention-days: 1
Loading

0 comments on commit b0268fa

Please sign in to comment.