Initial commit: Projektstruktur mit Backend & Frontend

This commit is contained in:
2025-08-16 19:47:27 +00:00
commit 71f61b7bd2
10 changed files with 135 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>StackPulse</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
+21
View File
@@ -0,0 +1,21 @@
{
"name": "stackpulse-frontend",
"version": "0.1.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"axios": "^1.7.5"
},
"devDependencies": {
"vite": "^4.4.9",
"@vitejs/plugin-react": "^4.0.0",
"tailwindcss": "^3.3.3",
"postcss": "^8.4.26",
"autoprefixer": "^10.4.14"
}
}
+23
View File
@@ -0,0 +1,23 @@
import React, { useEffect, useState } from "react";
import axios from "axios";
function App() {
const [stacks, setStacks] = useState([]);
useEffect(() => {
axios.get("/api/stacks").then(res => setStacks(res.data));
}, []);
return (
<div className="p-6">
<h1 className="text-2xl font-bold mb-4">StackPulse</h1>
<ul className="list-disc pl-5">
{stacks.map((stack, i) => (
<li key={i}>{stack.name}</li>
))}
</ul>
</div>
);
}
export default App;
+9
View File
@@ -0,0 +1,9 @@
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.jsx";
ReactDOM.createRoot(document.getElementById("root")).render(
<React.StrictMode>
<App />
</React.StrictMode>
);
+12
View File
@@ -0,0 +1,12 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
server: {
port: 5173,
proxy: {
"/api": "http://localhost:3000"
}
}
});