init: backend

This commit is contained in:
alikia2x (寒寒) 2025-03-31 02:47:33 +08:00
parent b2edaf8fc4
commit 1322cc4671
Signed by: alikia2x
GPG Key ID: 56209E0CCD8420C6
8 changed files with 78 additions and 56 deletions

View File

@ -1,21 +1,21 @@
{ {
"lock": false, "lock": false,
"workspace": ["./packages/crawler", "./packages/frontend", "./packages/backend", "./packages/core"], "workspace": ["./packages/crawler", "./packages/frontend", "./packages/backend", "./packages/core"],
"nodeModulesDir": "auto", "nodeModulesDir": "auto",
"tasks": { "tasks": {
"crawler": "deno task --filter 'crawler' all" "crawler": "deno task --filter 'crawler' all"
}, },
"fmt": { "fmt": {
"useTabs": true, "useTabs": true,
"lineWidth": 120, "lineWidth": 120,
"indentWidth": 4, "indentWidth": 4,
"semiColons": true, "semiColons": true,
"proseWrap": "always" "proseWrap": "always"
}, },
"imports": { "imports": {
"@astrojs/node": "npm:@astrojs/node@^9.1.3", "@astrojs/node": "npm:@astrojs/node@^9.1.3",
"@astrojs/svelte": "npm:@astrojs/svelte@^7.0.8", "@astrojs/svelte": "npm:@astrojs/svelte@^7.0.8",
"@core/db/": "./packages/core/db/", "@core/db/": "./packages/core/db/",
"date-fns": "npm:date-fns@^4.1.0" "date-fns": "npm:date-fns@^4.1.0"
} }
} }

View File

@ -0,0 +1,13 @@
{
"name": "@cvsa/backend",
"imports": {
"hono": "jsr:@hono/hono@^4.7.5"
},
"tasks": {
"start": "deno run --allow-net main.ts"
},
"compilerOptions": {
"jsx": "precompile",
"jsxImportSource": "hono/jsx"
}
}

9
packages/backend/main.ts Normal file
View File

@ -0,0 +1,9 @@
import { Hono } from "hono";
const app = new Hono();
app.get("/", (c) => {
return c.text("Hello Hono!");
});
Deno.serve(app.fetch);

View File

@ -27,4 +27,4 @@ export const postgresConfigCred = {
database: databaseNameCred, database: databaseNameCred,
user: databaseUser, user: databaseUser,
password: databasePassword, password: databasePassword,
} };

View File

@ -1 +1 @@
export const VERSION = "1.2.6"; export const VERSION = "1.2.6";

View File

@ -1,23 +1,23 @@
{ {
"name": "frontend", "name": "frontend",
"type": "module", "type": "module",
"version": "0.0.1", "version": "0.0.1",
"scripts": { "scripts": {
"dev": "astro dev", "dev": "astro dev",
"build": "astro build", "build": "astro build",
"preview": "astro preview", "preview": "astro preview",
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"@astrojs/tailwind": "^6.0.2", "@astrojs/tailwind": "^6.0.2",
"astro": "^5.5.5", "astro": "^5.5.5",
"autoprefixer": "^10.4.21", "autoprefixer": "^10.4.21",
"pg": "^8.11.11", "pg": "^8.11.11",
"postcss": "^8.5.3", "postcss": "^8.5.3",
"tailwindcss": "^3.0.24", "tailwindcss": "^3.0.24",
"vite-tsconfig-paths": "^5.1.4" "vite-tsconfig-paths": "^5.1.4"
}, },
"devDependencies": { "devDependencies": {
"@types/pg": "^8.11.11" "@types/pg": "^8.11.11"
} }
} }

View File

@ -3,7 +3,7 @@
@tailwind utilities; @tailwind utilities;
.content { .content {
@apply text-gray-800 dark:text-zinc-100; @apply text-gray-800 dark:text-zinc-100;
h1, h1,
h2, h2,
@ -73,4 +73,4 @@
ol li p { ol li p {
@apply inline; @apply inline;
} }
} }

View File

@ -1,16 +1,16 @@
{ {
"extends": "astro/tsconfigs/strict", "extends": "astro/tsconfigs/strict",
"include": [".astro/types.d.ts", "**/*"], "include": [".astro/types.d.ts", "**/*"],
"exclude": ["dist"], "exclude": ["dist"],
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@components/*": ["src/components/*"], "@components/*": ["src/components/*"],
"@layouts/*": ["src/layouts/*"], "@layouts/*": ["src/layouts/*"],
"@utils/*": ["src/utils/*"], "@utils/*": ["src/utils/*"],
"@assets/*": ["src/assets/*"], "@assets/*": ["src/assets/*"],
"@styles": ["src/styles/*"], "@styles": ["src/styles/*"],
"@core/*": ["../core/*"] "@core/*": ["../core/*"]
} }
} }
} }