-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v3, no longer reliant on userbase, self-hostable
This is now end-to-end encrypted based on open web standards, connects to a PostgreSQL (docker-compose provided for local setups, Render and DigitalOcean options for easier "self-hosting"), and had the frontend code completely migrated to TypeScript. Existing version will be available for another month at v2.budgetzen.net to allow data export, to be imported into v3 at app.budgetzen.net.
- Loading branch information
1 parent
7e88a60
commit 9076585
Showing
58 changed files
with
5,389 additions
and
4,432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
spec: | ||
This comment has been minimized.
Sorry, something went wrong. |
||
name: budgetzen | ||
envs: | ||
- key: BASE_URL | ||
scope: RUN_AND_BUILD_TIME | ||
value: ${app.PUBLIC_URL} | ||
services: | ||
- name: app | ||
dockerfile_path: Dockerfile | ||
git: | ||
branch: main | ||
http_port: 8000 | ||
instance_count: 1 | ||
instance_size_slug: basic-xs | ||
routes: | ||
- path: / | ||
health_check: | ||
http_path: / | ||
source_dir: / | ||
envs: | ||
- key: POSTGRESQL_HOST | ||
scope: RUN_AND_BUILD_TIME | ||
value: ${db.HOSTNAME} | ||
- key: POSTGRESQL_USER | ||
scope: RUN_AND_BUILD_TIME | ||
value: ${db.USERNAME} | ||
- key: POSTGRESQL_PASSWORD | ||
scope: RUN_AND_BUILD_TIME | ||
value: ${db.PASSWORD} | ||
- key: POSTGRESQL_DBNAME | ||
scope: RUN_AND_BUILD_TIME | ||
value: ${db.DATABASE} | ||
- key: POSTGRESQL_PORT | ||
scope: RUN_AND_BUILD_TIME | ||
value: ${db.PORT} | ||
- key: POSTGRESQL_CAFILE | ||
scope: RUN_AND_BUILD_TIME | ||
value: "" | ||
databases: | ||
- name: db | ||
engine: PG | ||
production: false | ||
version: "15" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.29.1 | ||
1.30.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
USERBASE_APP_ID=get-from-userbase.com | ||
PORT=8000 | ||
BASE_URL="http://localhost:8000" | ||
|
||
POSTGRESQL_HOST="localhost" | ||
POSTGRESQL_USER="postgres" | ||
POSTGRESQL_PASSWORD="fake" | ||
POSTGRESQL_DBNAME="budgetzen" | ||
POSTGRESQL_PORT=5432 | ||
POSTGRESQL_CAFILE="" | ||
|
||
POSTMARK_SERVER_API_TOKEN="fake" | ||
|
||
STRIPE_API_KEY="fake" | ||
|
||
PAYPAL_CLIENT_ID="fake" | ||
PAYPAL_CLIENT_SECRET="fake" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: "Cron: Check subscriptions" | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# At 04:06 every day. | ||
- cron: '6 4 * * *' | ||
|
||
jobs: | ||
cron-cleanup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.30.3 | ||
- env: | ||
POSTGRESQL_HOST: ${{ secrets.POSTGRESQL_HOST }} | ||
POSTGRESQL_USER: ${{ secrets.POSTGRESQL_USER }} | ||
POSTGRESQL_PASSWORD: ${{ secrets.POSTGRESQL_PASSWORD }} | ||
POSTGRESQL_DBNAME: ${{ secrets.POSTGRESQL_DBNAME }} | ||
POSTGRESQL_PORT: ${{ secrets.POSTGRESQL_PORT }} | ||
POSTGRESQL_CAFILE: ${{ secrets.POSTGRESQL_CAFILE }} | ||
STRIPE_API_KEY: ${{ secrets.STRIPE_API_KEY }} | ||
PAYPAL_CLIENT_ID: ${{ secrets.PAYPAL_CLIENT_ID }} | ||
PAYPAL_CLIENT_SECRET: ${{ secrets.PAYPAL_CLIENT_SECRET }} | ||
run: | | ||
make crons/check-subscriptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: "Cron: Cleanup" | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# At 03:05 every day. | ||
- cron: '5 3 * * *' | ||
|
||
jobs: | ||
cron-cleanup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.30.3 | ||
- env: | ||
POSTGRESQL_HOST: ${{ secrets.POSTGRESQL_HOST }} | ||
POSTGRESQL_USER: ${{ secrets.POSTGRESQL_USER }} | ||
POSTGRESQL_PASSWORD: ${{ secrets.POSTGRESQL_PASSWORD }} | ||
POSTGRESQL_DBNAME: ${{ secrets.POSTGRESQL_DBNAME }} | ||
POSTGRESQL_PORT: ${{ secrets.POSTGRESQL_PORT }} | ||
POSTGRESQL_CAFILE: ${{ secrets.POSTGRESQL_CAFILE }} | ||
run: | | ||
make crons/cleanup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
localhost | ||
|
||
reverse_proxy * localhost:8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM denoland/deno:1.30.3 | ||
|
||
EXPOSE 8000 | ||
|
||
WORKDIR /app | ||
|
||
# Prefer not to run as root. | ||
USER deno | ||
|
||
# These steps will be re-run upon each file change in your working directory: | ||
ADD . /app | ||
|
||
# Compile the main app so that it doesn't need to be compiled each startup/entry. | ||
RUN deno cache --reload main.ts | ||
|
||
CMD ["make", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { html } from '/lib/utils.ts'; | ||
|
||
export default function verificationCodeModal() { | ||
return html` | ||
<template id="verification-code-modal"> | ||
<swal-title> | ||
Verification Code | ||
</swal-title> | ||
<swal-html> | ||
<span class="text"> | ||
You have received an email with a verification code. Type it here. | ||
</span> | ||
<form id="verification-code-form"> | ||
<fieldset class="input-wrapper"> | ||
<label for="verification-code-input">Code</label> | ||
<input | ||
id="verification-code-input" | ||
type="text" | ||
/> | ||
</fieldset> | ||
</form> | ||
</swal-html> | ||
<swal-button type="confirm"> | ||
Verify | ||
</swal-button> | ||
<swal-button type="cancel"> | ||
Cancel | ||
</swal-button> | ||
</template> | ||
`; | ||
} |
Oops, something went wrong.
I was pushed to do this earlier than I wanted mostly because of smallbets/userbase#427