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
+3
View File
@@ -0,0 +1,3 @@
node_modules/
dist/
.env
+3
View File
@@ -0,0 +1,3 @@
# StackPulse
StackPulse ist eine Fullstack-App zur Verwaltung und Aktualisierung von Portainer Stacks.
+16
View File
@@ -0,0 +1,16 @@
const express = require("express");
const axios = require("axios");
const app = express();
const PORT = 3000;
app.get("/api/stacks", async (req, res) => {
try {
res.json([{ name: "stack1" }, { name: "stack2" }]);
} catch (err) {
res.status(500).json({ error: err.message });
}
});
app.listen(PORT, () => {
console.log(\`Backend läuft auf http://localhost:\${PORT}\`);
});
+12
View File
@@ -0,0 +1,12 @@
{
"name": "stackpulse-backend",
"version": "0.1.0",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"dependencies": {
"express": "^4.18.2",
"axios": "^1.7.5"
}
}
+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"
}
}
});
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
set -e
echo "🚀 Starte StackPulse Dev-Umgebung..."
cd backend
npm install
npm start &
BACK_PID=$!
cd ..
cd frontend
npm install
npm run dev &
FRONT_PID=$!
cd ..
echo ""
echo "✅ StackPulse läuft lokal:"
echo "Frontend: http://localhost:5173"
echo "Backend: http://localhost:3000"
echo "Beenden mit STRG+C"
wait $BACK_PID $FRONT_PID