Skip to content

Commit

Permalink
Migrate to Deno in the backend, vanilla JS in the frontend.
Browse files Browse the repository at this point in the history
This also tweaks the UI and UX. All data is still compatible, and there's some new functionality, like clicking on the month to navigate to any month.
  • Loading branch information
BrunoBernardino committed Jul 20, 2022
1 parent b1097c7 commit 56148b1
Show file tree
Hide file tree
Showing 104 changed files with 6,286 additions and 30,619 deletions.
13 changes: 0 additions & 13 deletions .babelrc

This file was deleted.

1 change: 1 addition & 0 deletions .dvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.22.0
5 changes: 1 addition & 4 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
NODE_PATH=/
AWS_ACCESS_KEY_ID=accesskey
AWS_SECRET_ACCESS_KEY=sshhh
NEXT_PUBLIC_USERBASE_APP_ID=get-from-userbase.com
USERBASE_APP_ID=get-from-userbase.com
10 changes: 0 additions & 10 deletions .eslintignore

This file was deleted.

99 changes: 0 additions & 99 deletions .eslintrc.js

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/ci.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Run Tests

on: [push]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: denoland/setup-deno@v1
with:
deno-version: v1.22.0
- run: |
make test
19 changes: 0 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1 @@
.DS_Store
node_modules
*.log
*.zip
.env
.next
.env.build
.serverless
.serverless_nextjs
**/public/precache.*.*.js
**/public/sw.js
**/public/workbox-*.js
**/public/worker-*.js
**/public/fallback-*.js
**/public/precache.*.*.js.map
**/public/sw.js.map
**/public/workbox-*.js.map
**/public/worker-*.js.map
**/public/fallback-*.js
*.tsbuildinfo
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

15 changes: 0 additions & 15 deletions .prettierignore

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc.js

This file was deleted.

4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"deno.enable": true,
"deno.lint": true
}
42 changes: 8 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,13 @@
.PHONY: install
install:
-cp -n .env.sample .env
npm install --legacy-peer-deps

.PHONY: start
start:
npm run dev
deno run --watch --allow-net --allow-read --allow-env=PORT,USERBASE_APP_ID main.ts

.PHONY: format
format:
deno fmt

.PHONY: test
test:
make lint
npm run test

.PHONY: test/update
test/update:
make lint
npm run test -- -u

.PHONY: test/pretty
test/pretty:
npm run pretty/test

.PHONY: test/ci
test/ci:
make test/pretty
make test

.PHONY: lint
lint:
npm run lint

.PHONY: pretty
pretty:
npm run pretty

.PHONY: deploy
deploy:
serverless
deno fmt --check
deno lint
deno test --allow-net --allow-read --allow-env=PORT,USERBASE_APP_ID --check=all
36 changes: 26 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,39 @@

[![](https://github.com/BrunoBernardino/budgetzen-web/workflows/Run%20Tests/badge.svg)](https://github.com/BrunoBernardino/budgetzen-web/actions?workflow=Run+Tests)

This is the web app for the [Budget Zen app](https://budgetzen.net), built with Next.js and deployed to AWS with Serverless.
This is the web app for the [Budget Zen app](https://budgetzen.net), built with [Deno](https://deno.land) and deployed to [Deno Deploy](https://deno.com/deploy).

This is v2, which is [end-to-end encrypted via userbase](https://userbase.com), and works via web on any device (it's a PWA - Progressive Web App).

It's not compatible with Budget Zen v1 (not end-to-end encrypted), which you can still get locally from [this commit](https://github.com/BrunoBernardino/budgetzen-web/tree/397d625469b7dfd8d1968c847b32e607ee7c8ee9). You can still export and import the data as the JSON format is the same (unencrypted).

## Requirements

This was tested with `deno@1.22.0`, though it's possible older versions might work.

There are no other dependencies. **Deno**!

## Development

```bash
make install # installs dependencies
make start # starts the app
make pretty # prettifies the code
make test # runs linting and tests
make deploy # deploys to app.budgetzen.net (requires `serverless` to be installed globally)
```sh
$ make start
$ make format
$ make test
```

## TODOs
## Structure

This is vanilla JS, web standards, no frameworks. If you'd like to see/use [the Next.js version deployed to AWS via Serverless, check this commit](https://github.com/BrunoBernardino/budgetzen-web/tree/b1097c710ba89abf9aed044a7d7444e91d04a6a7).

- Backend routes are defined at `routes.ts`.
- Static files are defined at `public/`.
- Pages are defined at `pages/`.

## Deployment

- Deno Deploy: Just push to the `main` branch. Any other branch will create a preview deployment.

## TODOs:

- [ ] Improve UI/UX in general
- [ ] Improve dark/light mode
- [ ] Enable true offline mode (securely cache data, allow read-only)
- https://github.com/smallbets/userbase/issues/255 has interesting ideas, while it's not natively supported
Loading

0 comments on commit 56148b1

Please sign in to comment.