Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
696ff40
Update gitignore
ahobsonsayers Jul 26, 2025
64f95ee
Initial FE commit
ahobsonsayers Aug 5, 2025
7cd7aa5
Remove unneeded config
ahobsonsayers Aug 6, 2025
3106bc8
shadcn init
ahobsonsayers Aug 6, 2025
948d339
Use prettier
ahobsonsayers Aug 12, 2025
5f2130a
Update prettier config
ahobsonsayers Aug 12, 2025
12af156
Run format
ahobsonsayers Aug 12, 2025
7d87186
Do some reorg
ahobsonsayers Aug 12, 2025
095448c
Add task
ahobsonsayers Aug 12, 2025
e19eb03
Add collapsible card
ahobsonsayers Aug 12, 2025
e4603e7
rename app.tsx
ahobsonsayers Aug 12, 2025
43a8d1f
Rename app.tsx again
ahobsonsayers Aug 12, 2025
55cba4a
Add collapsible card
ahobsonsayers Aug 12, 2025
fe5c5e4
Add new components
ahobsonsayers Aug 15, 2025
b03ab5c
Add theme provider
ahobsonsayers Aug 15, 2025
92dc4d3
Ad config type and provider
ahobsonsayers Aug 15, 2025
1fd922d
Use theme and config provider in App
ahobsonsayers Aug 15, 2025
90cfaf7
Add general settings section
ahobsonsayers Aug 25, 2025
0155150
Move general settings
ahobsonsayers Aug 25, 2025
3522c20
Add notification and global settings
ahobsonsayers Sep 4, 2025
52363ca
Add setting field
ahobsonsayers Sep 5, 2025
b1f5c52
add settings field
ahobsonsayers Sep 18, 2025
98469c3
Add global settings
ahobsonsayers Sep 19, 2025
4e7fdc8
Add ticket configuration
ahobsonsayers Sep 21, 2025
fda5f77
Create common settings and simply global and ticket settings
ahobsonsayers Sep 26, 2025
079a9f7
Formatting and linting
ahobsonsayers Sep 26, 2025
11c6107
Fix reset
ahobsonsayers Sep 26, 2025
ee58507
Rename files
ahobsonsayers Sep 26, 2025
14f0e06
Readd tickets config
ahobsonsayers Sep 26, 2025
aee984a
Use index as key (temporarily)
ahobsonsayers Sep 26, 2025
7ceb4de
Simplify ticket add and remove handlers
ahobsonsayers Sep 26, 2025
a56e923
Fix global and reset buttons
ahobsonsayers Sep 26, 2025
73eb076
Add linked notifier
ahobsonsayers Sep 26, 2025
cddd4d1
Improve global fallback wording
ahobsonsayers Sep 26, 2025
2691c6d
Use set in regions array
ahobsonsayers Sep 26, 2025
9b137d0
Move linked tooltip to component
ahobsonsayers Sep 26, 2025
2c5ff3d
Improve config field to be simpler
ahobsonsayers Sep 26, 2025
edaedd0
Fix config field rendering
ahobsonsayers Sep 26, 2025
3cae99a
Add save discard buttons to ticket config
ahobsonsayers Sep 26, 2025
b1e9500
Order tickets alphabetically
ahobsonsayers Sep 26, 2025
14f9cc1
Expand tickets config on new ticket added
ahobsonsayers Sep 27, 2025
1b84754
Update some naming
ahobsonsayers Sep 27, 2025
ffc93e0
Merge branch 'main' into ahs/add-frontend
ahobsonsayers Nov 26, 2025
a90e09c
Add types based on openapi
ahobsonsayers Nov 28, 2025
13c764a
Fis some linting
ahobsonsayers Nov 29, 2025
199cbcd
Fix update logic
ahobsonsayers Nov 29, 2025
0a71eff
Add save/discard to each section
ahobsonsayers Nov 29, 2025
d68d27e
Actually call api
ahobsonsayers Nov 29, 2025
3ffd5c3
Add alert on error
ahobsonsayers Nov 29, 2025
98b42f3
Restructuring
ahobsonsayers Nov 29, 2025
4ef13b4
Merge branch 'main' into ahs/add-frontend
ahobsonsayers Nov 29, 2025
f36b859
Update schema
ahobsonsayers Nov 29, 2025
47f3457
Unformat shadcn component
ahobsonsayers Nov 29, 2025
4f6d7cf
Serve frontend from go
ahobsonsayers Nov 30, 2025
39c361a
Fix FE url
ahobsonsayers Nov 30, 2025
a9623a8
Allow running fe and be independently in dev
ahobsonsayers Nov 30, 2025
76211ae
Rever lint change
ahobsonsayers Nov 30, 2025
a7c44bb
Use stop propagation to prevent collapsing
ahobsonsayers Nov 30, 2025
04a51cc
Merge branch 'main' into ahs/add-frontend
ahobsonsayers Nov 30, 2025
0fe67b1
Update taskfile
ahobsonsayers Nov 30, 2025
b40a982
Merge branch 'main' into ahs/add-frontend
ahobsonsayers Nov 30, 2025
7c73ac5
Remove assets
ahobsonsayers Nov 30, 2025
75d5ab5
Extract save discard buttons to own component
ahobsonsayers Nov 30, 2025
228117b
Make tickets card non collapsible
ahobsonsayers Nov 30, 2025
74cebce
Fix ticket save
ahobsonsayers Nov 30, 2025
234e125
Fix tickets map key
ahobsonsayers Nov 30, 2025
4fa1fb1
Support filtering tickets
ahobsonsayers Nov 30, 2025
46a3500
Update biome config
ahobsonsayers Nov 30, 2025
137c9a6
Add save alert box
ahobsonsayers Nov 30, 2025
52618ac
Fix FE lint
ahobsonsayers Nov 30, 2025
c106626
Add docker build
ahobsonsayers Nov 30, 2025
2ce9378
Add CI for frontend
ahobsonsayers Nov 30, 2025
23ff869
Fix CI runs
ahobsonsayers Nov 30, 2025
0d8e346
Update wording
ahobsonsayers Nov 30, 2025
6dfd4d8
Add frontend video
ahobsonsayers Nov 30, 2025
81b33e0
Set engines
ahobsonsayers Nov 30, 2025
2f8625d
Set packageManager
ahobsonsayers Nov 30, 2025
4bb5004
Split lint and test
ahobsonsayers Nov 30, 2025
49cdb27
Fix PR workflow
ahobsonsayers Nov 30, 2025
11d1983
Fix PR workflow again
ahobsonsayers Nov 30, 2025
29f83f8
Remove test from lint workflow
ahobsonsayers Nov 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Ignore certain directories
.git/
node_modules/

