Skip to content

Commit b1dd1bc

Browse files
authored
Merge pull request #1 from ComputerScienceHouse/weather-dev
initial commit
2 parents fd01c8c + 4f58a71 commit b1dd1bc

39 files changed

Lines changed: 4177 additions & 0 deletions

‎.air.toml‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#:schema https://json.schemastore.org/any.json
2+
3+
env_files = [".env", ".env.air"]
4+
root = "."
5+
testdata_dir = "testdata"
6+
tmp_dir = "tmp"
7+
8+
[build]
9+
args_bin = []
10+
bin = "./tmp/main"
11+
cmd = "go build -o ./tmp/main ."
12+
delay = 1000
13+
entrypoint = ["./tmp/main"]
14+
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
15+
exclude_file = []
16+
exclude_regex = ["_test.go"]
17+
exclude_unchanged = false
18+
follow_symlink = false
19+
full_bin = ""
20+
ignore_dangerous_root_dir = false
21+
include_dir = []
22+
include_ext = ["go", "tpl", "tmpl", "html"]
23+
include_file = []
24+
kill_delay = "0s"
25+
log = "build-errors.log"
26+
poll = false
27+
poll_interval = 0
28+
post_cmd = []
29+
pre_cmd = []
30+
rerun = false
31+
rerun_delay = 500
32+
send_interrupt = false
33+
stop_on_error = false
34+
35+
[build.windows]
36+
args_bin = []
37+
bin = "tmp\\main.exe"
38+
cmd = "go build -o ./tmp/main.exe ."
39+
entrypoint = ["tmp\\main.exe"]
40+
full_bin = ""
41+
post_cmd = []
42+
pre_cmd = []
43+
44+
[color]
45+
app = ""
46+
build = "yellow"
47+
main = "magenta"
48+
mode = ""
49+
runner = "green"
50+
watcher = "cyan"
51+
52+
[log]
53+
main_only = false
54+
silent = false
55+
time = false
56+
57+
[misc]
58+
clean_on_exit = false
59+
60+
[proxy]
61+
app_port = 0
62+
app_start_timeout = 0
63+
enabled = false
64+
proxy_port = 0
65+
66+
[screen]
67+
clear_on_rebuild = false
68+
keep_scroll = true

‎.dockerignore‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
web/node_modules
2+
web/dist
3+
4+
node_modules
5+
dist
6+
7+
.git
8+
*.log

‎.env.air‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DEV_MODE=true

‎.env.template‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SERVER_HOST=http://localhost:8080
2+
3+
REDIS_URL=''
4+
5+
POSTGRES_ADDR=''
6+
POSTGRES_USER=''
7+
POSTGRES_PASSWORD=''
8+
9+
AUTH_OIDC_ID=''
10+
AUTH_OIDC_SECRET=''

‎Dockerfile‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
FROM node:22-alpine AS npmbuilder
2+
3+
WORKDIR /app
4+
5+
COPY web/package*.json ./
6+
7+
RUN npm ci
8+
9+
COPY web/ .
10+
11+
RUN npm run build
12+
13+
FROM golang:1.26.2-alpine AS gobuilder
14+
15+
WORKDIR /app
16+
17+
RUN apk add git
18+
RUN go install github.com/swaggo/swag/cmd/swag@latest
19+
20+
COPY go.* .
21+
RUN go mod download
22+
COPY internal internal
23+
24+
COPY *.go .
25+
COPY --from=npmbuilder /app/dist/ ./web/dist/
26+
27+
RUN /go/bin/swag init --parseInternal --parseDependency
28+
29+
RUN go build -o server .
30+
31+
FROM alpine:latest
32+
33+
RUN apk add --no-cache ffmpeg curl
34+
35+
WORKDIR /app
36+
COPY --from=gobuilder /app/server .
37+
38+
EXPOSE 8080
39+
40+
CMD ["./server"]
41+

‎docker-compose.yaml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
services:
2+
redis:
3+
image: redis:7
4+
container_name: csh-marks-redis
5+
ports:
6+
- "6379:6379"
7+
networks:
8+
- csh-marks-network
9+
10+
csh-marks:
11+
ports:
12+
- "8080:8080"
13+
env_file:
14+
- .env
15+
environment:
16+
- DEV_MODE=false
17+
networks:
18+
- csh-marks-network
19+
20+
networks:
21+
csh-marks-network:

