https://github.com/bartonhammond/aha-htmx-tutorial
Learn the AHA stack: Perfect for frontend developers that know React / JSX and want a similar DX, but also want much more simplicity in their life by generating HTML on the server and writing as little client-side JavaScript as possible. See https://ahastack.dev/
https://github.com/bartonhammond/aha-htmx-tutorial
aha alpinejs astrojs htmx picocss pocketbase tutorial
Last synced: about 1 month ago
JSON representation
Learn the AHA stack: Perfect for frontend developers that know React / JSX and want a similar DX, but also want much more simplicity in their life by generating HTML on the server and writing as little client-side JavaScript as possible. See https://ahastack.dev/
- Host: GitHub
- URL: https://github.com/bartonhammond/aha-htmx-tutorial
- Owner: bartonhammond
- Created: 2025-01-08T19:13:37.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-21T15:37:40.000Z (about 1 year ago)
- Last Synced: 2025-10-11T21:14:14.796Z (6 months ago)
- Topics: aha, alpinejs, astrojs, htmx, picocss, pocketbase, tutorial
- Language: JavaScript
- Homepage: https://aha-htmx-tutorial.fly.dev/
- Size: 21.6 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AHA Example
## Astro - HTMX - Alpine- Pocketbase - PicoCSS - Fly
### Install
#### Pocketbase
* copy a `pocketbase` app to the `pb` directory
* run `./scripts/start.sh` to start `pocketbase`
* import the `pb/pb_schema.json` to create the `contacts` db
* create an admin, turn off the API rules on `contacts`
#### Astro
* `npm i`
### Running
* in one terminal `./scripts/start.sh` - this starts PB
* in another terminal `npm run dev` - this starts Astro
### Loading data
* cd into `scripts`
* `node loadData.js development | production` - to load Contacts
* `node test.js development | production` - to confirm db
### Deployment
Both Astro and Pocketbase are deployed to Fly.io
#### Astro
see Dockerfile and fly.toml
Note that this app requires 3 secrets that locally are in the `.env.development`.
To deploy to Fly.io you don't want those secrets in the Dockerfile
Instead use `fly secrets`
You have to make three of them like this
```
fly secrets set POCKETBASE_URL=where ever
fly secrets set POCKETBASE_SUPERUSER=some email
fly secrets set POCKETBASE_PASSWORD=some password
```
Next, you need to have disk space to write the `archive zip` file
Add 2 volumes : [https://fly.io/docs/launch/volume-storage/](https://fly.io/docs/launch/volume-storage/)
* `fly volumes create downloads -r dfw`
Verify - notice the `downloads` in the `NAME` column.
```
fly volumes list
ID STATE NAME SIZE REGION ZONE ENCRYPTED ATTACHED VM CREATED AT
vol_vpzmddnqn7xg5824 created downloads 1GB dfw edff true d891443c242e18 40 minutes ago
vol_v3yeq0qkqzk3gdm4 created downloads 1GB dfw 8f05 true 1857057c63de08 8 minutes ago
```
##### Pocketbase
See the complete instructions here: [https://github.com/pocketbase/pocketbase/discussions/537](https://github.com/pocketbase/pocketbase/discussions/537)
see the `Dockerfile` and `fly.yml` in the `pb` directory
Note that Pocketbase needs the volume storage as shown above