# Ignore certain files
Dockerfile*
docker-compose*
compose*
README*
43 changes: 21 additions & 22 deletions .github/workflows/lint-test.yaml → .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint and Test
name: Lint

on:
# Manual Invocation
Expand All @@ -7,12 +7,9 @@ on:
# Invocation from workflow
workflow_call:

env:
CI: true

jobs:
lint:
name: Lint
lint-be:
name: Lint Backend
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
Expand All @@ -31,8 +28,8 @@ jobs:
- name: Run lint
uses: golangci/golangci-lint-action@v8

test:
name: Test
lint-fe:
name: Lint Frontend
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
Expand All @@ -43,20 +40,22 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v5

- name: Setup go
uses: actions/setup-go@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
go-version-file: go.mod
package_json_file: frontend/package.json

- name: Setup task
uses: arduino/setup-task@v2
- name: Setup node
uses: actions/setup-node@v6
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Download dependencies
run: go mod download

- name: Run test
run: task test
env:
TWICKETS_API_KEY: ${{ secrets.TWICKETS_API_KEY }}
node-version-file: frontend/package.json
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml

- name: Install dependencies
working-directory: frontend
run: pnpm install

- name: Run lint
working-directory: frontend
run: pnpm run lint
13 changes: 9 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,20 @@ on:
- main

jobs:
lint-test:
name: Lint and Test
uses: ./.github/workflows/lint-test.yaml
lint:
name: Lint
uses: ./.github/workflows/lint.yaml
secrets: inherit

test:
name: Test
uses: ./.github/workflows/test.yaml
secrets: inherit

build-push:
name: Build and Push
uses: ./.github/workflows/build-push.yaml
needs: [lint-test]
needs: [lint, test]
secrets: inherit
with:
ref: ${{ github.sha }}
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ on:
- main

jobs:
lint-test:
name: Lint and Test
uses: ./.github/workflows/lint-test.yaml
lint:
name: Lint
uses: ./.github/workflows/lint.yaml
secrets: inherit

test:
name: Test
uses: ./.github/workflows/test.yaml
secrets: inherit
35 changes: 35 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

on:
# Manual Invocation
workflow_dispatch:

# Invocation from workflow
workflow_call:

jobs:
test-backend:
name: Test Backend
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
shell: bash

steps:
- name: Checkout repo
uses: actions/checkout@v5

- name: Setup go
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Install dependencies
run: go mod download

