diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,23 +0,0 @@ -- **I'm submitting a ...** - - - [ ] bug report - - [ ] feature request - -- **What is the current behavior?** - -- **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem** - -- **What is the expected behavior?** - -- **What is the motivation / use case for changing the behavior?** - -- **Please describe your environment:** - - - OS: [ MacOS, Linux, Windows] - - Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ] - -- **Did you research the bug you are experiencing and read the README at the root of the project in its entirety?:** - - - [ ] Yes - -- **Other information** (e.g. detailed explanation, screenshots, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,23 +0,0 @@ -* **Please check if the PR fulfills these requirements** -- [ ] The commit message is descriptive -- [ ] Tests for the changes have been added (for bug fixes / features) -- [ ] Docs have been added / updated (for bug fixes / features) - - -* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...) - - - -* **What is the current behavior?** (You can also link to an open issue here) - - - -* **What is the new behavior (if this is a feature change)?** - - - -* **Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?) - - - -* **Other information**: \ No newline at end of file diff --git a/.gitignore b/.gitignore --- a/.gitignore +++ b/.gitignore @@ -17,15 +17,17 @@ !*.templ !go.sum !go.mod -!README.md +!*.md !LICENSE +!flake.nix +!flake.lock !web/**/* web/resources/static/libs/* -web/resources/static/index.css + # !Makefile # ...even if they are in subdirectories -!*/ \ No newline at end of file +!*/ diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 --- a/.vscode/extensions.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. - // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp - - // List of extensions which should be recommended for users of this workspace. - "recommendations": [ - "a-h.templ", - "antfu.iconify", - "bradlc.vscode-tailwindcss", - "golang.go", - "runem.lit-plugin", - ], - // List of extensions recommended by VS Code that should not be recommended for users of this workspace. - "unwantedRecommendations": [ - - ] -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 --- a/.vscode/launch.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "configurations": [ - { - "name": "Debug Main", - "type": "go", - "request": "launch", - "mode": "debug", - "program": "${workspaceFolder}/cmd/web", - "buildFlags": "-tags=dev", - } - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 --- a/.vscode/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "[templ]": { "editor.defaultFormatter": "a-h.templ" }, - "emmet.includeLanguages": { "templ": "html" }, - "go.useLanguageServer": true, - "gopls": { "build.buildFlags": ["-tags=dev"] }, - "tailwindCSS.includeLanguages": { "templ": "html" }, -} diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md new file mode 100644 --- /dev/null +++ b/ARCHITECTURE.md @@ -0,0 +1,69 @@ +# Stack + +- [Go](https://go.dev/doc/) +- [NATS](https://docs.nats.io/) +- [Datastar](https://github.com/starfederation/datastar) +- [Templ](https://templ.guide/) + +# Development + +Live Reload is setup out of the box - powered by [Air](https://github.com/air-verse/air) + [esbuild](cmd/web/build/main.go) + +Use the [live task](./Taskfile.yml#L76) from the [Taskfile](https://taskfile.dev/) to start with live reload setup + +```shell +go tool task live +``` + +Navigate to [`http://localhost:8080`](http://localhost:8080) in your favorite web browser to begin + +## Debugging + +The [debug task](./Taskfile.yml#L42) will launch [delve](https://github.com/go-delve/delve) to begin a debugging session with your project's binary + +```shell +go tool task debug +``` + +# References + +## Server + +- [go](https://go.dev/) +- [nats](https://docs.nats.io/) +- [datastar sdk](https://github.com/starfederation/datastar/tree/develop/sdk) +- [templ](https://templ.guide/) + +### Embedded NATS + +The NATS server that powers the `TODO` application is [embedded into the web server](./cmd/web/main.go#L60) + +To interface with it, you should install the [nats-cli](https://github.com/nats-io/natscli) + +Here are some commands to inspect and make changes to the bucket backing the `TODO` app: + +```shell +# list key value buckets +nats kv ls + +# list keys in the `todos` bucket +nats kv ls todos + +# get the value for [key] +nats kv get --raw todos [key] + +# put a value into [key] +nats kv put todos [key] '{"todos":[{"text":"Hello, NATS!","completed":true}],"editingIdx":-1,"mode":0}' +``` + +## Web Components x Datastar + +[🔗 Vanilla Web Components Setup](./web/libs/web-components/README.md) + +[🔗 Lit Web Components Setup](./web/libs/lit/README.md) + +## Client + +- [datastar](https://www.jsdelivr.com/package/gh/starfederation/datastar) +- [esbuild](https://esbuild.github.io/) +- [lit](https://lit.dev/) diff --git a/Dockerfile b/Dockerfile --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/golang:1.26.1-alpine AS build +FROM docker.io/golang:1.26-alpine AS build RUN apk add --no-cache upx diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -1,69 +1,6 @@ -# NORTHSTAR - -# Stack - -- [Go](https://go.dev/doc/) -- [NATS](https://docs.nats.io/) -- [Datastar](https://github.com/starfederation/datastar) -- [Templ](https://templ.guide/) - - [Tailwind](https://tailwindcss.com/) x [DaisyUI](https://daisyui.com/) - -# Setup - -1. Clone this repository - -```shell -git clone https://github.com/zangster300/northstar.git -``` - -2. Install Dependencies - -```shell -go mod tidy -``` - -3. Create 🚀 - -# Development - -Live Reload is setup out of the box - powered by [Air](https://github.com/air-verse/air) + [esbuild](cmd/web/build/main.go) - -Use the [live task](./Taskfile.yml#L76) from the [Taskfile](https://taskfile.dev/) to start with live reload setup - -```shell -go tool task live -``` - -Navigate to [`http://localhost:8080`](http://localhost:8080) in your favorite web browser to begin - -## Debugging - -The [debug task](./Taskfile.yml#L42) will launch [delve](https://github.com/go-delve/delve) to begin a debugging session with your project's binary - -```shell -go tool task debug -``` - -## IDE Support - -- [Templ / TailwindCSS Support](https://templ.guide/developer-tools/ide-support/) - -### Visual Studio Code Integration - -[Reference](https://code.visualstudio.com/docs/languages/go) - -- [launch.json](./.vscode/launch.json) -- [settings.json](./.vscode/settings.json) - -a `Debug Main` configuration has been added to the [launch.json](./.vscode/launch.json) - -# Starting the Server - -```shell -go tool task run -``` +# ATMO.QUEST - Onboarding for the [ATmosphere](https://atmosphereaccount.com) -Navigate to [`http://localhost:8080`](http://localhost:8080) in your favorite web browser +Draft your profile, make connections, and record notes all before creating an account. When you're ready to fly, we'll help you find a data host and chose your name. Then you can pick up side-quests and explore the ATmosphere! # Deployment @@ -75,59 +12,14 @@ ## Docker ```shell # build an image -docker build -t northstar:latest . +docker build -t atmoquest:latest . # run the image in a container -docker run --name northstar -p 8080:9001 northstar:latest +docker run --name atmoquest -p 8080:9001 atmoquest:latest ``` [Dockerfile](./Dockerfile) # Contributing -Completely open to PR's and feature requests - -# References - -## Server - -- [go](https://go.dev/) -- [nats](https://docs.nats.io/) -- [datastar sdk](https://github.com/starfederation/datastar/tree/develop/sdk) -- [templ](https://templ.guide/) - -### Embedded NATS - -The NATS server that powers the `TODO` application is [embedded into the web server](./cmd/web/main.go#L60) - -To interface with it, you should install the [nats-cli](https://github.com/nats-io/natscli) - -Here are some commands to inspect and make changes to the bucket backing the `TODO` app: - -```shell -# list key value buckets -nats kv ls - -# list keys in the `todos` bucket -nats kv ls todos - -# get the value for [key] -nats kv get --raw todos [key] - -# put a value into [key] -nats kv put todos [key] '{"todos":[{"text":"Hello, NATS!","completed":true}],"editingIdx":-1,"mode":0}' -``` - -## Web Components x Datastar - -[🔗 Vanilla Web Components Setup](./web/libs/web-components/README.md) - -[🔗 Lit Web Components Setup](./web/libs/lit/README.md) - -## Client - -- [datastar](https://www.jsdelivr.com/package/gh/starfederation/datastar) -- [tailwindcss](https://tailwindcss.com/) -- [daisyui](https://daisyui.com/) -- [esbuild](https://esbuild.github.io/) -- [lit](https://lit.dev/) +Completely open to PR's and feature requests. diff --git a/Taskfile.yml b/Taskfile.yml --- a/Taskfile.yml +++ b/Taskfile.yml @@ -7,20 +7,6 @@ tasks: # The `build:` tasks below are used together for production builds of a project build:templ: - cmds: - - go tool templ generate - sources: - - "**/*.templ" - generates: - - "**/*_templ.go" - - build:web:styles: - cmds: - - go tool gotailwind -i web/resources/styles/styles.css -o $STATIC_DIR/index.css - sources: - - "./web/resources/**/*.{html,ts,templ,go,css}" - generates: - - "{{.STATIC_DIR}}/index.css" build:web:bundle: cmds: @@ -35,7 +21,6 @@ cmds: - go build -tags=prod -o bin/main ./cmd/web deps: - build:templ - - build:web:styles - build:web:bundle # Use this task to debug with the delve debugger @@ -52,12 +37,6 @@ - go run cmd/web/downloader/main.go # The `live:` tasks below are used together for development builds and will live-reload the server live:templ: - cmds: - - go tool templ generate -watch - - live:web:styles: - cmds: - - go tool gotailwind -i web/resources/styles/styles.css -o $STATIC_DIR/index.css -w live:web:bundle: cmds: @@ -76,7 +55,6 @@ live: deps: - live:templ - - live:web:styles - live:web:bundle - live:server diff --git a/cmd/web/build/main.go b/cmd/web/build/main.go --- a/cmd/web/build/main.go +++ b/cmd/web/build/main.go @@ -7,8 +7,8 @@ "flag" "fmt" "log/slog" "net/http" - "northstar/config" - "northstar/web/resources" + "atmoquest/config" + "atmoquest/web/resources" "os" "os/signal" diff --git a/cmd/web/downloader/main.go b/cmd/web/downloader/main.go --- a/cmd/web/downloader/main.go +++ b/cmd/web/downloader/main.go @@ -6,7 +6,7 @@ "fmt" "io" "log/slog" "net/http" - "northstar/web/resources" + "atmoquest/web/resources" "os" "path/filepath" "sync" @@ -23,13 +23,10 @@ func run() error { files := map[string]string{ "https://raw.githubusercontent.com/starfederation/datastar/develop/bundles/datastar.js": resources.StaticDirectoryPath + "/datastar/datastar.js", "https://raw.githubusercontent.com/starfederation/datastar/develop/bundles/datastar.js.map": resources.StaticDirectoryPath + "/datastar/datastar.js.map", - "https://github.com/saadeghi/daisyui/releases/latest/download/daisyui.js": resources.StylesDirectoryPath + "/daisyui/daisyui.js", - "https://github.com/saadeghi/daisyui/releases/latest/download/daisyui-theme.js": resources.StylesDirectoryPath + "/daisyui/daisyui-theme.js", } directories := []string{ resources.StaticDirectoryPath + "/datastar", - resources.StylesDirectoryPath + "/daisyui", } if err := removeDirectories(directories); err != nil { diff --git a/cmd/web/main.go b/cmd/web/main.go --- a/cmd/web/main.go +++ b/cmd/web/main.go @@ -6,9 +6,9 @@ "fmt" "log/slog" "net" "net/http" - "northstar/config" - "northstar/nats" - "northstar/router" + "atmoquest/config" + "atmoquest/nats" + "atmoquest/router" "os" "os/signal" "time" diff --git a/features/common/components/navigation.templ b/features/common/components/navigation.templ --- a/features/common/components/navigation.templ +++ b/features/common/components/navigation.templ @@ -1,23 +1,10 @@ package components -type page int - -const ( - PageIndex page = iota - PageCounter - PageMonitor - PageReverse - PageSortable -) - -templ Navigation(page page) { -