Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .gitignore
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?
8 changes: 8 additions & 0 deletions .prettierrc
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
Copy link

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.

Suggested change
"arrayExpand": true
"arrayExpand": true,

}
Comment on lines +1 to +8
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Invalid Prettier option detected
The arrayExpand option is not recognized by Prettier and will be ignored. Please remove or replace it with a valid option (e.g., bracketSpacing, trailingComma).

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
"printWidth": 100,
"arrayExpand": true
}
{
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
// Removed invalid option; consider adding a valid one, e.g.:
"trailingComma": "es5",
"printWidth": 100
}

47 changes: 47 additions & 0 deletions Dockerfile
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
Copy link

Choose a reason for hiding this comment

The 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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Build stage
FROM node:16 as build-stage
WORKDIR /app
COPY package*.json ./
RUN yarn
COPY . .
RUN yarn build
# Build stage
FROM node:20 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

# 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
Copy link

Choose a reason for hiding this comment

The 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
# 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
# Add a startup script for port configuration and debugging
RUN echo '#!/bin/sh' > /start.sh && \
echo 'echo "Starting nginx with PORT=$PORT"' >> /start.sh && \
echo 'sed -i "s/listen 8080/listen $PORT/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

Comment on lines +35 to +40
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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
Copy link

Choose a reason for hiding this comment

The 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
# EXPOSE 8080
# CMD ["nginx", "-g", "daemon off;"]

47 changes: 20 additions & 27 deletions README.md
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/).
![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/VivekY1098/Auth-app?utm_source=oss&utm_medium=github&utm_campaign=VivekY1098%2FAuth-app&labelColor=171717&color=FF570A&link=https%3A%2F%2Fcoderabbit.ai&label=CodeRabbit+Reviews)
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
};
15 changes: 15 additions & 0 deletions nginx.conf
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;
Copy link

Choose a reason for hiding this comment

The 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
try_files $uri $uri/ /index.html =404;
try_files $uri $uri/ /index.html;

}

# Additional helpful configurations
gzip on;
gzip_types text/plain text/css application/json application/javascript;
client_max_body_size 10M;
}
59 changes: 59 additions & 0 deletions package.json
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
Copy link

Choose a reason for hiding this comment

The 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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"test": "vue-cli-service test:unit"
},

"dependencies": {
"@vuelidate/core": "^2.0.3",
"@vuelidate/validators": "^2.0.4",
"axios": "^1.7.9",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"axios": "^1.7.9",
"axios": "^1.8.2",

"core-js": "^3.8.3",
"pinia": "^3.0.1",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Incorrect 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:

What is the latest version of Pinia?

💡 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 @pinia/nuxt to ^0.11.0.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"pinia": "^3.0.1",
- "pinia": "^3.0.1",
+ "pinia": "^3.0.2",

"vue": "^3.2.13",
"vue-router": "^4.0.3",
"vuex": "^4.0.0"
Comment on lines +15 to +18
Copy link

Choose a reason for hiding this comment

The 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"
]
}
Loading