Skip to content

Commit 3eafe30

Browse files
committed
refactor: overhaul hash web app architecture, ui, performance, and deployment
1 parent acc863f commit 3eafe30

23 files changed

Lines changed: 1565 additions & 3951 deletions

.dockerignore

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

.github/workflows/release.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,13 @@ jobs:
7171
path: .
7272

7373
- name: Create GitHub Release
74-
id: create_release
75-
uses: actions/create-release@v1
76-
env:
77-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
uses: softprops/action-gh-release@v2
7875
with:
7976
tag_name: ${{ github.event.inputs.version }}
80-
release_name: ${{ github.event.inputs.version }}-${{ needs.package.outputs.release_date }}
77+
name: ${{ github.event.inputs.version }}-${{ needs.package.outputs.release_date }}
8178
body_path: notes.md
79+
files: ${{ needs.package.outputs.artifact_name }}
8280
draft: false
8381
prerelease: false
84-
85-
- name: Upload Release ZIP
86-
uses: actions/upload-release-asset@v1
8782
env:
8883
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89-
with:
90-
upload_url: ${{ steps.create_release.outputs.upload_url }}
91-
asset_path: ${{ needs.package.outputs.artifact_name }}
92-
asset_name: ${{ needs.package.outputs.artifact_name }}
93-
asset_content_type: application/zip

.gitignore

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,19 @@ yarn-error.log*
77
pnpm-debug.log*
88
lerna-debug.log*
99

10-
node_modules
11-
dist
12-
dist-ssr
10+
# Node
11+
node_modules/
12+
13+
# Build
14+
dist/
15+
dist-ssr/
1316
*.local
1417

18+
# Environment
19+
.env
20+
.env.*
21+
!.env.example
22+
1523
# Editor directories and files
1624
.vscode/*
1725
!.vscode/extensions.json
@@ -22,3 +30,13 @@ dist-ssr
2230
*.njsproj
2331
*.sln
2432
*.sw?
33+
34+
# Caches
35+
.eslintcache
36+
.stylelintcache
37+
.npm
38+
39+
# Hosting / Deployment
40+
.vercel/
41+
.netlify/
42+
.output/

Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Stage 1: Build
2+
FROM node:20-alpine AS builder
3+
4+
WORKDIR /app
5+
COPY package*.json ./
6+
RUN npm ci
7+
8+
COPY . .
9+
RUN npm run build
10+
11+
# Stage 2: Serve
12+
FROM nginx:alpine
13+
14+
# Remove default nginx static assets
15+
RUN rm -rf /usr/share/nginx/html/*
16+
17+
# Copy build artifacts
18+
COPY --from=builder /app/dist /usr/share/nginx/html
19+
20+
# Custom nginx config for SPA routing and caching
21+
RUN echo 'server { \
22+
listen 80; \
23+
location / { \
24+
root /usr/share/nginx/html; \
25+
index index.html index.htm; \
26+
try_files $uri $uri/ /index.html; \
27+
} \
28+
location /assets/ { \
29+
root /usr/share/nginx/html; \
30+
expires 1y; \
31+
add_header Cache-Control "public, max-age=31536000, immutable"; \
32+
} \
33+
}' > /etc/nginx/conf.d/default.conf
34+
35+
EXPOSE 80
36+
CMD ["nginx", "-g", "daemon off;"]

index.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" href="/layers.png" type="image/png" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>File Hasher - Hash Generator</title>
7+
8+
<!-- Google Fonts: Inter, Outfit, & JetBrains Mono -->
9+
<link rel="preconnect" href="https://fonts.googleapis.com">
10+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&family=Outfit:wght@500;600;700&display=swap" rel="stylesheet">
12+
13+
<title>File Hasher - Developer Tools</title>
814
<meta
915
name="description"
10-
content="Generate secure hashes using popular algorithms like MD5, SHA-1, SHA-256, SHA-512, and SHA-3. Fast, secure, and works entirely in your browser."
11-
/>
12-
<meta
13-
name="keywords"
14-
content="hash generator, MD5, SHA-1, SHA-256, SHA-512, SHA-3, cryptography, security"
16+
content="Generate secure hashes (MD5, SHA-1, SHA-256, SHA-512, SHA-3) blazing fast locally in your browser. Supports large files up to 100MB."
1517
/>
18+
<meta name="theme-color" content="#000000" media="(prefers-color-scheme: dark)" />
19+
<meta name="theme-color" content="#FAFAFA" media="(prefers-color-scheme: light)" />
1620
</head>
1721
<body>
1822
<div id="app"></div>

netlify.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[build]
2+
publish = "dist"
3+
command = "npm run build"
4+
5+
[[headers]]
6+
for = "/assets/*"
7+
[headers.values]
8+
Cache-Control = "public, max-age=31536000, immutable"
9+
10+
[[redirects]]
11+
from = "/*"
12+
to = "/index.html"
13+
status = 200

0 commit comments

Comments
 (0)