- name: Run test
run: go test ./...
env:
TWICKETS_API_KEY: ${{ secrets.TWICKETS_API_KEY }}
CI: true
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ web_modules/
# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.*
!.env.example

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "0.2.0",
"configurations": [
{
"name": "Twitchets",
"name": "Backend",
"type": "go",
"request": "launch",
"mode": "auto",
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"go.toolsManagement.autoUpdate": true,
"go.buildTags": "",

// ---- Javascript Settings ----
"biome.configurationPath": "frontend/biome.json",

// Code Spell Checker
"cSpell.words": ["twickets", "unmarshaller"]
}
34 changes: 27 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,43 @@
# Builder Image
FROM golang:1.24 AS builder
# Frontend builder Image
FROM node:25-slim AS frontend-builder

WORKDIR /twitchets
WORKDIR /app

# Setup pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

# Install dependencies
COPY ./frontend/package.json .
COPY ./frontend/pnpm-lock.yaml .
RUN pnpm install --prod --frozen-lockfile

# Build
COPY ./frontend .
RUN pnpm run build

# Backend builder Image
FROM golang:1.24 AS backend-builder

WORKDIR /app

# Install dependencies
COPY go.mod go.sum ./
RUN go mod download

# Build
COPY . .
COPY --from=frontend-builder /app/dist ./frontend/dist
RUN go build -v -o ./bin/ .

# Distribution Image
FROM alpine:latest

RUN apk add --no-cache libc6-compat

COPY --from=builder /twitchets/bin/twitchets /usr/bin/twitchets

WORKDIR /twitchets
COPY --from=backend-builder /app/bin/twitchets /usr/bin/twitchets

EXPOSE 5656
EXPOSE 9000

ENTRYPOINT ["/usr/bin/twitchets"]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Powered by [twigots](https://github.com/ahobsonsayers/twigots), a Go package to
- No need to have the Twickets app or an account
- Choose from various notification services (Telegram, Ntfy, Gotify currently supported)

### And a fancy configuration UI!

![frontend](assets/frontend.mp4)

## Getting an API Key

To use this tool, you will need a Twickets API key. Although Twickets doesn't provide a free API, you can easily obtain a key by following these steps:
Expand Down
49 changes: 46 additions & 3 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,48 @@ version: "3"

tasks:
format:
- task: format:be
- task: format:fe

format:be:
cmds:
- go tool gofumpt -l -w .

lint:
format:fe:
dir: frontend
cmds:
- pnpm run format

lint:be:
cmds:
- go tool golangci-lint run --fix ./...

lint:
- task: lint:be
- task: lint:fe

lint:fe:
dir: frontend
cmds:
- pnpm run lint

generate:
- task: build:be
- task: build:fe

generate:be:
aliases:
- gen
- gen:be
cmds:
- go generate ./...

generate:fe:
dir: frontend
aliases:
- gen:fe
cmds:
- pnpm run generate

test:
cmds:
- go test ./...
Expand All @@ -26,17 +55,31 @@ tasks:
- task: test

build:
- task: build:fe
- task: build:be

build:be:
cmds:
- go build -v -o ./bin/ .

build:fe:
dir: frontend
cmds:
- run build

build:docker:
cmds:
- docker build . -t arranhs/twitchets

run:
run:be:
cmds:
- go run .

run:fe:
dir: frontend
cmds:
- pnpm run dev

run:docker:
deps: [build:docker]
cmds:
Expand Down
Binary file added assets/frontend.mp4
Binary file not shown.
4 changes: 2 additions & 2 deletions config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ global:
regions:
- GBLO # London only

# Event name similarity matching (0.0 - 1.0)
# Required event name similarity (0.0 - 1.0)
# Default: 0.9 (allows for minor naming differences)
eventSimilarity: 0.9

# Minimum number of tickets required in listing
# Required Number of tickets
# Default: Any number of tickets
numTickets: 2 # Exactly two tickets

Expand Down
2 changes: 2 additions & 0 deletions frontend/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# API Base URL is set in development so it take priority over window.location.origin
VITE_API_BASE_URL=http://localhost:9000/api
2 changes: 2 additions & 0 deletions frontend/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# API Base URL is not set in production so window.location.origin is used
VITE_API_BASE_URL=
5 changes: 5 additions & 0 deletions frontend/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore certain directories
src/components/ui/

# Ignore certain files
src/types/openapi.d.ts
10 changes: 10 additions & 0 deletions frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"tailwindStylesheet": "./frontend/src/index.css",
"plugins": [
"@trivago/prettier-plugin-sort-imports",
"prettier-plugin-tailwindcss"
]
}
23 changes: 23 additions & 0 deletions frontend/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://biomejs.dev/schemas/2.1.3/schema.json",
"files": {
"includes": ["**", "!src/components/ui", "!dist"],
"ignoreUnknown": true
},
"formatter": {
"enabled": false
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"assist": {
"actions": {
"source": {
"organizeImports": "off"
}
}
}
}
Loading