refactor: some feedback updates from coderabbit
This commit is contained in:
parent
e3d1386f6a
commit
a020bf5dca
6 changed files with 36 additions and 7 deletions
|
|
@ -4,9 +4,9 @@ npm-debug.log
|
||||||
.gitignore
|
.gitignore
|
||||||
README.md
|
README.md
|
||||||
.env
|
.env
|
||||||
|
.env.*
|
||||||
.nyc_output
|
.nyc_output
|
||||||
coverage
|
coverage
|
||||||
.nyc_output
|
|
||||||
.vscode
|
.vscode
|
||||||
.DS_Store
|
.DS_Store
|
||||||
dist
|
dist
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# Multi-stage build for production
|
# Multi-stage build for production
|
||||||
FROM node:18-alpine AS build-stage
|
FROM node:20-alpine AS build-stage
|
||||||
|
|
||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
@ -8,7 +8,8 @@ WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN npm ci
|
#ENV NODE_ENV=production
|
||||||
|
RUN npm ci --no-audit --no-fund
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
@ -29,4 +30,5 @@ COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
# Start nginx
|
# Start nginx
|
||||||
|
HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD wget -qO- http://localhost/healthz >/dev/null 2>&1 || exit 1
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
25
nginx.conf
25
nginx.conf
|
|
@ -5,22 +5,45 @@ events {
|
||||||
http {
|
http {
|
||||||
include /etc/nginx/mime.types;
|
include /etc/nginx/mime.types;
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
|
sendfile on;
|
||||||
|
etag on;
|
||||||
|
gzip on;
|
||||||
|
gzip_comp_level 5;
|
||||||
|
gzip_min_length 1024;
|
||||||
|
gzip_types
|
||||||
|
text/plain text/css application/json application/javascript
|
||||||
|
text/xml application/xml application/xml+rss image/svg+xml;
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name localhost;
|
server_name _;
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
|
add_header X-Frame-Options "DENY" always;
|
||||||
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||||
|
add_header Permissions-Policy "geolocation=(), microphone=(), camera=()" always;
|
||||||
|
|
||||||
# Handle client-side routing
|
# Handle client-side routing
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location = /index.html {
|
||||||
|
add_header Cache-Contrl "no-store, no-cache, must-revalidate";
|
||||||
|
expires -1;
|
||||||
|
}
|
||||||
|
|
||||||
# Cache static assets
|
# Cache static assets
|
||||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
||||||
expires 1y;
|
expires 1y;
|
||||||
add_header Cache-Control "public, immutable";
|
add_header Cache-Control "public, immutable";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location = healthz {
|
||||||
|
default_type text/plain;
|
||||||
|
return 200 'ok';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -113,7 +113,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="signup-prompt">
|
<div class="signup-prompt">
|
||||||
<p>Don't have an account? <a href="/signup" class="signup-link">Sign up</a></p>
|
<p>Don't have an account? <router-link to="/signup" class="signup-link">Sign up</router-link></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,7 @@
|
||||||
:class="{ 'error': error && !email }"
|
:class="{ 'error': error && !email }"
|
||||||
placeholder="Enter your email"
|
placeholder="Enter your email"
|
||||||
required
|
required
|
||||||
|
autocomplete="email"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -100,6 +101,7 @@
|
||||||
:class="{ 'error': error && !password }"
|
:class="{ 'error': error && !password }"
|
||||||
placeholder="Create a password"
|
placeholder="Create a password"
|
||||||
required
|
required
|
||||||
|
autocomplete="new-password"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|
@ -135,6 +137,7 @@
|
||||||
:class="{ 'error': error && !confirmPassword || passwordMismatch }"
|
:class="{ 'error': error && !confirmPassword || passwordMismatch }"
|
||||||
placeholder="Confirm your password"
|
placeholder="Confirm your password"
|
||||||
required
|
required
|
||||||
|
autocomplete="new-password"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|
@ -210,7 +213,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="login-prompt">
|
<div class="login-prompt">
|
||||||
<p>Already have an account? <a href="/login" class="login-link">Sign in</a></p>
|
<p>Already have an account? <router-link to="/login" class="login-link">Sign In</router-link></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -277,6 +280,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isFormValid() {
|
isFormValid() {
|
||||||
|
const emailOk = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(this.email);
|
||||||
return this.firstName &&
|
return this.firstName &&
|
||||||
this.lastName &&
|
this.lastName &&
|
||||||
this.username &&
|
this.username &&
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
const { defineConfig } = require('@vue/cli-service')
|
const { defineConfig } = require('@vue/cli-service')
|
||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
transpileDependencies: true,
|
transpileDependencies: true,
|
||||||
lintOnSave: true
|
lintOnSave: process.env.NODE_ENV !== 'production'
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue