Skip to content

Commit 5df9759

Browse files
authored
Merge pull request #29 from PastaLaPate/dev
Dev
2 parents 2ec6c7f + 0a8b8e8 commit 5df9759

26 files changed

+1757
-293
lines changed

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"tabWidth": 2,
33
"useTabs": false,
44
"semi": true,
5-
"printWidth": 120,
5+
"printWidth": 80,
66
"trailingComma": "es5",
77
"bracketSpacing": true,
88
"arrowParens": "always",

.vscode/extensions.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"recommendations": [
3-
"Gruntfuggly.todo-tree",
4-
"austenc.tailwind-docs",
5-
"bradlc.vscode-tailwindcss",
6-
"antfu.vite",
3+
"Gruntfuggly.todo-tree",
4+
"austenc.tailwind-docs",
5+
"bradlc.vscode-tailwindcss",
6+
"antfu.vite",
77
"dbaeumer.vscode-eslint",
88
"esbenp.prettier-vscode",
99
"Tyriar.lorem-ipsum",
@@ -12,4 +12,4 @@
1212
"christian-kohler.npm-intellisense",
1313
"Enivia.oklch-decorator"
1414
]
15-
}
15+
}

.vscode/settings.json

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
"source.fixAll.eslint": "always",
55
"source.organizeImports": "always"
66
},
7+
"editor.indentSize": 2,
8+
"editor.wordWrap": "on",
79
"vite.autoStart": true,
8-
"vite.devCommand": "npm run dev",
10+
"vite.devCommand": "pnpm run dev",
911
"editor.formatOnSave": true,
12+
"tailwindCSS.classAttributes": ["class", "className", "ngClass", "class:list", "inputClassName", "iconClassName"],
1013
"todo-tree.highlights.defaultHighlight": {
1114
"icon": "alert",
1215
"type": "text-and-comment",
@@ -58,15 +61,6 @@
5861
"iconColour": "green"
5962
}
6063
},
61-
"todo-tree.general.tags": [
62-
"BUG",
63-
"HACK",
64-
"FIXME",
65-
"TODO",
66-
"NOTE",
67-
"COMMENT",
68-
"[ ]",
69-
"[x]"
70-
],
64+
"todo-tree.general.tags": ["BUG", "HACK", "FIXME", "TODO", "NOTE", "COMMENT", "[ ]", "[x]"],
7165
"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|^|^\\s*(-|\\d+.))\\s*($TAGS).*(\\n\\s*//\\s{2,}.*)*"
7266
}

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
## Features
66

7-
- 🪶**Lightweight**: Optimized for small devices like Raspberry Pi.
7+
- 📱**Responsive**: Optimized for small screens like a 5" one.
8+
- 🪶**Lightweight**: Optimized for limited performance devices like Raspberry Pi.
89
-**User-friendly**: Intuitive interface for easy navigation.
910
- 📂**File explorer**: Start 3D prints directly from the file explorer.
1011
- 🔥**Preheat presets**: Quickly preheat your printer with custom presets.
12+
- 🧵**Filament Spool Selector**: Select if you have SpoolManager installed a filament spool to print with.
1113

1214
## Screenshots
1315

backend/package-lock.json

Lines changed: 85 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"bonjour-service": "^1.3.0",
1515
"cors": "^2.8.5",
1616
"express": "^5.1.0",
17-
"node-fetch": "^3.3.2"
17+
"morgan": "^1.10.0",
18+
"node-fetch": "^3.3.2",
19+
"rotating-file-stream": "^3.2.6"
1820
}
1921
}

backend/server.js

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,19 @@ import { Bonjour } from "bonjour-service"; // you must install this
22

33
import cors from "cors";
44
import express from "express";
5+
import morgan from "morgan";
56
import fetch from "node-fetch";
7+
import * as rfs from "rotating-file-stream";
68
import { exec, spawn } from "child_process";
79
import fs from "fs";
810
import os from "os";
911
import path from "path";
1012
import { fileURLToPath } from "url";
11-
import util from "util";
1213

1314
// Get absolute path to this script (because import.meta.url gives a file:// URL)
1415
const __filename = fileURLToPath(import.meta.url);
1516
const __dirname = path.dirname(__filename);
1617

17-
var log_file = fs.createWriteStream(__dirname + "/server.log", { flags: "w" });
18-
var log_stdout = process.stdout;
19-
20-
console.log = function (d) {
21-
//
22-
log_file.write(util.format(d) + "\n");
23-
log_stdout.write(util.format(d) + "\n");
24-
};
25-
2618
// Read version.json using fs since require is not available in ES modules
2719
let version = "";
2820
let versionFilePath = path.join(__dirname, "version.json");
@@ -39,6 +31,21 @@ if (fs.existsSync(versionFilePath)) {
3931

4032
const app = express();
4133

34+
app.use(
35+
morgan("combined", {
36+
stream: rfs.createStream(
37+
(date, index) =>
38+
date
39+
? `${date.getFullYear()}/${date.getMonth()}-${date.getDate()}.log`
40+
: "server.log",
41+
{
42+
interval: "1d",
43+
path: path.join(__dirname, "log"),
44+
}
45+
),
46+
})
47+
);
48+
4249
const allowedOrigins = [
4350
"http://localhost",
4451
"http://localhost:3000",
@@ -56,7 +63,7 @@ app.use(
5663
}
5764
return callback(new Error("Not allowed by CORS"));
5865
},
59-
}),
66+
})
6067
);
6168

6269
// Resolve the path to ../frontend relative to backend
@@ -107,7 +114,7 @@ app.get("/api/bonjour", (req, res) => {
107114
},
108115
(service) => {
109116
services.push(service);
110-
},
117+
}
111118
);
112119

113120
setTimeout(() => {
@@ -146,7 +153,7 @@ app.post("/api/update", async (req, res) => {
146153
{
147154
stdio: "ignore",
148155
detached: true,
149-
},
156+
}
150157
).unref();
151158
} catch (err) {
152159
console.error(err);

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@radix-ui/react-slot": "^1.2.3",
2424
"@radix-ui/react-switch": "^1.2.5",
2525
"@radix-ui/react-tabs": "^1.1.12",
26+
"@stepperize/react": "^5.1.6",
2627
"@tailwindcss/vite": "^4.1.7",
2728
"axios": "^1.9.0",
2829
"bonjour": "^3.5.0",
@@ -32,7 +33,7 @@
3233
"cmdk": "^1.1.1",
3334
"dnssd": "^0.4.1",
3435
"framer-motion": "^12.15.0",
35-
"lucide-react": "^0.511.0",
36+
"lucide-react": "^0.523.0",
3637
"motion": "^12.14.0",
3738
"next-themes": "^0.4.6",
3839
"nodemon": "^3.1.10",

0 commit comments

Comments
 (0)