refactor: rename site to frontend

This commit is contained in:
Stavros
2025-03-23 13:07:53 +02:00
parent 187e46eae5
commit d82e959734
88 changed files with 53 additions and 53 deletions

View File

@@ -26,17 +26,17 @@ jobs:
- name: Install frontend dependencies - name: Install frontend dependencies
run: | run: |
cd site cd frontend
bun install bun install
- name: Build frontend - name: Build frontend
run: | run: |
cd site cd frontend
bun run build bun run build
- name: Copy frontend - name: Copy frontend
run: | run: |
cp -r site/dist internal/assets/dist cp -r frontend/dist internal/assets/dist
- name: Run tests - name: Run tests
run: go test -v ./... run: go test -v ./...

View File

@@ -29,7 +29,7 @@ go mod tidy
You also need to download the frontend dependencies, this can be done like so: You also need to download the frontend dependencies, this can be done like so:
```sh ```sh
cd site/ cd frontend/
bun install bun install
``` ```

View File

@@ -1,22 +1,22 @@
# Site builder # Site builder
FROM oven/bun:1.1.45-alpine AS site-builder FROM oven/bun:1.1.45-alpine AS frontend-builder
WORKDIR /site WORKDIR /frontend
COPY ./site/package.json ./ COPY ./frontend/package.json ./
COPY ./site/bun.lockb ./ COPY ./frontend/bun.lockb ./
RUN bun install RUN bun install
COPY ./site/public ./public COPY ./frontend/public ./public
COPY ./site/src ./src COPY ./frontend/src ./src
COPY ./site/eslint.config.js ./ COPY ./frontend/eslint.config.js ./
COPY ./site/index.html ./ COPY ./frontend/index.html ./
COPY ./site/tsconfig.json ./ COPY ./frontend/tsconfig.json ./
COPY ./site/tsconfig.app.json ./ COPY ./frontend/tsconfig.app.json ./
COPY ./site/tsconfig.node.json ./ COPY ./frontend/tsconfig.node.json ./
COPY ./site/vite.config.ts ./ COPY ./frontend/vite.config.ts ./
COPY ./site/postcss.config.cjs ./ COPY ./frontend/postcss.config.cjs ./
RUN bun run build RUN bun run build
@@ -33,7 +33,7 @@ RUN go mod download
COPY ./main.go ./ COPY ./main.go ./
COPY ./cmd ./cmd COPY ./cmd ./cmd
COPY ./internal ./internal COPY ./internal ./internal
COPY --from=site-builder /site/dist ./internal/assets/dist COPY --from=frontend-builder /frontend/dist ./internal/assets/dist
RUN CGO_ENABLED=0 go build -ldflags "-s -w" RUN CGO_ENABLED=0 go build -ldflags "-s -w"

View File

@@ -1,5 +1,5 @@
<div align="center"> <div align="center">
<img alt="Tinyauth" title="Tinyauth" width="256" src="site/public/logo.png"> <img alt="Tinyauth" title="Tinyauth" width="256" src="frontend/public/logo.png">
<h1>Tinyauth</h1> <h1>Tinyauth</h1>
<p>The easiest way to secure your apps with a login screen.</p> <p>The easiest way to secure your apps with a login screen.</p>
</div> </div>

View File

@@ -14,7 +14,7 @@
}, },
"timestamp": "2025-03-10T19:00:00.000Z", "timestamp": "2025-03-10T19:00:00.000Z",
"thumbnail": { "thumbnail": {
"url": "https://github.com/steveiliop56/tinyauth/blob/main/site/public/logo.png?raw=true" "url": "https://github.com/steveiliop56/tinyauth/blob/main/frontend/public/logo.png?raw=true"
} }
} }
], ],

View File

@@ -6,7 +6,7 @@
files: files:
[ [
{ {
"source": "/site/src/lib/i18n/locales/en.json", "source": "/frontend/src/lib/i18n/locales/en.json",
"translation": "/site/src/lib/i18n/locales/%locale%.json", "translation": "/frontend/src/lib/i18n/locales/%locale%.json",
}, },
] ]

View File

@@ -21,9 +21,9 @@ services:
container_name: tinyauth-frontend container_name: tinyauth-frontend
build: build:
context: . context: .
dockerfile: site/Dockerfile.dev dockerfile: frontend/Dockerfile.dev
volumes: volumes:
- ./site/src:/site/src - ./frontend/src:/frontend/src
ports: ports:
- 5173:5173 - 5173:5173
labels: labels:

23
frontend/Dockerfile.dev Normal file
View File

@@ -0,0 +1,23 @@
FROM oven/bun:1.1.45-alpine
WORKDIR /frontend
COPY ./frontend/package.json ./
COPY ./frontend/bun.lockb ./
RUN bun install
COPY ./frontend/public ./public
COPY ./frontend/src ./src
COPY ./frontend/eslint.config.js ./
COPY ./frontend/index.html ./
COPY ./frontend/tsconfig.json ./
COPY ./frontend/tsconfig.app.json ./
COPY ./frontend/tsconfig.node.json ./
COPY ./frontend/vite.config.ts ./
COPY ./frontend/postcss.config.cjs ./
EXPOSE 5173
ENTRYPOINT ["bun", "run", "dev"]

View File

@@ -6,7 +6,7 @@
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" /> <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" /> <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" /> <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" /> <link rel="manifest" href="/frontend.webmanifest" />
<title>Tinyauth</title> <title>Tinyauth</title>
</head> </head>
<body> <body>

View File

@@ -1,11 +1,11 @@
{ {
"name": "site", "name": "frontend",
"version": "0.0.0", "version": "0.0.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "site", "name": "frontend",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"@mantine/core": "^7.16.0", "@mantine/core": "^7.16.0",
@@ -2246,4 +2246,4 @@
} }
} }
} }
} }

View File

@@ -1,5 +1,5 @@
{ {
"name": "site", "name": "frontend",
"private": true, "private": true,
"version": "0.0.0", "version": "0.0.0",
"type": "module", "type": "module",
@@ -42,4 +42,4 @@
"typescript-eslint": "^8.18.2", "typescript-eslint": "^8.18.2",
"vite": "^6.0.5" "vite": "^6.0.5"
} }
} }

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 602 B

After

Width:  |  Height:  |  Size: 602 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -1,23 +0,0 @@
FROM oven/bun:1.1.45-alpine
WORKDIR /site
COPY ./site/package.json ./
COPY ./site/bun.lockb ./
RUN bun install
COPY ./site/public ./public
COPY ./site/src ./src
COPY ./site/eslint.config.js ./
COPY ./site/index.html ./
COPY ./site/tsconfig.json ./
COPY ./site/tsconfig.app.json ./
COPY ./site/tsconfig.node.json ./
COPY ./site/vite.config.ts ./
COPY ./site/postcss.config.cjs ./
EXPOSE 5173
ENTRYPOINT ["bun", "run", "dev"]