-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added file upload to add modal * Add PWA manifest Added more filter options for data table Minor padding issues for jobid page * Added status update to main job table * Dynamic height for edit modal * Dynamic height for edit modal * Dynamic height for edit modal * Dynamic height for edit modal * Added stats endpoint * Added stats page Fixed extension not scrolling to top when capturing * Added alert for invalid captures Added pre-filled url to extension add page * Added remove fixed classes on screenshot Added token renewal to extension on visibility change * Updated stat logic * Refactored project structure * Updated actions to work with new structure * Upped pnpm github action version
- Loading branch information
Showing
32 changed files
with
368 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,5 +42,5 @@ jobs: | |
go-version: 1.22.0 | ||
|
||
- name: Test | ||
run: go test -v . | ||
run: go test ./tests -v | ||
working-directory: backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
root = "." | ||
testdata_dir = "testdata" | ||
tmp_dir = "tmp" | ||
|
||
[build] | ||
args_bin = [] | ||
bin = "./main" | ||
cmd = "make build" | ||
delay = 1000 | ||
exclude_dir = ["assets", "tmp", "vendor", "testdata"] | ||
exclude_file = [] | ||
exclude_regex = ["_test.go"] | ||
exclude_unchanged = false | ||
follow_symlink = false | ||
full_bin = "" | ||
include_dir = [] | ||
include_ext = ["go", "tpl", "tmpl", "html"] | ||
include_file = [] | ||
kill_delay = "0s" | ||
log = "build-errors.log" | ||
poll = false | ||
poll_interval = 0 | ||
post_cmd = [] | ||
pre_cmd = [] | ||
rerun = false | ||
rerun_delay = 500 | ||
send_interrupt = false | ||
stop_on_error = false | ||
|
||
[color] | ||
app = "" | ||
build = "yellow" | ||
main = "magenta" | ||
runner = "green" | ||
watcher = "cyan" | ||
|
||
[log] | ||
main_only = false | ||
time = false | ||
|
||
[misc] | ||
clean_on_exit = false | ||
|
||
[screen] | ||
clear_on_rebuild = false | ||
keep_scroll = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
screenshot.png | ||
fb-admin-service-account-key.json | ||
.env | ||
main | ||
main | ||
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Simple Makefile for a Go project | ||
|
||
# Build the application | ||
all: build | ||
|
||
build: | ||
@echo "Building..." | ||
|
||
@go build -o main cmd/api/main.go | ||
|
||
# Run the application | ||
run: | ||
@go run cmd/api/main.go | ||
|
||
lint: | ||
@golangci-lint run | ||
|
||
# # Create DB container | ||
# docker-run: | ||
# @if docker compose up 2>/dev/null; then \ | ||
# : ; \ | ||
# else \ | ||
# echo "Falling back to Docker Compose V1"; \ | ||
# docker-compose up; \ | ||
# fi | ||
|
||
# # Shutdown DB container | ||
# docker-down: | ||
# @if docker compose down 2>/dev/null; then \ | ||
# : ; \ | ||
# else \ | ||
# echo "Falling back to Docker Compose V1"; \ | ||
# docker-compose down; \ | ||
# fi | ||
|
||
# Test the application | ||
test: | ||
@echo "Testing..." | ||
@go test ./tests -v | ||
|
||
# Clean the binary | ||
clean: | ||
@echo "Cleaning..." | ||
@rm -f main | ||
|
||
# Live Reload | ||
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/cosmtrek/air@latest; \ | ||
air; \ | ||
echo "Watching...";\ | ||
else \ | ||
echo "You chose not to install air. Exiting..."; \ | ||
exit 1; \ | ||
fi; \ | ||
fi | ||
|
||
.PHONY: all build run test clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
backend/models/responses/stats.go → backend/internal/models/responses/stats.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package server | ||
|
||
import ( | ||
"net/http" | ||
) | ||
|
||
// RegisterRouters sets up the routes and middleware for the server. | ||
// It returns an http.Handler that can be used with http.Server. | ||
func (s *Server) RegisterRouters() http.Handler { | ||
mux := http.NewServeMux() | ||
// Unauthenticated routes | ||
mux.Handle("/healthz/", http.StripPrefix("/healthz", s.addHealthRoutes())) | ||
|
||
// Job routes. Require authentication. | ||
mux.Handle("/jobs/", http.StripPrefix("/jobs", s.addJobRoutes())) | ||
|
||
var handler http.Handler = mux | ||
handler = cors(s.config.ClientAddress, handler) | ||
|
||
return handler | ||
} | ||
|
||
// AddHealthRoutes adds the health routes to the provided http.ServeMux. | ||
// All health routes are prefixed with "/healthz". | ||
// TODO: Make this more useful by pinging db, etc. | ||
func (s *Server) addHealthRoutes() http.Handler { | ||
mux := http.NewServeMux() | ||
mux.HandleFunc("GET /", func(w http.ResponseWriter, r *http.Request) { | ||
encode(w, r, http.StatusOK, "ok") | ||
}) | ||
|
||
return mux | ||
} | ||
|
||
// AddJobRoutes adds the job routes to the provided http.ServeMux. | ||
// All job routes are prefixed with "/jobs". | ||
func (s *Server) addJobRoutes() http.Handler { | ||
mux := http.NewServeMux() | ||
mux.Handle("GET /", handleAllJobsGet(s.jobService)) | ||
mux.Handle("GET /{jobId}", handleJobGet(s.jobService)) | ||
mux.Handle("POST /", handleJobPost(s.jobService)) | ||
mux.Handle("PATCH /{jobId}", handleJobPatch(s.jobService)) | ||
mux.Handle("DELETE /{jobId}", handleJobDelete(s.jobService)) | ||
mux.Handle("GET /stats", handleStatsGet(s.jobService)) | ||
|
||
var handler http.Handler = mux | ||
handler = userContext(s.authService, handler) | ||
|
||
return handler | ||
} |
Oops, something went wrong.