13 Commits

Author SHA1 Message Date
renovate[bot]
2b30ff7b73 Update dependency @vitejs/plugin-vue to v6 2026-02-28 01:32:33 +00:00
bd4edebb0b Merge pull request #335 from davegallant/dependabot/npm_and_yarn/rollup-4.59.0 2026-02-27 20:31:33 -05:00
da44c48ba8 Merge pull request #336 from davegallant/dependabot/npm_and_yarn/minimatch-3.1.5 2026-02-27 20:31:07 -05:00
dependabot[bot]
8129bc37b3 Bump minimatch from 3.1.2 to 3.1.5
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5.
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.1.2...v3.1.5)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-version: 3.1.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-28 01:30:00 +00:00
dependabot[bot]
c09edd517c Bump rollup from 4.49.0 to 4.59.0
Bumps [rollup](https://github.com/rollup/rollup) from 4.49.0 to 4.59.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.49.0...v4.59.0)

---
updated-dependencies:
- dependency-name: rollup
  dependency-version: 4.59.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-28 01:29:59 +00:00
renovate[bot]
7442dd4dbd Update dependency axios to v1.13.6 2026-02-27 20:29:44 -05:00
renovate[bot]
8d1fbc12de Update dependency vue to v3.5.29 2026-02-27 20:28:55 -05:00
a515a2277b Update README.md 2026-02-23 21:26:17 -05:00
eeae328325 Move to a single container 2026-02-23 20:55:50 -05:00
renovate[bot]
bde91d13bf Update dependency @fontsource/roboto to v5.2.10 (#332) 2026-02-22 07:16:16 -05:00
renovate[bot]
0b938d5b02 Update dependency vue-router to v5.0.3 (#331)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-20 22:07:20 -05:00
9c348ee448 Wrap InfoOverlay in <tbody> 2026-02-20 19:19:23 -05:00
1769127342 Use dhi.io base images 2026-02-19 22:19:49 -05:00
19 changed files with 558 additions and 546 deletions

View File

@@ -1 +1,4 @@
backend
node_modules
dist
.git
.github

50
.github/workflows/publish-container.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
name: Publish Container
on:
push:
branches:
- main
pull_request:
schedule:
- cron: "0 0 * * 0"
jobs:
publish:
name: Publish rfd-fyi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Prepare
id: prep
run: |
IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/rfd-fyi
VERSION=${GITHUB_REF##*/}
if [[ $GITHUB_REF == refs/heads/main ]]; then
VERSION=latest
fi
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
fi
TAGS="${IMAGE_NAME}:${VERSION}"
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS,${IMAGE_NAME}:latest"
fi
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build / push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ steps.prep.outputs.tags }}

View File

@@ -1,87 +0,0 @@
name: Publish Containers
on:
push:
branches:
- main
pull_request:
jobs:
publish-backend:
name: Publish rfd-fyi-backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Prepare
id: prep
run: |
IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/rfd-fyi-backend
VERSION=${GITHUB_REF##*/}
if [[ $GITHUB_REF == refs/heads/main ]]; then
VERSION=latest
fi
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
fi
TAGS="${IMAGE_NAME}:${VERSION}"
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS,${IMAGE_NAME}:latest"
fi
echo ::set-output name=tags::${TAGS}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build / push
uses: docker/build-push-action@v6
with:
context: backend
file: ./backend/Dockerfile
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ steps.prep.outputs.tags }}
publish-frontend:
name: Publish rfd-fyi-frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Prepare
id: prep
run: |
IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/rfd-fyi-frontend
VERSION=${GITHUB_REF##*/}
if [[ $GITHUB_REF == refs/heads/main ]]; then
VERSION=latest
fi
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
fi
TAGS="${IMAGE_NAME}:${VERSION}"
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS,${IMAGE_NAME}:latest"
fi
echo ::set-output name=tags::${TAGS}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build / push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ steps.prep.outputs.tags }}

2
.gitignore vendored
View File

@@ -1,5 +1,5 @@
node_modules
dist
/dist
data/
backend/bin/
.vscode

View File

