From b664886e485d2970ca5daf17e0c95dc52c2d2311 Mon Sep 17 00:00:00 2001
From: ujstor <116409846+Ujstor@users.noreply.github.com>
Date: Sat, 22 Jun 2024 01:22:11 +0200
Subject: [PATCH] Refactor (#5)
Chi and Templ implementation
Docker image build and push workflow
---
.air.toml | 8 +-
.env | 1 -
.github/workflows/docker-image.yml | 48 +++
.github/workflows/go-test.yml | 17 -
.github/workflows/goreleasaer.yml | 35 ++
.github/workflows/linting.yml | 23 +-
.gitignore | 9 +-
.goreleaser.yml | 42 ++
Dockerfile | 11 +-
Jenkinsfile | 112 ------
Makefile | 44 +-
README.md | 135 ++++---
cmd/api/main.go | 14 +-
cmd/web/{static => assets}/css/main.css | 0
cmd/web/{static => assets}/fonts/devicon.ttf | Bin
cmd/web/{static => assets}/fonts/devicon.woff | Bin
.../fonts/fontawesome-webfont.ttf | Bin
.../fonts/fontawesome-webfont.woff | Bin
.../fonts/fontawesome-webfont.woff2 | Bin
cmd/web/{static => assets}/img/favicon.ico | Bin
cmd/web/{static => assets}/img/png/argo.png | Bin
.../{static => assets}/img/png/blueprint.png | Bin
.../{static => assets}/img/png/coolify.png | Bin
cmd/web/{static => assets}/img/png/lambda.png | Bin
cmd/web/{static => assets}/img/png/probit.png | Bin
.../{static => assets}/img/png/s3-infra.png | Bin
cmd/web/{static => assets}/img/webp/argo.webp | Bin
.../img/webp/blueprint.webp | Bin
.../{static => assets}/img/webp/coolify.webp | Bin
.../{static => assets}/img/webp/lambda.webp | Bin
.../{static => assets}/img/webp/probit.webp | Bin
.../{static => assets}/img/webp/s3-infra.webp | Bin
cmd/web/{static => assets}/js/main.js | 0
.../{static => assets}/js/sweet-scroll.min.js | 0
cmd/web/{static => assets}/js/typed.js | 0
cmd/web/{static => assets}/resume_24.pdf | Bin
cmd/web/{static => assets}/svg/aws.svg | 0
cmd/web/{static => assets}/svg/hetzner.svg | 0
cmd/web/{static => assets}/svg/postman.svg | 0
cmd/web/{static => assets}/svg/streamlit.svg | 0
cmd/web/{static => assets}/svg/traefik.svg | 0
cmd/web/base.templ | 45 +++
cmd/web/efs.go | 6 +
cmd/web/portfolio.templ | 342 ++++++++++++++++
cmd/web/templates/index.html | 377 ------------------
config.yml | 5 +
docker-compose-prod.yml | 8 +-
docker-compose.yml | 14 +-
docker_tag.sh | 19 +-
go.mod | 26 +-
go.sum | 46 +--
internal/server/routes.go | 24 +-
internal/server/routes_test.go | 32 --
internal/server/server.go | 25 +-
internal/server/server_test.go | 16 -
sitemap.xml | 22 -
56 files changed, 701 insertions(+), 805 deletions(-)
delete mode 100644 .env
create mode 100644 .github/workflows/docker-image.yml
delete mode 100644 .github/workflows/go-test.yml
create mode 100644 .github/workflows/goreleasaer.yml
create mode 100644 .goreleaser.yml
delete mode 100644 Jenkinsfile
rename cmd/web/{static => assets}/css/main.css (100%)
rename cmd/web/{static => assets}/fonts/devicon.ttf (100%)
rename cmd/web/{static => assets}/fonts/devicon.woff (100%)
rename cmd/web/{static => assets}/fonts/fontawesome-webfont.ttf (100%)
rename cmd/web/{static => assets}/fonts/fontawesome-webfont.woff (100%)
rename cmd/web/{static => assets}/fonts/fontawesome-webfont.woff2 (100%)
rename cmd/web/{static => assets}/img/favicon.ico (100%)
rename cmd/web/{static => assets}/img/png/argo.png (100%)
rename cmd/web/{static => assets}/img/png/blueprint.png (100%)
rename cmd/web/{static => assets}/img/png/coolify.png (100%)
rename cmd/web/{static => assets}/img/png/lambda.png (100%)
rename cmd/web/{static => assets}/img/png/probit.png (100%)
rename cmd/web/{static => assets}/img/png/s3-infra.png (100%)
rename cmd/web/{static => assets}/img/webp/argo.webp (100%)
rename cmd/web/{static => assets}/img/webp/blueprint.webp (100%)
rename cmd/web/{static => assets}/img/webp/coolify.webp (100%)
rename cmd/web/{static => assets}/img/webp/lambda.webp (100%)
rename cmd/web/{static => assets}/img/webp/probit.webp (100%)
rename cmd/web/{static => assets}/img/webp/s3-infra.webp (100%)
rename cmd/web/{static => assets}/js/main.js (100%)
rename cmd/web/{static => assets}/js/sweet-scroll.min.js (100%)
rename cmd/web/{static => assets}/js/typed.js (100%)
rename cmd/web/{static => assets}/resume_24.pdf (100%)
rename cmd/web/{static => assets}/svg/aws.svg (100%)
rename cmd/web/{static => assets}/svg/hetzner.svg (100%)
rename cmd/web/{static => assets}/svg/postman.svg (100%)
rename cmd/web/{static => assets}/svg/streamlit.svg (100%)
rename cmd/web/{static => assets}/svg/traefik.svg (100%)
create mode 100644 cmd/web/base.templ
create mode 100644 cmd/web/efs.go
create mode 100644 cmd/web/portfolio.templ
delete mode 100644 cmd/web/templates/index.html
create mode 100644 config.yml
delete mode 100644 internal/server/routes_test.go
delete mode 100644 internal/server/server_test.go
delete mode 100644 sitemap.xml
diff --git a/.air.toml b/.air.toml
index 99fcc72..dbc481d 100644
--- a/.air.toml
+++ b/.air.toml
@@ -4,17 +4,17 @@ tmp_dir = "tmp"
[build]
args_bin = []
- bin = "./tmp/main"
- cmd = "make run"
+ bin = "./main"
+ cmd = "make build"
delay = 1000
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
exclude_file = []
- exclude_regex = ["_test.go"]
+ exclude_regex = ["_test.go", ".*_templ.go"]
exclude_unchanged = false
follow_symlink = false
full_bin = ""
include_dir = []
- include_ext = ["go", "tpl", "tmpl", "html"]
+ include_ext = ["go", "tpl", "tmpl", "html", "templ"]
include_file = []
kill_delay = "0s"
log = "build-errors.log"
diff --git a/.env b/.env
deleted file mode 100644
index 9a69c24..0000000
--- a/.env
+++ /dev/null
@@ -1 +0,0 @@
-PORT=5000
\ No newline at end of file
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml
new file mode 100644
index 0000000..0add5f0
--- /dev/null
+++ b/.github/workflows/docker-image.yml
@@ -0,0 +1,48 @@
+name: Docker image
+
+on:
+ push:
+ branches:
+ - master
+jobs:
+ docker:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v3
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+
+ - name: Login to Docker Hub
+ uses: docker/login-action@v3
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+
+ - name: Install yq
+ run: |
+ sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
+ sudo chmod +x /usr/bin/yq
+
+ - name: Run docker tag sh and export var from config.yml
+ run: |
+ chmod +x ./docker_tag.sh
+ ./docker_tag.sh
+
+ - name: Export env variabels
+ uses: cardinalby/export-env-action@v2
+ with:
+ envFile: '.env'
+
+ - name: Build and push
+ if: ${{ env.PUSH_TO_DOCKER == 'true' }}
+ uses: docker/build-push-action@v5
+ with:
+ context: .
+ push: true
+ tags: ${{ env.DOCKER_HUB_USERNAME }}/${{ env.DOCKER_REPO_NAME }}:${{ env.NEW_TAG }}
+ target: prod
diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml
deleted file mode 100644
index 58957ba..0000000
--- a/.github/workflows/go-test.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-name: Go-test
-on: [push, pull_request]
-
-jobs:
- build:
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v4
- - name: Setup Go
- uses: actions/setup-go@v4
- with:
- go-version: '1.22.1'
- - name: Build
- run: go build -v ./...
- - name: Test with the Go CLI
- run: go test ./...
\ No newline at end of file
diff --git a/.github/workflows/goreleasaer.yml b/.github/workflows/goreleasaer.yml
new file mode 100644
index 0000000..d05ae4a
--- /dev/null
+++ b/.github/workflows/goreleasaer.yml
@@ -0,0 +1,35 @@
+name: goreleaser
+
+on:
+ push:
+ tags:
+ - "v*.*.*"
+
+permissions:
+ contents: write
+
+jobs:
+ goreleaser:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up Go
+ uses: actions/setup-go@v4
+ with:
+ go-version: '1.22.0'
+
+ - name: Install dependencies
+ run: |
+ go install github.com/a-h/templ/cmd/templ@latest
+ templ generate
+
+ - name: Run GoReleaser
+ uses: goreleaser/goreleaser-action@v5.0.0
+ with:
+ distribution: goreleaser
+ version: ${{ env.GITHUB_REF_NAME }}
+ args: release --clean
+ workdir: ./
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml
index 6883820..9a55183 100644
--- a/.github/workflows/linting.yml
+++ b/.github/workflows/linting.yml
@@ -1,15 +1,9 @@
-name: Linting
+name: continuous integration
on:
push:
- paths:
- - '**.go'
- - go.sum
- - go.mod
- branches-ignore:
- - main
pull_request:
-
+
jobs:
lint:
runs-on: ubuntu-latest
@@ -17,13 +11,13 @@ jobs:
- uses: actions/checkout@v4
- name: Set up Go
- uses: actions/setup-go@v4
+ uses: actions/setup-go@v5
with:
- go-version: '1.22.1'
+ go-version: '1.22.2'
- name: Deps cache
id: cache-go-deps
- uses: actions/cache@v3
+ uses: actions/cache@v4
env:
cache-name: go-deps-cache
with:
@@ -33,7 +27,7 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
- if: ${{ steps.cache-go-deps.outputs.cache-hit != 'true' }}
- name: List the state of node modules
+ name: List the state of go modules
continue-on-error: true
run: go mod graph
@@ -41,6 +35,9 @@ jobs:
run: |
go mod tidy
go mod download
+ go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.57.2
+ go install github.com/a-h/templ/cmd/templ@latest
+ templ generate
- name: Run golangci-lint
- uses: golangci/golangci-lint-action@v3.7.0
\ No newline at end of file
+ run: golangci-lint run
diff --git a/.gitignore b/.gitignore
index 30cfa03..cd6aac4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,13 +11,8 @@
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
-# Dependency directories (remove the comment below to include it)
-# vendor/
-
-# Go workspace file
go.work
tmp/
+*templ.go
-# IDE specific files
-.vscode
-.idea
+main
diff --git a/.goreleaser.yml b/.goreleaser.yml
new file mode 100644
index 0000000..ff7a12d
--- /dev/null
+++ b/.goreleaser.yml
@@ -0,0 +1,42 @@
+before:
+ hooks:
+ - go mod tidy
+
+env:
+ - PACKAGE_PATH=github.com/ujstor/portfolio-web/cmd
+
+builds:
+- binary: "{{ .ProjectName }}"
+ main: ./cmd/api
+ goos:
+ - darwin
+ - linux
+ - windows
+ goarch:
+ - amd64
+ - arm64
+ env:
+ - CGO_ENABLED=0
+ ldflags:
+ - -s -w -X {{.Env.PACKAGE_PATH}}={{.Version}}
+release:
+ prerelease: auto
+
+universal_binaries:
+- replace: true
+
+archives:
+ - name_template: >
+ {{- .ProjectName }}_{{- .Version }}_{{- title .Os }}_{{- if eq .Arch "amd64" }}x86_64{{- else if eq .Arch "386" }}i386{{- else }}{{ .Arch }}{{ end }}{{- if .Arm }}v{{ .Arm }}{{ end -}}
+ format_overrides:
+ - goos: windows
+ format: zip
+ builds_info:
+ group: root
+ owner: root
+ files:
+ - README.md
+
+checksum:
+ name_template: 'checksums.txt'
+
diff --git a/Dockerfile b/Dockerfile
index 087bea4..10396ef 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -11,15 +11,14 @@ COPY . .
FROM base as dev
RUN make build
-EXPOSE ${PORT}
+EXPOSE 5000
CMD [ "sh", "-c", "echo 'y' | make watch" ]
FROM base as build
-RUN go build -o main cmd/api/main.go
+RUN make build
-FROM alpine:3.19.0 as prod
+FROM alpine:3.20.1 as prod
WORKDIR /app
COPY --from=build /app/main /app/main
-COPY cmd/web cmd/web
-EXPOSE ${PORT}
-CMD ["./main"]
\ No newline at end of file
+EXPOSE 5000
+CMD ["./main"]
diff --git a/Jenkinsfile b/Jenkinsfile
deleted file mode 100644
index 224f13a..0000000
--- a/Jenkinsfile
+++ /dev/null
@@ -1,112 +0,0 @@
-pipeline {
- agent any
-
- environment {
- GITHUB_USER = 'ujstor'
- GITHUB_REPO = 'portfolio-web'
- DOCKER_HUB_USERNAME = 'ujstor'
- DOCKER_REPO_NAME = 'portfolio-web-go'
- BRANCH = 'master'
- VERSION_PART = 'Minor' // Patch, Minor, Major
- DOCKER_JENKINS_CERDIDENTALS_ID = 'be9636c4-b828-41af-ad0b-46d4182dfb06'
- TAG = '' // Generated automatically
- }
-
- stages {
- stage('Checkout Code') {
- steps {
- script {
- git(url: "https://github.com/${GITHUB_USER}/${GITHUB_REPO}/", branch: env.BRANCH_NAME)
- }
- }
- }
-
- stage('Test') {
- steps {
- script {
- sh "go test -v ./... ${WORKSPACE}/internal/server"
- }
- }
- }
-
- stage('chmod Tag sh') {
- steps {
- script {
- sh "chmod 777 ${WORKSPACE}/docker_tag.sh"
- }
- }
- }
-
- stage('Generate Docker Image Tag') {
- when {
- expression { env.BRANCH_NAME == env.BRANCH}
- }
- steps {
- script {
- TAG = sh(script: "${WORKSPACE}/docker_tag.sh $DOCKER_HUB_USERNAME $DOCKER_REPO_NAME $VERSION_PART", returnStdout: true).trim()
-
- if (TAG) {
- echo "Docker image tag generated successfully: $TAG"
- } else {
- error "Failed to generate Docker image tag"
- }
-
- env.TAG = TAG
- }
- }
- }
-
- stage('Docker Login') {
- when {
- expression { env.BRANCH_NAME == env.BRANCH }
- }
- steps {
- script {
-
- withCredentials([usernamePassword(credentialsId: env.DOCKER_JENKINS_CERDIDENTALS_ID, passwordVariable: 'DOCKER_PASSWORD', usernameVariable: 'DOCKER_USERNAME')]) {
- sh "docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD"
- }
- }
- }
- }
-
- stage('Build') {
- when {
- expression { env.BRANCH_NAME == env.BRANCH }
- }
- steps {
- script {
- sh "docker build --no-cache -t ${DOCKER_HUB_USERNAME}/${DOCKER_REPO_NAME}:${TAG} --target prod ."
- }
- }
- }
-
- stage('Deploy') {
- when {
- expression { env.BRANCH_NAME == env.BRANCH }
- }
- steps {
- script {
- sh "docker push ${DOCKER_HUB_USERNAME}/${DOCKER_REPO_NAME}:${TAG}"
- }
- }
- }
-
- stage('Environment Cleanup') {
- when {
- expression { env.BRANCH_NAME == env.BRANCH }
- }
- steps {
- script {
- sh "docker rmi ${DOCKER_HUB_USERNAME}/${DOCKER_REPO_NAME}:${TAG}"
- }
- }
- }
- }
-
- post {
- success {
- echo "Pipeline completed successfully"
- }
- }
-}
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 702a32b..c1bb24e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,23 @@
-# Simple Makefile for a Go project
-
-# Build the application
-all: build
+all: build docker-build docker-run
build:
@echo "Building..."
+ @if command -v templ > /dev/null; then \
+ templ generate; \
+ else \
+ read -p "Go's 'templ' is not installed on your machine. Do you want to install it? [Y/n] " choice; \
+ if [ "$$choice" != "n" ] && [ "$$choice" != "N" ]; then \
+ go install github.com/a-h/templ/cmd/templ@latest; \
+ templ generate; \
+ else \
+ echo "You chose not to install templ. Exiting..."; \
+ exit 1; \
+ fi; \
+ fi
@go build -o main cmd/api/main.go
docker-build:
- @docker build -t ujstor/portfolio-web-go .
+ @docker build -t ujstor/portfolio-web-go --target prod .
# Run the application
run:
@@ -21,31 +30,24 @@ docker-run:
push:
@docker push ujstor/portfolio-web-go
-# Test the application
-test:
- @echo "Testing..."
- @go test ./...
-
# Clean the binary
clean:
@echo "Cleaning..."
@rm -f main
-# Live Reload
watch:
- @if [ -x "$(GOPATH)/bin/air" ]; then \
- "$(GOPATH)/bin/air"; \
- @echo "Watching...";\
+ @if command -v air > /dev/null; then \
+ air; \
+ echo "Watching...";\
else \
- read -p "air is not installed. Do you want to install it now? (y/n) " choice; \
- if [ "$$choice" = "y" ]; then \
- go install github.com/cosmtrek/air@latest; \
- "$(GOPATH)/bin/air"; \
- @echo "Watching...";\
+ read -p "Go's 'air' is not installed on your machine. Do you want to install it? [Y/n] " choice; \
+ if [ "$$choice" != "n" ] && [ "$$choice" != "N" ]; then \
+ go install github.com/air-verse/air@latest; \
+ air; \
+ echo "Watching...";\
else \
echo "You chose not to install air. Exiting..."; \
exit 1; \
fi; \
fi
-
-.PHONY: all build docker-build run docker-run push test clea watch
+.PHONY: all build docker-build run docker-run push clean watch
diff --git a/README.md b/README.md
index ba356e4..5c6217a 100644
--- a/README.md
+++ b/README.md
@@ -1,84 +1,87 @@
# Portfolio Website
-This static website is built using HTML, CSS, and JavaScript and served using a Go or Flask web server. It's designed to showcase your personal or professional projects, skills, and any other information you'd like to share with the world.
+This static website is built with Go and Templ.
-The website is containerized using Docker Compose for easy deployment and scaling.
+Complete website in singe binary.
-## Docker Compose
-
-Build image and start the Docker containers using Docker Compose:
+## Docker image Workflow
+Variables are defined in config.yml and can be updated upon commit for new image tag:
```bash
-docker compose up web-prod --build -d
+docker:
+ DOCKER_HUB_USERNAME: ujstor
+ DOCKER_REPO_NAME: portfolio-web-go
+ VERSION_PART: Patch # Patch, Minor, major
+ PUSH_TO_DOCKER: true
```
+If the image does not exist, the default image tag is 0.0.1 for Patch, 0.1.0 for Minor, 1.0.0 for Major. Semantic versioning is employed upon commit, automatically incrementing the version.
-This command will build the Docker image for your website and start the container.
-
-You can now access your portfolio website by navigating to `http://localhost:5000` in your web browser.
-
-
-
-## Jenkins Pipeline
-The pipeline is designed to automate the processes of testing, building, and deploying a web application using Docker.
-It creates an image and pushes it to DockerHub. This simplifies deployment with Docker Compose. Additionally,
-the pipeline is configured to perform these tasks when certain conditions are met, such as specific branch.
-
-
+Workflow also requires DockerHub login credentials, username and password configuration in the Action secret:
+```bash
+username: ${{ secrets.DOCKERHUB_USERNAME }}
+password: ${{ secrets.DOCKERHUB_TOKEN }}
+```
## Deployment
-Application deployment can be achieved through the utilization of either a `Go` or `Flask` server, orchestrated using docker-compose,
-and hosted on the cloud self-hosting service provided by [Collify](https://coolify.io/docs/installation). Please note that the Flask server resides on a distinct branch.
-
-
-
-
+Deployment can be achieved through self-hosting service provided by [Collify](https://coolify.io/docs/installation).

## MakeFile
-run all make commands with clean tests
-```bash
-make all build
-```
-
-build the application
```bash
-make build
+all: build docker-build docker-run
+
+build:
+ @echo "Building..."
+ @if command -v templ > /dev/null; then \
+ templ generate; \
+ else \
+ read -p "Go's 'templ' is not installed on your machine. Do you want to install it? [Y/n] " choice; \
+ if [ "$$choice" != "n" ] && [ "$$choice" != "N" ]; then \
+ go install github.com/a-h/templ/cmd/templ@latest; \
+ templ generate; \
+ else \
+ echo "You chose not to install templ. Exiting..."; \
+ exit 1; \
+ fi; \
+ fi
+ @go build -o main cmd/api/main.go
+
+docker-build:
+ @docker build -t ujstor/portfolio-web-go --target prod .
+
+# Run the application
+run:
+ @go run cmd/api/main.go
+
+docker-run:
+ @docker run -p 5000:5000 ujstor/portfolio-web-go
+
+# Push app to DockerHub
+push:
+ @docker push ujstor/portfolio-web-go
+
+# Clean the binary
+clean:
+ @echo "Cleaning..."
+ @rm -f main
+
+watch:
+ @if command -v air > /dev/null; then \
+ air; \
+ echo "Watching...";\
+ else \
+ read -p "Go's 'air' is not installed on your machine. Do you want to install it? [Y/n] " choice; \
+ if [ "$$choice" != "n" ] && [ "$$choice" != "N" ]; then \
+ go install github.com/air-verse/air@latest; \
+ air; \
+ echo "Watching...";\
+ else \
+ echo "You chose not to install air. Exiting..."; \
+ exit 1; \
+ fi; \
+ fi
+.PHONY: all build docker-build run docker-run push clean watch
```
-
-build docker image
-```bash
-make docker-build
-```
-
-run the application
-```bash
-make run
-```
-
-run docker image
-```bash
-make docker-run
-```
-
-push image to DockerHub
-```bash
-make push
-```
-
-live reload the application
-```bash
-make watch
-```
-
-run the test suite
-```bash
-make test
-```
-
-clean up binary from the last build
-```bash
-make clean
-```
\ No newline at end of file
diff --git a/cmd/api/main.go b/cmd/api/main.go
index 7bc287b..835a445 100644
--- a/cmd/api/main.go
+++ b/cmd/api/main.go
@@ -1,22 +1,16 @@
package main
import (
- "fiber/internal/server"
"fmt"
- "os"
- "strconv"
-
- _ "github.com/joho/godotenv/autoload"
+ "portfolio-web/internal/server"
)
func main() {
- server := server.New()
+ server := server.NewServer()
- server.RegisterFiberRoutes()
- port, _ := strconv.Atoi(os.Getenv("PORT"))
- err := server.Listen(fmt.Sprintf(":%d", port))
+ err := server.ListenAndServe()
if err != nil {
- panic("cannot start server")
+ panic(fmt.Sprintf("cannot start server: %s", err))
}
}
diff --git a/cmd/web/static/css/main.css b/cmd/web/assets/css/main.css
similarity index 100%
rename from cmd/web/static/css/main.css
rename to cmd/web/assets/css/main.css
diff --git a/cmd/web/static/fonts/devicon.ttf b/cmd/web/assets/fonts/devicon.ttf
similarity index 100%
rename from cmd/web/static/fonts/devicon.ttf
rename to cmd/web/assets/fonts/devicon.ttf
diff --git a/cmd/web/static/fonts/devicon.woff b/cmd/web/assets/fonts/devicon.woff
similarity index 100%
rename from cmd/web/static/fonts/devicon.woff
rename to cmd/web/assets/fonts/devicon.woff
diff --git a/cmd/web/static/fonts/fontawesome-webfont.ttf b/cmd/web/assets/fonts/fontawesome-webfont.ttf
similarity index 100%
rename from cmd/web/static/fonts/fontawesome-webfont.ttf
rename to cmd/web/assets/fonts/fontawesome-webfont.ttf
diff --git a/cmd/web/static/fonts/fontawesome-webfont.woff b/cmd/web/assets/fonts/fontawesome-webfont.woff
similarity index 100%
rename from cmd/web/static/fonts/fontawesome-webfont.woff
rename to cmd/web/assets/fonts/fontawesome-webfont.woff
diff --git a/cmd/web/static/fonts/fontawesome-webfont.woff2 b/cmd/web/assets/fonts/fontawesome-webfont.woff2
similarity index 100%
rename from cmd/web/static/fonts/fontawesome-webfont.woff2
rename to cmd/web/assets/fonts/fontawesome-webfont.woff2
diff --git a/cmd/web/static/img/favicon.ico b/cmd/web/assets/img/favicon.ico
similarity index 100%
rename from cmd/web/static/img/favicon.ico
rename to cmd/web/assets/img/favicon.ico
diff --git a/cmd/web/static/img/png/argo.png b/cmd/web/assets/img/png/argo.png
similarity index 100%
rename from cmd/web/static/img/png/argo.png
rename to cmd/web/assets/img/png/argo.png
diff --git a/cmd/web/static/img/png/blueprint.png b/cmd/web/assets/img/png/blueprint.png
similarity index 100%
rename from cmd/web/static/img/png/blueprint.png
rename to cmd/web/assets/img/png/blueprint.png
diff --git a/cmd/web/static/img/png/coolify.png b/cmd/web/assets/img/png/coolify.png
similarity index 100%
rename from cmd/web/static/img/png/coolify.png
rename to cmd/web/assets/img/png/coolify.png
diff --git a/cmd/web/static/img/png/lambda.png b/cmd/web/assets/img/png/lambda.png
similarity index 100%
rename from cmd/web/static/img/png/lambda.png
rename to cmd/web/assets/img/png/lambda.png
diff --git a/cmd/web/static/img/png/probit.png b/cmd/web/assets/img/png/probit.png
similarity index 100%
rename from cmd/web/static/img/png/probit.png
rename to cmd/web/assets/img/png/probit.png
diff --git a/cmd/web/static/img/png/s3-infra.png b/cmd/web/assets/img/png/s3-infra.png
similarity index 100%
rename from cmd/web/static/img/png/s3-infra.png
rename to cmd/web/assets/img/png/s3-infra.png
diff --git a/cmd/web/static/img/webp/argo.webp b/cmd/web/assets/img/webp/argo.webp
similarity index 100%
rename from cmd/web/static/img/webp/argo.webp
rename to cmd/web/assets/img/webp/argo.webp
diff --git a/cmd/web/static/img/webp/blueprint.webp b/cmd/web/assets/img/webp/blueprint.webp
similarity index 100%
rename from cmd/web/static/img/webp/blueprint.webp
rename to cmd/web/assets/img/webp/blueprint.webp
diff --git a/cmd/web/static/img/webp/coolify.webp b/cmd/web/assets/img/webp/coolify.webp
similarity index 100%
rename from cmd/web/static/img/webp/coolify.webp
rename to cmd/web/assets/img/webp/coolify.webp
diff --git a/cmd/web/static/img/webp/lambda.webp b/cmd/web/assets/img/webp/lambda.webp
similarity index 100%
rename from cmd/web/static/img/webp/lambda.webp
rename to cmd/web/assets/img/webp/lambda.webp
diff --git a/cmd/web/static/img/webp/probit.webp b/cmd/web/assets/img/webp/probit.webp
similarity index 100%
rename from cmd/web/static/img/webp/probit.webp
rename to cmd/web/assets/img/webp/probit.webp
diff --git a/cmd/web/static/img/webp/s3-infra.webp b/cmd/web/assets/img/webp/s3-infra.webp
similarity index 100%
rename from cmd/web/static/img/webp/s3-infra.webp
rename to cmd/web/assets/img/webp/s3-infra.webp
diff --git a/cmd/web/static/js/main.js b/cmd/web/assets/js/main.js
similarity index 100%
rename from cmd/web/static/js/main.js
rename to cmd/web/assets/js/main.js
diff --git a/cmd/web/static/js/sweet-scroll.min.js b/cmd/web/assets/js/sweet-scroll.min.js
similarity index 100%
rename from cmd/web/static/js/sweet-scroll.min.js
rename to cmd/web/assets/js/sweet-scroll.min.js
diff --git a/cmd/web/static/js/typed.js b/cmd/web/assets/js/typed.js
similarity index 100%
rename from cmd/web/static/js/typed.js
rename to cmd/web/assets/js/typed.js
diff --git a/cmd/web/static/resume_24.pdf b/cmd/web/assets/resume_24.pdf
similarity index 100%
rename from cmd/web/static/resume_24.pdf
rename to cmd/web/assets/resume_24.pdf
diff --git a/cmd/web/static/svg/aws.svg b/cmd/web/assets/svg/aws.svg
similarity index 100%
rename from cmd/web/static/svg/aws.svg
rename to cmd/web/assets/svg/aws.svg
diff --git a/cmd/web/static/svg/hetzner.svg b/cmd/web/assets/svg/hetzner.svg
similarity index 100%
rename from cmd/web/static/svg/hetzner.svg
rename to cmd/web/assets/svg/hetzner.svg
diff --git a/cmd/web/static/svg/postman.svg b/cmd/web/assets/svg/postman.svg
similarity index 100%
rename from cmd/web/static/svg/postman.svg
rename to cmd/web/assets/svg/postman.svg
diff --git a/cmd/web/static/svg/streamlit.svg b/cmd/web/assets/svg/streamlit.svg
similarity index 100%
rename from cmd/web/static/svg/streamlit.svg
rename to cmd/web/assets/svg/streamlit.svg
diff --git a/cmd/web/static/svg/traefik.svg b/cmd/web/assets/svg/traefik.svg
similarity index 100%
rename from cmd/web/static/svg/traefik.svg
rename to cmd/web/assets/svg/traefik.svg
diff --git a/cmd/web/base.templ b/cmd/web/base.templ
new file mode 100644
index 0000000..c287a86
--- /dev/null
+++ b/cmd/web/base.templ
@@ -0,0 +1,45 @@
+package web
+
+templ Base() {
+
+
+
+ As a self-taught programmer, I am focused on backend development, CI/CD pipelines and automation. + I'm excited to apply my analytical mindset to projects requiring technical expertise and creative problem-solving. + I remain open to opportunities for growth, collaboration and addressing + real-world challenges with my skill set. +
+Preferred programming languages and core tools for version control, CI/CD, container orchestration and deployment.
++ Core maintainer of the Go-Blueprint project: Go Blueprint is a CLI tool that allows users to + spin up a Go project with the corresponding structure. It also offers the option to + integrate with some of the most popular Go frameworks. Additionally, it implements database + drivers along with Docker Compose file for quick database creation, HTMx templates, GitHubAction worflows and Websockets. +
+ GitHub + + Docs + + YouTube ++ Implementing MinIO, a high-performance object storage system compatible with Amazon S3, using Terraform and Ansible for management. + Configured as Multi-Node Multi-Drive (MNMD), this setup ensure robust performance and availability for enterprise applications. + It is fortified with configuration to sustain read operations even in the event of half-node or drive failures. +
+ GitHub ++ Terraform modules for creating Lambda functions along with associated AWS infrastructure components + like DynamoDB tables and API Gateway configurations. The repository includes modularized Terraform code + with separate modules for Lambda functions, DynamoDB tables, and API Gateway integrations, facilitating + easy deployment and management of serverless applications. +
+ GitHub ++ GitHub Actions workflow that integrates with DockerHub and ArgoCD, enabling streamlined CI/CD pipelines. + This setup utilizes semantic versioning for Docker images and automatically updates Helm charts in + another repository upon successful commits. +
+ GitHub ++ Deploys Coolify on Hetzner Cloud using the Terraform. Coolify is an all-in one PaaS that helps you to self-host your own applications, + databases or services without managing your servers, also known as an open-source & self-hostable + Heroku / Netlify / Vercel alternative. +
+ GitHub + + Docs +- As a self-taught programmer, I am focused on backend development, CI/CD pipelines and automation. - I'm excited to apply my analytical mindset to projects requiring technical expertise and creative problem-solving. - I remain open to opportunities for growth, collaboration and addressing - real-world challenges with my skill set. -
-Preferred programming languages and core tools for version control, CI/CD, container orchestration and deployment.
-- Core maintainer of the Go-Blueprint project: Go Blueprint is a CLI tool that allows users to - spin up a Go project with the corresponding structure. It also offers the option to - integrate with some of the most popular Go frameworks. Additionally, it implements database - drivers along with Docker Compose file for quick database creation, HTMx templates, GitHubAction worflows and Websockets. -
- GitHub - - Docs - - YouTube -- Implementing MinIO, a high-performance object storage system compatible with Amazon S3, using Terraform and Ansible for management. - Configured as Multi-Node Multi-Drive (MNMD), this setup ensure robust performance and availability for enterprise applications. - It is fortified with configuration to sustain read operations even in the event of half-node or drive failures. -
- GitHub -- Terraform modules for creating Lambda functions along with associated AWS infrastructure components - like DynamoDB tables and API Gateway configurations. The repository includes modularized Terraform code - with separate modules for Lambda functions, DynamoDB tables, and API Gateway integrations, facilitating - easy deployment and management of serverless applications. -
- GitHub -- GitHub Actions workflow that integrates with DockerHub and ArgoCD, enabling streamlined CI/CD pipelines. - This setup utilizes semantic versioning for Docker images and automatically updates Helm charts in - another repository upon successful commits. -
- GitHub -- Deploys Coolify on Hetzner Cloud using the Terraform. Coolify is an all-in one PaaS that helps you to self-host your own applications, - databases or services without managing your servers, also known as an open-source & self-hostable - Heroku / Netlify / Vercel alternative. -
- GitHub - - Docs -