-
Notifications
You must be signed in to change notification settings - Fork 0
Front end #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Front end #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| .DS_Store | ||
| node_modules | ||
| /dist | ||
|
|
||
|
|
||
| # local env files | ||
| .env.local | ||
| .env.*.local | ||
|
|
||
| # Log files | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
|
|
||
| # Editor directories and files | ||
| .idea | ||
| .vscode | ||
| *.suo | ||
| *.ntvs* | ||
| *.njsproj | ||
| *.sln | ||
| *.sw? |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,8 @@ | ||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||
| "tabWidth": 2, | ||||||||||||||||||||||||||||||||||||
| "useTabs": false, | ||||||||||||||||||||||||||||||||||||
| "semi": true, | ||||||||||||||||||||||||||||||||||||
| "singleQuote": false, | ||||||||||||||||||||||||||||||||||||
| "printWidth": 100, | ||||||||||||||||||||||||||||||||||||
| "arrayExpand": true | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Invalid Prettier option detected Proposed fix: {
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
- "arrayExpand": true
+ // Removed invalid option; consider adding a valid one, e.g.:
+ "trailingComma": "es5",
"printWidth": 100
}📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,47 @@ | ||||||||||||||||||||||||||||||
| # # Build stage | ||||||||||||||||||||||||||||||
| # FROM node:16 as build-stage | ||||||||||||||||||||||||||||||
| # WORKDIR /app | ||||||||||||||||||||||||||||||
| # COPY package*.json ./ | ||||||||||||||||||||||||||||||
| # RUN yarn | ||||||||||||||||||||||||||||||
| # COPY . . | ||||||||||||||||||||||||||||||
| # RUN yarn build | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # # Production stage | ||||||||||||||||||||||||||||||
| # FROM nginx:stable-alpine as production-stage | ||||||||||||||||||||||||||||||
| # COPY --from=build-stage /app/dist /usr/share/nginx/html | ||||||||||||||||||||||||||||||
| # COPY nginx.conf /etc/nginx/conf.d/default.conf | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # # Create a startup script | ||||||||||||||||||||||||||||||
| # RUN echo '#!/bin/sh' > /docker-entrypoint.d/00-update-port.sh && \ | ||||||||||||||||||||||||||||||
| # echo 'sed -i "s/listen 8080/listen $PORT/g" /etc/nginx/conf.d/default.conf' >> /docker-entrypoint.d/00-update-port.sh && \ | ||||||||||||||||||||||||||||||
| # chmod +x /docker-entrypoint.d/00-update-port.sh | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # EXPOSE 8080 | ||||||||||||||||||||||||||||||
| # CMD ["nginx", "-g", "daemon off;"] | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Build stage | ||||||||||||||||||||||||||||||
| FROM node:16 as build-stage | ||||||||||||||||||||||||||||||
| WORKDIR /app | ||||||||||||||||||||||||||||||
| COPY package*.json ./ | ||||||||||||||||||||||||||||||
| RUN yarn | ||||||||||||||||||||||||||||||
| COPY . . | ||||||||||||||||||||||||||||||
| RUN yarn build | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
Comment on lines
+22
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Update Node.js version for security and performance Node.js 16 has reached end-of-life status. Upgrade to a more recent LTS version such as Node.js 18 or 20 for better security and performance. # Build stage
-FROM node:16 as build-stage
+FROM node:20 as build-stage
WORKDIR /app
COPY package*.json ./
RUN yarn
COPY . .
RUN yarn build📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||
| # Production stage | ||||||||||||||||||||||||||||||
| FROM nginx:stable-alpine as production-stage | ||||||||||||||||||||||||||||||
| COPY --from=build-stage /app/dist /usr/share/nginx/html | ||||||||||||||||||||||||||||||
| COPY nginx.conf /etc/nginx/conf.d/default.conf | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Add a startup script for debugging | ||||||||||||||||||||||||||||||
| RUN echo '#!/bin/sh' > /start.sh && \ | ||||||||||||||||||||||||||||||
| echo 'echo "Starting nginx with PORT=$PORT"' >> /start.sh && \ | ||||||||||||||||||||||||||||||
| echo 'cat /etc/nginx/conf.d/default.conf' >> /start.sh && \ | ||||||||||||||||||||||||||||||
| echo 'nginx -g "daemon off;"' >> /start.sh && \ | ||||||||||||||||||||||||||||||
| chmod +x /start.sh | ||||||||||||||||||||||||||||||
|
Comment on lines
+35
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: The debugging script prints the PORT variable but never uses it to configure nginx. This will cause nginx to always use port 8080 regardless of PORT env var.
Suggested change
Comment on lines
+35
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The PORT environment variable is not being used correctly The startup script logs the PORT environment variable but doesn't actually use it to configure Nginx. This means the container will always listen on port 8080 regardless of the PORT environment variable value. # Add a startup script for debugging
RUN echo '#!/bin/sh' > /start.sh && \
echo 'echo "Starting nginx with PORT=$PORT"' >> /start.sh && \
+ echo 'sed -i "s/listen 8080/listen \${PORT:-8080}/g" /etc/nginx/conf.d/default.conf' >> /start.sh && \
echo 'cat /etc/nginx/conf.d/default.conf' >> /start.sh && \
echo 'nginx -g "daemon off;"' >> /start.sh && \
chmod +x /start.sh |
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| EXPOSE 8080 | ||||||||||||||||||||||||||||||
| CMD ["/start.sh"] | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # EXPOSE 8080 | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # CMD ["nginx", "-g", "daemon off;"] | ||||||||||||||||||||||||||||||
|
Comment on lines
+45
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: Remove these commented-out duplicates of EXPOSE and CMD directives
Suggested change
|
||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,25 @@ | ||
| # {{ Project Name }} | ||
| # auth-app | ||
|
|
||
| {{ Brief description of the project }} | ||
| ## Project setup | ||
| ``` | ||
| yarn install | ||
| ``` | ||
|
|
||
| ## Overview | ||
| This repository is created from Ollion's standard template to ensure best practices. | ||
| ### Compiles and hot-reloads for development | ||
| ``` | ||
| yarn serve | ||
| ``` | ||
|
|
||
| ## Installation | ||
| {{ Instructions on how to install the project }} | ||
| ### Compiles and minifies for production | ||
| ``` | ||
| yarn build | ||
| ``` | ||
|
|
||
| ## Usage | ||
| {{ How to use the project }} | ||
| ### Lints and fixes files | ||
| ``` | ||
| yarn lint | ||
| ``` | ||
|
|
||
| ## Using this Template | ||
| 1. When creating a new repository on GitHub, select "Choose a template" and pick `ollionorg/private-repository-creation` from the list. | ||
| 2. Enter your repository name (e.g., "my-new-repository"). | ||
| 3. Set visibility to "Private". | ||
| 4. Do not check "Include all branches". | ||
| 5. Click "Create repository. | ||
|
|
||
| ## Post-Creation Setup | ||
| - After creating your repository from private-repository-creation template, you can enable branch protection for the `main` branch by manually triggering the included workflow: | ||
| - Go to the **Actions** tab, select **Set Branch Protection**, and click **Run workflow** > **Run workflow** to apply the protection rules, which are configured by the workflow. | ||
| - After the workflow completes successfully, verify in **Settings** > **Branches** that `main` has: | ||
| - Pull request required (1 approval) | ||
| - Conversation resolution required | ||
| - Signed commits required | ||
| - Customize this README: Replace `[Project Name]`, `[Brief description of the project]`, and update `Installation` and `Usage` sections as needed. Modify other files if required. | ||
|
|
||
| ## Note: GPG Signing and Repository Creation | ||
| - The branch protection rules mandate commit signatures. Set up GPG signing in your Git client by following this [Confluence guide](https://ollion.atlassian.net/wiki/spaces/CID/pages/2989687222/Signed+Commits+on+Github). | ||
| - For detailed instructions on creating a repository with this template, refer to this [Confluence guide](https://ollion.atlassian.net/wiki/spaces/CID/pages/4123131980/Github+Repository+creation+using+template). | ||
| ### Customize configuration | ||
| See [Configuration Reference](https://cli.vuejs.org/config/). | ||
|  |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| module.exports = { | ||
| presets: ["@vue/cli-plugin-babel/preset"], | ||
| }; |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,15 @@ | ||||||
| server { | ||||||
| listen 8080 default_server; | ||||||
| server_name localhost; | ||||||
|
|
||||||
| location / { | ||||||
| root /usr/share/nginx/html; | ||||||
| index index.html index.htm; | ||||||
| try_files $uri $uri/ /index.html =404; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: The =404 fallback after /index.html is redundant since the SPA should handle all routes
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| # Additional helpful configurations | ||||||
| gzip on; | ||||||
| gzip_types text/plain text/css application/json application/javascript; | ||||||
| client_max_body_size 10M; | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,59 @@ | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| "name": "auth-app", | ||||||||||||||||||||||||
| "version": "0.1.0", | ||||||||||||||||||||||||
| "private": true, | ||||||||||||||||||||||||
| "scripts": { | ||||||||||||||||||||||||
| "serve": "vue-cli-service serve", | ||||||||||||||||||||||||
| "build": "vue-cli-service build", | ||||||||||||||||||||||||
| "lint": "vue-cli-service lint" | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
|
Comment on lines
+5
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add test script to package.json The PR objectives note that no explicit tests were added. Adding a test script would encourage test-driven development and help maintain code quality. "scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
- "lint": "vue-cli-service lint"
+ "lint": "vue-cli-service lint",
+ "test": "vue-cli-service test:unit"
},📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||
| "dependencies": { | ||||||||||||||||||||||||
| "@vuelidate/core": "^2.0.3", | ||||||||||||||||||||||||
| "@vuelidate/validators": "^2.0.4", | ||||||||||||||||||||||||
| "axios": "^1.7.9", | ||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security vulnerability in axios version The axios version 1.7.9 has a known high-severity vulnerability (CVE-2025-27152) related to SSRF and credential leakage via absolute URLs. Upgrade to a safer version as mentioned in the PR objectives. - "axios": "^1.7.9",
+ "axios": "^1.8.2",📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||
| "core-js": "^3.8.3", | ||||||||||||||||||||||||
| "pinia": "^3.0.1", | ||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainIncorrect Pinia version Pinia version 3.0.1 does not exist. The current stable version is 2.x. Please update to a valid version. - "pinia": "^3.0.1",
+ "pinia": "^2.1.7",🌐 Web query: 💡 Result: The latest version of Pinia as of April 2025 is 3.0.2, which was published on April 9, 2025[1][6]. This release is compatible only with Vue 3 and requires at least TypeScript 4.5[2][4]. If you are using Nuxt, the corresponding Nuxt module version is @pinia/nuxt 0.11.0[6][8]. Citations:
Update Pinia to the latest patch version (3.0.2) Pinia v3 is valid—version 3.0.1 does exist—but the latest published patch is 3.0.2 (released April 9, 2025). Please bump the dependency accordingly: - "pinia": "^3.0.1",
+ "pinia": "^3.0.2",Ensure you’re on Vue 3 and TypeScript 4.5+; if you’re using Nuxt, you may also want to upgrade 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||
| "vue": "^3.2.13", | ||||||||||||||||||||||||
| "vue-router": "^4.0.3", | ||||||||||||||||||||||||
| "vuex": "^4.0.0" | ||||||||||||||||||||||||
|
Comment on lines
+15
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: Using both Pinia and Vuex state management libraries simultaneously may cause confusion and bloat. Consider using only Pinia as it's the new recommended state management solution for Vue 3. |
||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
| "devDependencies": { | ||||||||||||||||||||||||
| "@typescript-eslint/eslint-plugin": "^5.4.0", | ||||||||||||||||||||||||
| "@typescript-eslint/parser": "^5.4.0", | ||||||||||||||||||||||||
| "@vue/cli-plugin-babel": "~5.0.0", | ||||||||||||||||||||||||
| "@vue/cli-plugin-eslint": "~5.0.0", | ||||||||||||||||||||||||
| "@vue/cli-plugin-router": "~5.0.0", | ||||||||||||||||||||||||
| "@vue/cli-plugin-typescript": "~5.0.0", | ||||||||||||||||||||||||
| "@vue/cli-plugin-vuex": "~5.0.0", | ||||||||||||||||||||||||
| "@vue/cli-service": "~5.0.0", | ||||||||||||||||||||||||
| "@vue/eslint-config-typescript": "^9.1.0", | ||||||||||||||||||||||||
| "eslint": "^7.32.0", | ||||||||||||||||||||||||
| "eslint-config-prettier": "^8.3.0", | ||||||||||||||||||||||||
| "eslint-plugin-prettier": "^4.0.0", | ||||||||||||||||||||||||
| "eslint-plugin-vue": "^8.0.3", | ||||||||||||||||||||||||
| "prettier": "^2.4.1", | ||||||||||||||||||||||||
| "typescript": "~4.5.5" | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
| "eslintConfig": { | ||||||||||||||||||||||||
| "root": true, | ||||||||||||||||||||||||
| "env": { | ||||||||||||||||||||||||
| "node": true | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
| "extends": [ | ||||||||||||||||||||||||
| "plugin:vue/vue3-essential", | ||||||||||||||||||||||||
| "eslint:recommended", | ||||||||||||||||||||||||
| "@vue/typescript/recommended", | ||||||||||||||||||||||||
| "plugin:prettier/recommended" | ||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||
| "parserOptions": { | ||||||||||||||||||||||||
| "ecmaVersion": 2020 | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
| "rules": {} | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
| "browserslist": [ | ||||||||||||||||||||||||
| "> 1%", | ||||||||||||||||||||||||
| "last 2 versions", | ||||||||||||||||||||||||
| "not dead", | ||||||||||||||||||||||||
| "not ie 11" | ||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: 'arrayExpand' is not a valid Prettier configuration option. Remove this line as it will be ignored by Prettier.