@@ -1,8 +0,0 @@
{
auto_https off
}
:80 {
file_server
reverse_proxy /api/* rfd-fyi-backend:8080
}

View File

@@ -1,20 +1,20 @@
FROM node:20.2.0-alpine3.16 as builder
# Build frontend
FROM dhi.io/node:25-debian13-dev AS frontend-builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
FROM caddy:2.10.2-alpine as runtime
# Build backend (with embedded frontend)
FROM dhi.io/golang:1.26-debian13-dev AS backend-builder
WORKDIR /src
COPY backend /src
COPY --from=frontend-builder /app/dist /src/dist
RUN CGO_ENABLED=0 go build -o rfd-fyi .
WORKDIR /my-site
COPY --from=builder /app/dist ./
COPY Caddyfile /etc/caddy/Caddyfile
FROM dhi.io/static:20251003-musl-alpine3.23 AS runtime
COPY --from=backend-builder /src/rfd-fyi /rfd-fyi
EXPOSE 8080
ENTRYPOINT ["/rfd-fyi"]

View File

@@ -15,7 +15,7 @@ help:
## backend: Build and run the backend from source
backend:
@cd backend && CGO_ENABLED=0 go run .
@cd backend && CGO_ENABLED=0 HTTP_PORT=8080 go run .
.PHONY: backend
## frontend: Build and run the frontend from source
@@ -23,20 +23,21 @@ frontend:
@npm run serve
.PHONY: frontend
## dev: Build and run in docker compose
## dev: Build and run in Docker
dev:
docker compose up --build -d
docker build -t rfd-fyi:dev .
docker run -d --name rfd-fyi -p 8080:8080 rfd-fyi:dev
.PHONY: dev
## prod: Run the latest images in docker compose
## prod: Run the latest image in Docker
prod:
@git pull
@docker pull ghcr.io/davegallant/rfd-fyi-backend
@docker pull ghcr.io/davegallant/rfd-fyi-frontend
@docker compose -f docker-compose.prod.yml up -d
@docker pull ghcr.io/davegallant/rfd-fyi
@docker run -d --name rfd-fyi -p 8080:8080 ghcr.io/davegallant/rfd-fyi
.PHONY: prod
## teardown: Teardown docker
## teardown: Teardown Docker
teardown:
docker compose down
docker stop rfd-fyi || true
docker rm rfd-fyi || true
.PHONY: teardown

View File

@@ -4,30 +4,30 @@ This repository provides a simple, less-distracting overlay for hot deals posted
The frontend is made with Vue 3 and the backend is written in Go. The backend exists for caching purposes; to prevent excessive requests to RedFlagDeals itself.
## Local Development
## Docker
To get up and running locally: in one pane/tab, run:
To run the latest:
```sh
make backend
docker run -d --name rfd-fyi -p 8080:8080 ghcr.io/davegallant/rfd-fyi
```
In another pane/tab, run:
```sh
make frontend
```
## Docker Compose
To build containers from source:
To build container from source:
```sh
make dev
```
To run the latest published images:
## Local Development
To get up and running locally: in one shell, run:
```sh
make prod
make backend
```
In another shell, run:
```sh
make frontend
```

View File

@@ -1,16 +0,0 @@
# syntax=docker/dockerfile:1.21
FROM cgr.dev/chainguard/go:latest AS build
WORKDIR /src
COPY . /src
RUN CGO_ENABLED=0 go build -o backend .
FROM cgr.dev/chainguard/static:latest
COPY --from=build /src/backend /backend
EXPOSE 8080
CMD [ "/backend" ]

View File

@@ -1,9 +1,11 @@
package main
import (
"embed"
"encoding/json"
"fmt"
"io"
"io/fs"
"math/rand/v2"
"net/http"
"net/url"
@@ -17,20 +19,8 @@ import (
"github.com/gorilla/mux"
)
// @title RFD FYI API
// @version 1.0
// @description An API for issue tracking
// @termsOfService http://swagger.io/terms/
// @contact.name API Support
// @contact.url https://linktr.ee/davegallant
// @contact.email davegallant@gmail.com
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
// @host localhost:8080
// @BasePath /api/v1
//go:embed dist/*
var frontendFS embed.FS
type App struct {
Router *mux.Router
@@ -48,22 +38,45 @@ type Redirect struct {
func (a *App) Initialize() {
a.BasePath = "/api/v1"
a.Router = mux.NewRouter().PathPrefix(a.BasePath).Subrouter()
http.Handle("/", a.Router)
a.Router = mux.NewRouter()
a.initializeRoutes()
}
func (a *App) Run(httpPort string) {
log.Info().Msgf("Serving requests on port " + httpPort)
if err := http.ListenAndServe(fmt.Sprintf(":"+httpPort), nil); err != nil {
if err := http.ListenAndServe(fmt.Sprintf(":%s", httpPort), a.Router); err != nil {
panic(err)
}
}
func (a *App) initializeRoutes() {
a.Router.HandleFunc("/topics", a.listTopics).Methods("GET")
a.Router.HandleFunc("/topics/{id}", a.getTopicDetails).Methods("GET")
a.Router.HandleFunc(a.BasePath+"/topics", a.listTopics).Methods("GET")
a.Router.HandleFunc(a.BasePath+"/topics/{id}", a.getTopicDetails).Methods("GET")
distFS, err := fs.Sub(frontendFS, "dist")
if err != nil {
panic(err)
}
fileServer := http.FileServer(http.FS(distFS))
a.Router.PathPrefix("/").Handler(spaHandler{staticHandler: fileServer, staticFS: distFS})
}
// spaHandler serves static files when they exist, otherwise falls back to
// index.html so that client-side routing works.
type spaHandler struct {
staticHandler http.Handler
staticFS fs.FS
}
func (h spaHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
path := strings.TrimPrefix(r.URL.Path, "/")
if path == "" {
path = "index.html"
}
if _, err := fs.Stat(h.staticFS, path); err != nil {
r.URL.Path = "/"
}
h.staticHandler.ServeHTTP(w, r)
}
// func respondWithError(w http.ResponseWriter, code int, message string) {

6
backend/dist/index.html vendored Normal file
View File

@@ -0,0 +1,6 @@
<!doctype html>
<html>
<body>
<p>Run the Vite dev server for the frontend.</p>
</body>
</html>

View File

@@ -11,21 +11,6 @@ import (
utils "github.com/davegallant/rfd-fyi/pkg/utils"
)
// @title RFD FYI API
// @version 1.0
// @description An API for an issue tracking service
// @termsOfService http://swagger.io/terms/
// @contact.name API Support
// @contact.url http://www.swagger.io/support
// @contact.email support@swagger.io
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
// @host localhost:8080
// @BasePath /api/v1
func main() {
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})

View File

@@ -1,16 +0,0 @@
services:
frontend:
image: ghcr.io/davegallant/rfd-fyi-frontend
ports:
- 80:80
- 443:443
links:
- "backend:backend"
volumes:
- ./data:/data
restart: always
backend:
image: ghcr.io/davegallant/rfd-fyi-backend
ports:
- 8080:8080
restart: always

View File

@@ -1,18 +0,0 @@
services:
frontend:
build:
dockerfile: Dockerfile
context: .
ports:
- 80:80
- 443:443
links:
- "backend:backend"
volumes:
- ./data:/data
backend:
build:
dockerfile: Dockerfile
context: backend
ports:
- 8080:8080

View File

@@ -14,21 +14,12 @@
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
# Node.js LTS with npm
nodejs_20
# Go for backend
nodejs_25
go
# Build tools
pkg-config
# Development utilities
git
curl
jq
# Optional: for better development experience
gnumake
];

699
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,7 @@
"lint": "eslint . --fix"
},
"dependencies": {
"@fontsource/roboto": "5.2.9",
"@fontsource/roboto": "5.2.10",
"@github/hotkey": "^3.0.0",
"@mdi/font": "7.4.47",
"@popperjs/core": "^2.11.8",
@@ -24,7 +24,7 @@
"devDependencies": {
"@babel/core": "^7.22.10",
"@babel/eslint-parser": "^7.22.10",
"@vitejs/plugin-vue": "^5.2.3",
"@vitejs/plugin-vue": "^6.0.0",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "^5.0.9",

View File

@@ -1,5 +1,4 @@
<script>
import InfoOverlay from "./components/InfoOverlay.vue";
import axios from "axios";
import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";

View File

@@ -7,26 +7,28 @@
</a>
<h3>Keyboard Shortcuts</h3>
<table class="shortcuts-table">
<tr>
<td><strong>r</strong></td>
<td>Refresh deals</td>
</tr>
<tr>
<td><strong>s</strong></td>
<td>Toggle sort</td>
</tr>
<tr>
<td><strong>v</strong></td>
<td>Toggle view mode</td>
</tr>
<tr>
<td><strong>t</strong></td>
<td>Toggle theme</td>
</tr>
<tr>
<td><strong>/</strong></td>
<td>Filter deals</td>
</tr>
<tbody>
<tr>
<td><strong>r</strong></td>
<td>Refresh deals</td>
</tr>
<tr>
<td><strong>s</strong></td>
<td>Toggle sort</td>
</tr>
<tr>
<td><strong>v</strong></td>
<td>Toggle view mode</td>
</tr>
<tr>
<td><strong>t</strong></td>
<td>Toggle theme</td>
</tr>
<tr>
<td><strong>/</strong></td>
<td>Filter deals</td>
</tr>
</tbody>
</table>
<button class="close-button" @click="closeOverlay">Close</button>
</div>