‎docs/docs.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package docs

‎go.mod‎

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
module github.com/ComputerScienceHouse/marks
2+
3+
go 1.26.2
4+
5+
require (
6+
github.com/computersciencehouse/csh-auth/v2 v2.0.2
7+
github.com/gin-contrib/cors v1.7.7
8+
github.com/gin-gonic/gin v1.12.0
9+
github.com/jackc/pgx/v5 v5.10.0
10+
github.com/redis/go-redis/v9 v9.21.0
11+
github.com/sirupsen/logrus v1.9.4
12+
github.com/swaggo/files v1.0.1
13+
github.com/swaggo/gin-swagger v1.6.1
14+
)
15+
16+
require (
17+
github.com/KyleBanks/depth v1.2.1 // indirect
18+
github.com/bytedance/gopkg v0.1.4 // indirect
19+
github.com/bytedance/sonic v1.15.1 // indirect
20+
github.com/bytedance/sonic/loader v0.5.1 // indirect
21+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
22+
github.com/cloudwego/base64x v0.1.7 // indirect
23+
github.com/coreos/go-oidc/v3 v3.18.0 // indirect
24+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
25+
github.com/gabriel-vasile/mimetype v1.4.13 // indirect
26+
github.com/gin-contrib/sse v1.1.1 // indirect
27+
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
28+
github.com/go-openapi/jsonpointer v1.0.0 // indirect
29+
github.com/go-openapi/jsonreference v1.0.0 // indirect
30+
github.com/go-openapi/spec v0.22.6 // indirect
31+
github.com/go-openapi/swag/conv v0.27.0 // indirect
32+
github.com/go-openapi/swag/jsonname v0.27.0 // indirect
33+
github.com/go-openapi/swag/jsonutils v0.27.0 // indirect
34+
github.com/go-openapi/swag/loading v0.27.0 // indirect
35+
github.com/go-openapi/swag/stringutils v0.27.0 // indirect
36+
github.com/go-openapi/swag/typeutils v0.27.0 // indirect
37+
github.com/go-openapi/swag/yamlutils v0.27.0 // indirect
38+
github.com/go-playground/locales v0.14.1 // indirect
39+
github.com/go-playground/universal-translator v0.18.1 // indirect
40+
github.com/go-playground/validator/v10 v10.30.2 // indirect
41+
github.com/goccy/go-json v0.10.6 // indirect
42+
github.com/goccy/go-yaml v1.19.2 // indirect
43+
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
44+
github.com/jackc/pgpassfile v1.0.0 // indirect
45+
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
46+
github.com/jackc/puddle/v2 v2.2.2 // indirect
47+
github.com/json-iterator/go v1.1.12 // indirect
48+
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
49+
github.com/leodido/go-urn v1.4.0 // indirect
50+
github.com/mattn/go-isatty v0.0.22 // indirect
51+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
52+
github.com/modern-go/reflect2 v1.0.2 // indirect
53+
github.com/pelletier/go-toml/v2 v2.3.1 // indirect
54+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
55+
github.com/quic-go/qpack v0.6.0 // indirect
56+
github.com/quic-go/quic-go v0.59.0 // indirect
57+
github.com/swaggo/swag v1.16.6 // indirect
58+
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
59+
github.com/ugorji/go/codec v1.3.1 // indirect
60+
go.mongodb.org/mongo-driver/v2 v2.6.0 // indirect
61+
go.uber.org/atomic v1.11.0 // indirect
62+
go.yaml.in/yaml/v3 v3.0.4 // indirect
63+
golang.org/x/arch v0.27.0 // indirect
64+
golang.org/x/crypto v0.54.0 // indirect
65+
golang.org/x/mod v0.38.0 // indirect
66+
golang.org/x/net v0.57.0 // indirect
67+
golang.org/x/oauth2 v0.36.0 // indirect
68+
golang.org/x/sync v0.22.0 // indirect
69+
golang.org/x/sys v0.47.0 // indirect
70+
golang.org/x/text v0.40.0 // indirect
71+
golang.org/x/tools v0.48.0 // indirect
72+
google.golang.org/protobuf v1.36.11 // indirect
73+
)

0 commit comments

Comments
 (0)