Initial
This commit is contained in:
45
Frontend/Earthfile
Normal file
45
Frontend/Earthfile
Normal file
@@ -0,0 +1,45 @@
|
||||
VERSION 0.8
|
||||
|
||||
node-base:
|
||||
FROM node:24.12.0-alpine
|
||||
WORKDIR /app
|
||||
RUN corepack enable && corepack prepare pnpm@10.24.0 --activate
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
||||
deps:
|
||||
FROM +node-base
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
build:
|
||||
FROM +deps
|
||||
COPY . .
|
||||
RUN pnpm build
|
||||
SAVE ARTIFACT dist AS LOCAL ./dist
|
||||
|
||||
dev-image:
|
||||
ARG REGISTRY="registry.mangopig.tech"
|
||||
ARG IMAGE_NAME="boost-ai/demo-frontend-dev"
|
||||
ARG TAG="latest"
|
||||
|
||||
FROM +deps
|
||||
COPY . .
|
||||
|
||||
ENV HOST=0.0.0.0
|
||||
ENV PORT=4321
|
||||
EXPOSE 4321
|
||||
|
||||
SAVE IMAGE $IMAGE_NAME:$TAG
|
||||
SAVE IMAGE --push $REGISTRY/$IMAGE_NAME:$TAG
|
||||
|
||||
# image:
|
||||
# ARG REGISTRY="registry.mangopig.tech"
|
||||
# ARG IMAGE_NAME="boost-ai/demo"
|
||||
# ARG TAG="latest"
|
||||
|
||||
# FROM nginx:1.29-alpine
|
||||
# COPY +build/dist /tmp/dist
|
||||
# RUN rm -rf /usr/share/nginx/html/* && cp -R /tmp/dist/. /usr/share/nginx/html/
|
||||
# COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
# EXPOSE 80
|
||||
# SAVE IMAGE boost-ai/demo-frontend:latest
|
||||
# SAVE IMAGE --push $REGISTRY/$IMAGE_NAME:$TAG
|
||||
27
Frontend/package.json
Normal file
27
Frontend/package.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "example-bare",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
"build": "vite build",
|
||||
"start": "vite start",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@solidjs/start": "2.0.0-alpha.2",
|
||||
"@solidjs/vite-plugin-nitro-2": "^0.1.0",
|
||||
"solid-js": "^1.9.5",
|
||||
"vite": "^7.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^25.6.2",
|
||||
"autoprefixer": "^10.5.0",
|
||||
"cssnano": "^8.0.1",
|
||||
"postcss": "^8.5.14",
|
||||
"postcss-preset-env": "^11.2.1",
|
||||
"sass": "^1.99.0"
|
||||
}
|
||||
}
|
||||
6705
Frontend/pnpm-lock.yaml
generated
Normal file
6705
Frontend/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
5
Frontend/postcss.config.cjs
Normal file
5
Frontend/postcss.config.cjs
Normal file
@@ -0,0 +1,5 @@
|
||||
// Path: Frontend/postcss.config.cjs
|
||||
|
||||
module.exports = {
|
||||
plugins: [require("autoprefixer"), require("postcss-preset-env"), require("cssnano")],
|
||||
};
|
||||
BIN
Frontend/public/favicon.ico
Normal file
BIN
Frontend/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 664 B |
13
Frontend/src/app.tsx
Normal file
13
Frontend/src/app.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
// Path: Frontend/src/app.tsx
|
||||
|
||||
import { createSignal } from "solid-js";
|
||||
|
||||
export default function App() {
|
||||
const [count, setCount] = createSignal(0);
|
||||
|
||||
return (
|
||||
<main>
|
||||
<h1>AI</h1>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
6
Frontend/src/entry-client.tsx
Normal file
6
Frontend/src/entry-client.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
// Path: src/entry-client.tsx
|
||||
|
||||
// @refresh reload
|
||||
import { mount, StartClient } from "@solidjs/start/client";
|
||||
|
||||
mount(() => <StartClient />, document.getElementById("app")!);
|
||||
23
Frontend/src/entry-server.tsx
Normal file
23
Frontend/src/entry-server.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
// Path: src/entry-server.tsx
|
||||
|
||||
// @refresh reload
|
||||
import { createHandler, StartServer } from "@solidjs/start/server";
|
||||
|
||||
export default createHandler(() => (
|
||||
<StartServer
|
||||
document={({ assets, children, scripts }) => (
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
{assets}
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">{children}</div>
|
||||
{scripts}
|
||||
</body>
|
||||
</html>
|
||||
)}
|
||||
/>
|
||||
));
|
||||
3
Frontend/src/global.d.ts
vendored
Normal file
3
Frontend/src/global.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
// Path: src/global.d.ts
|
||||
|
||||
/// <reference types="@solidjs/start/env" />
|
||||
19
Frontend/tsconfig.json
Normal file
19
Frontend/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true,
|
||||
"jsx": "preserve",
|
||||
"jsxImportSource": "solid-js",
|
||||
"allowJs": true,
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"types": ["vite/client"],
|
||||
"isolatedModules": true,
|
||||
"paths": {
|
||||
"~/*": ["./src/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
17
Frontend/vite.config.ts
Normal file
17
Frontend/vite.config.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
// Path: Frontend/vite.config.ts
|
||||
|
||||
import { solidStart } from "@solidjs/start/config";
|
||||
import { nitroV2Plugin as nitro } from "@solidjs/vite-plugin-nitro-2";
|
||||
import { defineConfig } from "vite";
|
||||
|
||||
const extraAllowedHosts = (process.env.ALLOWED_HOSTS ?? "")
|
||||
.split(",")
|
||||
.map((host) => host.trim())
|
||||
.filter(Boolean);
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [solidStart(), nitro()],
|
||||
server: {
|
||||
allowedHosts: ["localhost", ...extraAllowedHosts],
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user