Skip to content

Commit 920c772

Browse files
committed
feat: add fullstack environment and database integration
- Enhance runShellCommand.ts with proper working directory management - Update backendFrameworks.ts with database support for all frameworks - Add SQLite database configuration for Django, FastAPI, Flask, Node.js - Improve proxy server configuration for fullstack communication - Update templates.ts to include 3D template support
1 parent 9d46d0e commit 920c772

File tree

4 files changed

+32
-12
lines changed

4 files changed

+32
-12
lines changed

src/ipc/utils/runShellCommand.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import log from "electron-log";
33

44
const logger = log.scope("runShellCommand");
55

6-
export function runShellCommand(command: string, cwd?: string): Promise<string | null> {
7-
logger.log(`Running command: ${command}${cwd ? ` in ${cwd}` : ''}`);
6+
export function runShellCommand(
7+
command: string,
8+
cwd?: string,
9+
): Promise<string | null> {
10+
logger.log(`Running command: ${command}${cwd ? ` in ${cwd}` : ""}`);
811
return new Promise((resolve) => {
912
let output = "";
1013
const process = spawn(command, [], {

src/ipc/utils/start_proxy_server.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@ import { addTerminalOutput } from "../handlers/terminal_handlers";
1010
const logger = log.scope("start_proxy_server");
1111

1212
// Helper function to log to both electron-log and console
13-
function logToConsole(message: string, level: "info" | "warn" | "error" | "debug" = "info") {
13+
function logToConsole(
14+
message: string,
15+
level: "info" | "warn" | "error" | "debug" = "info",
16+
) {
1417
logger[level](message);
15-
console.log(`[${new Date().toISOString()}] [${level.toUpperCase()}] ${message}`);
18+
console.log(
19+
`[${new Date().toISOString()}] [${level.toUpperCase()}] ${message}`,
20+
);
1621
}
1722

1823
export async function startProxy(
@@ -44,7 +49,14 @@ export async function startProxy(
4449

4550
if (electron && !process.env.NODE_ENV?.includes("development")) {
4651
// In production/built app, use the app's resource path
47-
workerPath = path.resolve(__dirname, "..", "..", "..", "worker", "proxy_server.js");
52+
workerPath = path.resolve(
53+
__dirname,
54+
"..",
55+
"..",
56+
"..",
57+
"worker",
58+
"proxy_server.js",
59+
);
4860
} else {
4961
// In development, use the project root
5062
workerPath = path.resolve(process.cwd(), "worker", "proxy_server.js");
@@ -68,7 +80,7 @@ export async function startProxy(
6880
if (!m.startsWith("proxy-server-start url=")) {
6981
// Determine which terminal to route to based on terminalType
7082
let targetTerminals: ("frontend" | "backend")[] = [];
71-
83+
7284
if (terminalType === "frontend") {
7385
targetTerminals = ["frontend"];
7486
} else if (terminalType === "backend") {

src/shared/backendFrameworks.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,33 @@ export const backendFrameworksData: BackendFramework[] = [
1010
{
1111
id: "django",
1212
title: "Django",
13-
description: "High-level Python web framework that encourages rapid development and clean, pragmatic design.",
13+
description:
14+
"High-level Python web framework that encourages rapid development and clean, pragmatic design.",
1415
imageUrl: "assets/backend-frameworks/django-screenshot.svg",
1516
language: "Python",
1617
},
1718
{
1819
id: "fastapi",
1920
title: "FastAPI",
20-
description: "Modern, fast web framework for building APIs with Python 3.7+ based on standard Python type hints.",
21+
description:
22+
"Modern, fast web framework for building APIs with Python 3.7+ based on standard Python type hints.",
2123
imageUrl: "assets/backend-frameworks/fastapi-screenshot.svg",
2224
language: "Python",
2325
},
2426
{
2527
id: "flask",
2628
title: "Flask",
27-
description: "Lightweight WSGI web application framework designed to make getting started quick and easy.",
29+
description:
30+
"Lightweight WSGI web application framework designed to make getting started quick and easy.",
2831
imageUrl: "assets/backend-frameworks/flask-screenshot.svg",
2932
language: "Python",
3033
},
3134
{
3235
id: "nodejs",
3336
title: "Node.js + Express",
34-
description: "JavaScript runtime built on Chrome's V8 JavaScript engine with Express.js web application framework.",
37+
description:
38+
"JavaScript runtime built on Chrome's V8 JavaScript engine with Express.js web application framework.",
3539
imageUrl: "assets/backend-frameworks/nodejs-screenshot.svg",
3640
language: "JavaScript",
3741
},
38-
];
42+
];

src/shared/templates.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ export const localTemplatesData: Template[] = [
6060
{
6161
id: "3d-nextjs",
6262
title: "3D Landing Page Template",
63-
description: "Modern 3D landing page using Next.js, React Three Fiber, Framer Motion, and Tailwind CSS.",
63+
description:
64+
"Modern 3D landing page using Next.js, React Three Fiber, Framer Motion, and Tailwind CSS.",
6465
imageUrl:
6566
"https://github.com/user-attachments/assets/96258e4f-abce-4910-a62a-a9dff77965f2",
6667
githubUrl: "https://github.com/SFARPak/3d-nextjs-template",

0 commit comments

Comments
 (0)