This commit is contained in:
yenminh269 2025-10-18 18:36:17 -05:00
commit 807d1f27ac
9 changed files with 37 additions and 30 deletions

View file

@ -4,7 +4,7 @@ name: Build and Deploy
on:
push:
branches: ["main"]
branches: ["deploytest"]
jobs:
build-and-deploy:

17
rust-engine/Cargo.lock generated
View file

@ -143,12 +143,6 @@ version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "cors"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d2dacfa7c8e6a88bacdbd500047e86ac32f67a3706d5b55a1d7b36c80efbc2f"
[[package]]
name = "cpufeatures"
version = "0.2.17"
@ -232,12 +226,6 @@ dependencies = [
"syn",
]
[[package]]
name = "dotenv"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
[[package]]
name = "dotenvy"
version = "0.15.7"
@ -1143,12 +1131,11 @@ dependencies = [
[[package]]
name = "rust-engine"
version = "0.1.0"
version = "0.1.1"
dependencies = [
"anyhow",
"chrono",
"cors",
"dotenv",
"dotenvy",
"serde",
"serde_json",
"sqlx",

View file

@ -1,10 +1,13 @@
# rust-engine/Cargo.toml
[package]
name = "rust-engine"
version = "0.1.0"
edition = "2021"
version = "0.1.1"
edition = "2024"
# --- CORRECTED DEPENDENCIES ---
[dependencies]
tokio = { version = "1.0", features = ["full"] }
tokio = { version = "1.38.0", features = ["full"] }
warp = { version = "0.4.2", features = ["server"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
@ -12,6 +15,5 @@ sqlx = { version = "0.8.6", features = ["runtime-tokio-rustls", "mysql", "chrono
chrono = { version = "0.4", features = ["serde"] }
tracing = "0.1"
tracing-subscriber = "0.3"
dotenv = "0.15"
cors = "0.1.0"
dotenvy = "0.15.7" # Using 'dotenvy' as 'dotenv' is unmaintained
anyhow = "1.0"

View file

@ -23,7 +23,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
tracing_subscriber::fmt::init();
// Load environment variables
dotenv::dotenv().ok();
dotenvy::dotenv().ok();
let database_url = env::var("DATABASE_URL")
.unwrap_or_else(|_| "mysql://astraadmin:password@mysql:3306/astra".to_string());

View file

@ -1,11 +1,13 @@
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks"; // Or import { configs as reactHooks } from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import { defineConfig, globalIgnores } from "eslint/config";
export default defineConfig([
globalIgnores(["dist"]),
{
files: ["**/*.{js,jsx}"],
files: ["**/*{js,jsx}"],
extends: [
js.configs.recommended,
reactHooks.configs["recommended-latest"],

View file

@ -27,11 +27,13 @@
"vite-jsconfig-paths": "^2.0.1"
},
"devDependencies": {
"@eslint/js": "^9.38.0",
"eslint": "^9.38.0",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.0",
"eslint-plugin-react-refresh": "^0.4.24",
"globals": "^16.4.0",
"nodemon": "^3.1.10",
"prettier": "^3.6.2",
"tailwindcss": "^4.1.14",
@ -863,6 +865,19 @@
"url": "https://opencollective.com/eslint"
}
},
"node_modules/@eslint/eslintrc/node_modules/globals": {
"version": "14.0.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
"integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/@eslint/js": {
"version": "9.38.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.38.0.tgz",
@ -3867,9 +3882,9 @@
}
},
"node_modules/globals": {
"version": "14.0.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
"integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
"version": "16.4.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-16.4.0.tgz",
"integrity": "sha512-ob/2LcVVaVGCYN+r14cnwnoDPUufjiYgSqRhiFD0Q1iI4Odora5RE8Iv1D24hAz5oMophRGkGz+yuvQmmUMnMw==",
"dev": true,
"license": "MIT",
"engines": {

View file

@ -32,11 +32,13 @@
},
"packageManager": ">=npm@10.9.0",
"devDependencies": {
"@eslint/js": "^9.38.0",
"eslint": "^9.38.0",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.0",
"eslint-plugin-react-refresh": "^0.4.24",
"globals": "^16.4.0",
"nodemon": "^3.1.10",
"prettier": "^3.6.2",
"tailwindcss": "^4.1.14",

View file

@ -1,5 +1,5 @@
import React from "react";
import ChatLayout from "../components/layouts/chat-layout.jsx";
import ChatLayout from "src/components/layouts/chat-layout";
function App() {
return (

View file

@ -1,5 +1,5 @@
import React from "react";
import ActionButton from "../Button/ActionButton.jsx";
import ActionButton from "src/components/ui/Button/ActionButton.jsx";
export default function ChatHeader({ title = "AI Assistant" }) {
// Delete chat log (frontend + backend)
@ -18,7 +18,7 @@ export default function ChatHeader({ title = "AI Assistant" }) {
setMessages([]);
}
};
return (
<header className="flex items-center justify-between px-4 py-3 bg-gradient-to-r from-slate-800 to-slate-900 text-white">
<div className="flex items-center gap-3">
@ -34,7 +34,6 @@ export default function ChatHeader({ title = "AI Assistant" }) {
<ActionButton children='New Chat' type="add" onClick={handleNewChat}></ActionButton>
<ActionButton children='Delete Chat'type="delete" onClick={handleDeleteChat}></ActionButton>
</div>
</header>
);
}