Initial commit
This commit is contained in:
commit
e6d6427ddc
29 changed files with 4378 additions and 0 deletions
2
frontend/.env
Normal file
2
frontend/.env
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
VITE_API_URL=""
|
||||
VITE_APP_NAME=""
|
||||
0
frontend/README.md
Normal file
0
frontend/README.md
Normal file
17
frontend/dockerfile
Normal file
17
frontend/dockerfile
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
from node:19 as base
|
||||
|
||||
workdir /app
|
||||
|
||||
copy package*.json /app
|
||||
run npm install
|
||||
copy . /app
|
||||
|
||||
|
||||
from base as dev
|
||||
cmd [ "/bin/bash" ]
|
||||
|
||||
|
||||
from base as prod
|
||||
run npm install --global http-server
|
||||
run npm run build
|
||||
cmd [ "http-server", "./dist", "--no-dotfiles" ]
|
||||
13
frontend/index.html
Normal file
13
frontend/index.html
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/png" href="/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>%VITE_APP_NAME%</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
1804
frontend/package-lock.json
generated
Normal file
1804
frontend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
24
frontend/package.json
Normal file
24
frontend/package.json
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"name": "frontend",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --host",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^2.4.2",
|
||||
"@tsconfig/svelte": "^5.0.0",
|
||||
"svelte": "^4.0.5",
|
||||
"svelte-check": "^3.4.6",
|
||||
"tslib": "^2.6.0",
|
||||
"typescript": "^5.0.2",
|
||||
"vite": "^4.4.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"svelte-i18n": "^3.7.0"
|
||||
}
|
||||
}
|
||||
BIN
frontend/public/favicon.png
Normal file
BIN
frontend/public/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 740 B |
3
frontend/public/locales/en-CA.json
Normal file
3
frontend/public/locales/en-CA.json
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"docs.svelte": "Svelte Docs"
|
||||
}
|
||||
19
frontend/src/App.svelte
Normal file
19
frontend/src/App.svelte
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<script lang="ts">
|
||||
import { _, locale, locales } from "svelte-i18n";
|
||||
import localeNames from "./locales";
|
||||
</script>
|
||||
|
||||
<main>
|
||||
<a href="https://svelte.dev/docs" target="_blank" rel="noreferrer">
|
||||
{$_("docs.svelte")}
|
||||
</a>
|
||||
<br><br>
|
||||
<select bind:value={$locale}>
|
||||
{#each $locales as locale}
|
||||
<option value="{locale}">{localeNames[locale]}</option>
|
||||
{/each}
|
||||
</select>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
17
frontend/src/app.css
Normal file
17
frontend/src/app.css
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
html, body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
min-width: 100vw;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #2c2c32;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
a {
|
||||
color: white;
|
||||
}
|
||||
8
frontend/src/locales.ts
Normal file
8
frontend/src/locales.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
export default {
|
||||
"en-CA": "English (Canada)", // Canadian English
|
||||
// "en-US": "English (United States)", // US English
|
||||
// "en-GB": "English (Britain)", // British English
|
||||
// "sv": "Svenska", // Swedish
|
||||
// "cz": "", // Czech
|
||||
// "nl": "", // Dutch
|
||||
};
|
||||
23
frontend/src/main.ts
Normal file
23
frontend/src/main.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { getLocaleFromNavigator, init, register } from "svelte-i18n";
|
||||
import "./app.css";
|
||||
import App from "./App.svelte";
|
||||
|
||||
// Get all of the internationalization stuff registered and operational
|
||||
import locales from "./locales";
|
||||
for (const locale in locales) {
|
||||
register(
|
||||
locale,
|
||||
() => fetch(`/locales/${locale}.json`).then(r => r.json())
|
||||
);
|
||||
};
|
||||
await init({
|
||||
fallbackLocale: `en-CA`,
|
||||
initialLocale: getLocaleFromNavigator(),
|
||||
});
|
||||
|
||||
|
||||
const app = new App({
|
||||
target: document.getElementById("app"),
|
||||
});
|
||||
|
||||
export default app
|
||||
2
frontend/src/vite-env.d.ts
vendored
Normal file
2
frontend/src/vite-env.d.ts
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/// <reference types="svelte" />
|
||||
/// <reference types="vite/client" />
|
||||
7
frontend/svelte.config.js
Normal file
7
frontend/svelte.config.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"
|
||||
|
||||
export default {
|
||||
// Consult https://svelte.dev/docs#compile-time-svelte-preprocess
|
||||
// for more information about preprocessors
|
||||
preprocess: vitePreprocess(),
|
||||
}
|
||||
19
frontend/tsconfig.json
Normal file
19
frontend/tsconfig.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"extends": "@tsconfig/svelte/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": true,
|
||||
"module": "ESNext",
|
||||
/**
|
||||
* Typecheck JS in `.svelte` and `.js` files by default.
|
||||
* Disable checkJs if you'd like to use dynamic types in JS.
|
||||
* Note that setting allowJs false does not prevent the use
|
||||
* of JS in `.svelte` files.
|
||||
*/
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"isolatedModules": true
|
||||
},
|
||||
"include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
}
|
||||
9
frontend/tsconfig.node.json
Normal file
9
frontend/tsconfig.node.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"skipLibCheck": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler"
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
7
frontend/vite.config.ts
Normal file
7
frontend/vite.config.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { defineConfig } from "vite"
|
||||
import { svelte } from "@sveltejs/vite-plugin-svelte"
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [svelte()],
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue