Skip to content

Commit

Permalink
Merge pull request #44 from toboshii/svelte
Browse files Browse the repository at this point in the history
Migrate to SPA architecture using Svelte
  • Loading branch information
toboshii authored Oct 2, 2022
2 parents 21ceaa4 + cfdf38d commit ef54a56
Show file tree
Hide file tree
Showing 95 changed files with 6,839 additions and 2,048 deletions.
31 changes: 31 additions & 0 deletions .air.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
root = "."
tmp_dir = "tmp"

[build]
full_bin = "MEMORY=true LOG_LEVEL=debug ./tmp/hajimari"
cmd = "go build -o ./tmp/hajimari ./cmd/hajimari/main.go"
delay = 1000
exclude_dir = ["frontend", "docs", "charts", "tmp", "vendor"]
exclude_file = []
exclude_regex = []
exclude_unchanged = false
follow_symlink = false
include_dir = []
include_ext = ["go", "tpl", "tmpl", "html"]
kill_delay = "0s"
log = "build-errors.log"
send_interrupt = false
stop_on_error = true

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

[log]
time = false

[misc]
clean_on_exit = true
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
.git
.github/
.vscode/
.gitignore
.kubeconfig
assets/
charts/
data/
docs/
Dockerfile
LICENSE
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lint-test-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
python-version: 3.7

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.1.0
uses: helm/chart-testing-action@v2.3.1

- name: Run chart-testing (list-changed)
id: list-changed
Expand All @@ -34,6 +34,7 @@ jobs:
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint

Expand Down
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.dll
*.so
*.dylib
tmp

# Test binary, built with `go test -c`
*.test
Expand All @@ -12,10 +13,19 @@
*.out

# Project specific
/data
/config.yaml
/hajimari
/.kubeconfig
/bin

# Chart dependencies
charts/hajimari/charts
charts/hajimari/Chart.lock
charts/hajimari/local.yaml
charts/hajimari/local.yaml

# UI dependencies
node_modules
public/build/

.DS_Store
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"svelte.plugin.svelte.compilerWarnings": {
"a11y-autofocus": "ignore"
}
}
20 changes: 17 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
FROM golang:1.16-alpine as build
FROM docker.io/node:16.17-alpine AS build-frontend

WORKDIR /build

COPY . .

WORKDIR /build/frontend

RUN npm install

RUN npm run build

FROM docker.io/golang:1.19.1-alpine as build

ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
Expand All @@ -10,6 +22,8 @@ WORKDIR /build

COPY . .

COPY --from=build-frontend /build/frontend/build /build/frontend/build

RUN \
export GOOS=$(echo ${TARGETPLATFORM} | cut -d / -f1) \
&& \
Expand All @@ -19,11 +33,11 @@ RUN \
&& \
go mod download \
&& \
go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o hajimari /build/main.go \
go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o hajimari /build/cmd/hajimari/main.go \
&& \
chmod +x hajimari

FROM alpine:3.14
FROM docker.io/alpine:3.16

RUN \
apk add --no-cache \
Expand Down
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@
help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

.PHONY: deps
deps: ## Install required dependencies
cd frontend/ && npm install

.PHONY: build
build: ## Build the Go project.
go build -ldflags="-s -w" -trimpath -v -o hajimari
npm run build --prefix frontend/
go build -ldflags="-s -w" -trimpath -o ./bin/hajimari ./cmd/hajimari/main.go

.PHONY: run
run: build ## Run the program
./hajimari
./bin/hajimari

.PHONY: dev
dev: ## Run the program in dev mode
(trap 'kill 0' SIGINT; air & sleep 5 && cd frontend/ && npm run dev -- --open)

.PHONY: fmt
fmt: ## Format the project with gofmt
Expand All @@ -23,4 +32,4 @@ lint: ## Lint code with golangci-lint

.PHONY: test
test: ## Run the tests
go test -cover ./...
go test -cover ./...
193 changes: 149 additions & 44 deletions README.md

Large diffs are not rendered by default.

File renamed without changes
File renamed without changes
File renamed without changes
Binary file added assets/screen01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/screen02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/screen03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions charts/hajimari/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
apiVersion: v2
appVersion: v0.2.0
appVersion: v0.3.0
description: |
Hajimari is a beautiful & customizable browser startpage/dashboard with
Kubernetes application discovery
name: hajimari
version: 1.2.0
version: 2.0.0
kubeVersion: ">=1.16.0-0"
keywords:
- hajimari
- startpage
- dashboard
home: https://github.com/toboshii/hajimari/tree/master/charts/hajimari
icon: https://raw.githubusercontent.com/toboshii/hajimari/main/docs/static/img/logo.png
icon: https://raw.githubusercontent.com/toboshii/hajimari/main/assets/logo.png
sources:
- https://github.com/toboshii/hajimari
maintainers:
- name: toboshii
email: [email protected]
dependencies:
- name: common
repository: https://library-charts.k8s-at-home.com
version: 4.0.0
version: 0.2.1
repository: https://bjw-s.github.io/helm-charts/
Loading

0 comments on commit ef54a56

Please sign in to comment.