Skip to content

Commit

Permalink
refactor: renew frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
ninoseki committed Nov 26, 2023
1 parent 707a09c commit 12a1d60
Show file tree
Hide file tree
Showing 102 changed files with 5,757 additions and 21,057 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN npm install && npm run build && rm -rf node_modules
FROM python:3.11-slim-bookworm

RUN apt-get update \
&& apt-get install -y --no-install-recommends spamassassin libmagic-dev \
&& apt-get install -y --no-install-recommends build-essential spamassassin libmagic-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
4 changes: 2 additions & 2 deletions app.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ RUN npm install && npm run build && rm -rf node_modules
FROM python:3.11-slim-bookworm

RUN apt-get update \
&& apt-get install -y --no-install-recommends libmagic-dev \
&& apt-get install -y --no-install-recommends build-essential libmagic-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/app

COPY requirements.txt pyproject.toml poetry.lock gunicorn.conf.py ./
COPY backend ./backend
COPY --from=build /frontend ./frontend
COPY --from=build /usr/src/app/frontend ./frontend

RUN pip install --no-cache-dir -r requirements.txt \
&& poetry install --without dev
Expand Down
2 changes: 1 addition & 1 deletion backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def create_app():

# add routes
app.include_router(api_router, prefix="/api")
app.mount("/static", StaticFiles(directory="frontend/dist/static"), name="static")
app.mount("/assets", StaticFiles(directory="frontend/dist/assets"), name="assets")
app.mount("/", StaticFiles(html=True, directory="frontend/dist/"), name="index")

return app
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: "3.7"
version: "3"
services:
spamassassin:
image: instantlinux/spamassassin:3.4.6-1
image: instantlinux/spamassassin:4.0.0-6
ports:
- ${PORT_SPAMASSASSIN:-783}:783
- ${SPAMASSASSIN_PORT:-783}:783
restart: always

eml_analyzer:
Expand All @@ -17,7 +17,7 @@ services:
- URLSCAN_API_KEY=${URLSCAN_API_KEY}
- INQUEST_API_KEY=${INQUEST_API_KEY}
- SPAMASSASSIN_HOST=spamassassin
- SPAMASSASSIN_PORT=${PORT_SPAMASSASSIN:-783}
- SPAMASSASSIN_PORT=${SPAMASSASSIN_PORT:-783}
restart: always
depends_on:
- spamassassin
3 changes: 0 additions & 3 deletions frontend/.browserslistrc

This file was deleted.

22 changes: 22 additions & 0 deletions frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
root: true,
extends: [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier/skip-formatting'
],
plugins: ['simple-import-sort'],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error'
},
parserOptions: {
ecmaVersion: 'latest'
}
}
34 changes: 0 additions & 34 deletions frontend/.eslintrc.js

This file was deleted.

31 changes: 31 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# redoc
public/redoc-static.html
8 changes: 8 additions & 0 deletions frontend/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"singleQuote": false,
"printWidth": 100,
"trailingComma": "none"
}
3 changes: 0 additions & 3 deletions frontend/babel.config.js

This file was deleted.

21 changes: 21 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="/favicon.ico" />
<title>EML Analyzer</title>
</head>
<body>
<noscript>
<strong
>We're sorry but EML Analyzer doesn't work properly without JavaScript
enabled. Please enable it to continue.</strong
>
</noscript>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
<!-- built files will be auto injected -->
</body>
</html>
3 changes: 0 additions & 3 deletions frontend/jest.config.js

This file was deleted.

0 comments on commit 12a1d60

Please sign in to comment.