Skip to content

Commit 64e9595

Browse files
Changes
Co-authored-by: ghostcodedynamics <295822717+ghostcodedynamics@users.noreply.github.com>
1 parent a6e7758 commit 64e9595

4 files changed

Lines changed: 123 additions & 80 deletions

File tree

index.html

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<!doctype html>
2+
<html lang="en" class="dark">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>GhostCode Dynamics — Building Digital Solutions</title>
7+
<meta
8+
name="description"
9+
content="GhostCode Dynamics is a founder-led technology brand building digital solutions for businesses and empowering the next generation of tech professionals."
10+
/>
11+
<meta name="author" content="GhostCode Dynamics" />
12+
<meta name="theme-color" content="#0a0a12" />
13+
14+
<meta property="og:site_name" content="GhostCode Dynamics" />
15+
<meta property="og:type" content="website" />
16+
<meta property="og:title" content="GhostCode Dynamics — Building Digital Solutions" />
17+
<meta
18+
property="og:description"
19+
content="Building digital solutions for businesses while empowering the next generation of tech professionals."
20+
/>
21+
<meta
22+
property="og:image"
23+
content="https://pub-bb2e103a32db4e198524a2e9ed8f35b4.r2.dev/610c102a-5c96-4c32-a1f9-0ca1b3a40bc9/id-preview-b8dc329d--cbf17d2f-00eb-490b-8690-50cc48660676.lovable.app-1782138778412.png"
24+
/>
25+
26+
<meta name="twitter:card" content="summary_large_image" />
27+
<meta name="twitter:title" content="GhostCode Dynamics — Building Digital Solutions" />
28+
<meta
29+
name="twitter:description"
30+
content="Building digital solutions for businesses while empowering the next generation of tech professionals."
31+
/>
32+
<meta
33+
name="twitter:image"
34+
content="https://pub-bb2e103a32db4e198524a2e9ed8f35b4.r2.dev/610c102a-5c96-4c32-a1f9-0ca1b3a40bc9/id-preview-b8dc329d--cbf17d2f-00eb-490b-8690-50cc48660676.lovable.app-1782138778412.png"
35+
/>
36+
37+
<link rel="icon" href="/favicon.png" type="image/png" sizes="any" />
38+
<link rel="icon" href="/favicon-32x32.png" type="image/png" sizes="32x32" />
39+
<link rel="icon" href="/favicon-16x16.png" type="image/png" sizes="16x16" />
40+
<link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180" />
41+
42+
<script>
43+
// Apply stored theme before paint to avoid flash
44+
(function () {
45+
try {
46+
var t = localStorage.getItem("ghostcode-theme");
47+
var isDark = t ? t === "dark" : true;
48+
document.documentElement.classList.toggle("dark", isDark);
49+
document.documentElement.style.colorScheme = isDark ? "dark" : "light";
50+
} catch (e) {}
51+
})();
52+
53+
// GitHub Pages SPA fallback: if redirected from 404.html with ?/path, restore it.
54+
(function () {
55+
var l = window.location;
56+
if (l.search && l.search.indexOf("?/") === 0) {
57+
var decoded = l.search.slice(2).split("&").map(function (s) {
58+
return s.replace(/~and~/g, "&");
59+
}).join("?");
60+
window.history.replaceState(null, "", l.pathname.slice(0, -1) + decoded + l.hash);
61+
}
62+
})();
63+
</script>
64+
</head>
65+
<body class="min-h-dvh bg-background text-foreground antialiased">
66+
<div id="root"></div>
67+
<script type="module" src="/src/main.tsx"></script>
68+
</body>
69+
</html>

src/main.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { StrictMode } from "react";
2+
import { createRoot } from "react-dom/client";
3+
import { RouterProvider } from "@tanstack/react-router";
4+
5+
import "./styles.css";
6+
import "@fontsource-variable/inter";
7+
import "@fontsource-variable/space-grotesk";
8+
import "@fontsource-variable/jetbrains-mono";
9+
10+
import { getRouter } from "./router";
11+
12+
const router = getRouter();
13+
14+
declare module "@tanstack/react-router" {
15+
interface Register {
16+
router: ReturnType<typeof getRouter>;
17+
}
18+
}
19+
20+
const rootEl = document.getElementById("root")!;
21+
createRoot(rootEl).render(
22+
<StrictMode>
23+
<RouterProvider router={router} />
24+
</StrictMode>,
25+
);

src/routes/__root.tsx

Lines changed: 1 addition & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,8 @@ import {
44
Link,
55
createRootRouteWithContext,
66
useRouter,
7-
HeadContent,
8-
Scripts,
9-
ScriptOnce,
107
} from "@tanstack/react-router";
11-
import { useEffect, type ReactNode } from "react";
12-
13-
import appCss from "../styles.css?url";
14-
import "@fontsource-variable/inter";
15-
import "@fontsource-variable/space-grotesk";
16-
import "@fontsource-variable/jetbrains-mono";
8+
import { useEffect } from "react";
179

1810
import { reportLovableError } from "../lib/lovable-error-reporting";
1911
import { ThemeProvider } from "@/components/theme-provider";
@@ -83,71 +75,11 @@ function ErrorComponent({ error, reset }: { error: Error; reset: () => void }) {
8375
}
8476

8577
export const Route = createRootRouteWithContext<{ queryClient: QueryClient }>()({
86-
head: () => ({
87-
meta: [
88-
{ charSet: "utf-8" },
89-
{ name: "viewport", content: "width=device-width, initial-scale=1" },
90-
{ title: "GhostCode Dynamics — Building Digital Solutions" },
91-
{
92-
name: "description",
93-
content:
94-
"GhostCode Dynamics is a founder-led technology brand building digital solutions for businesses and empowering the next generation of tech professionals.",
95-
},
96-
{ name: "author", content: "GhostCode Dynamics" },
97-
{ name: "theme-color", content: "#0a0a12" },
98-
{ property: "og:site_name", content: "GhostCode Dynamics" },
99-
{ property: "og:type", content: "website" },
100-
{ property: "og:title", content: "GhostCode Dynamics — Building Digital Solutions" },
101-
{
102-
property: "og:description",
103-
content:
104-
"Building digital solutions for businesses while empowering the next generation of tech professionals.",
105-
},
106-
{ name: "twitter:card", content: "summary_large_image" },
107-
{ name: "twitter:title", content: "GhostCode Dynamics — Building Digital Solutions" },
108-
{
109-
name: "twitter:description",
110-
content:
111-
"Building digital solutions for businesses while empowering the next generation of tech professionals.",
112-
},
113-
{ name: "description", content: "A premium, founder-led startup website for GhostCode Dynamics, showcasing digital solutions and tech professional empowerment." },
114-
{ property: "og:description", content: "A premium, founder-led startup website for GhostCode Dynamics, showcasing digital solutions and tech professional empowerment." },
115-
{ name: "twitter:description", content: "A premium, founder-led startup website for GhostCode Dynamics, showcasing digital solutions and tech professional empowerment." },
116-
{ property: "og:image", content: "https://pub-bb2e103a32db4e198524a2e9ed8f35b4.r2.dev/610c102a-5c96-4c32-a1f9-0ca1b3a40bc9/id-preview-b8dc329d--cbf17d2f-00eb-490b-8690-50cc48660676.lovable.app-1782138778412.png" },
117-
{ name: "twitter:image", content: "https://pub-bb2e103a32db4e198524a2e9ed8f35b4.r2.dev/610c102a-5c96-4c32-a1f9-0ca1b3a40bc9/id-preview-b8dc329d--cbf17d2f-00eb-490b-8690-50cc48660676.lovable.app-1782138778412.png" },
118-
],
119-
links: [
120-
{ rel: "stylesheet", href: appCss },
121-
{ rel: "icon", href: "/favicon.png", type: "image/png", sizes: "any" },
122-
{ rel: "icon", href: "/favicon-32x32.png", type: "image/png", sizes: "32x32" },
123-
{ rel: "icon", href: "/favicon-16x16.png", type: "image/png", sizes: "16x16" },
124-
{ rel: "apple-touch-icon", href: "/apple-touch-icon.png", sizes: "180x180" },
125-
],
126-
}),
127-
shellComponent: RootShell,
12878
component: RootComponent,
12979
notFoundComponent: NotFoundComponent,
13080
errorComponent: ErrorComponent,
13181
});
13282

133-
function RootShell({ children }: { children: ReactNode }) {
134-
return (
135-
<html lang="en" className="dark" suppressHydrationWarning>
136-
<head>
137-
<HeadContent />
138-
</head>
139-
<body className="min-h-dvh bg-background text-foreground antialiased">
140-
{/* Apply stored theme before paint to avoid flash */}
141-
<ScriptOnce
142-
children={`(() => { try { const t = localStorage.getItem('ghostcode-theme'); const isDark = t ? t === 'dark' : true; document.documentElement.classList.toggle('dark', isDark); document.documentElement.style.colorScheme = isDark ? 'dark' : 'light'; } catch(e){} })();`}
143-
/>
144-
{children}
145-
<Scripts />
146-
</body>
147-
</html>
148-
);
149-
}
150-
15183
function RootComponent() {
15284
const { queryClient } = Route.useRouteContext();
15385

vite.config.ts

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
1-
// @lovable.dev/vite-tanstack-config already includes the following — do NOT add them manually
2-
// or the app will break with duplicate plugins:
3-
// - tanstackStart, viteReact, tailwindcss, tsConfigPaths, nitro (build-only using cloudflare as a default target),
4-
// componentTagger (dev-only), VITE_* env injection, @ path alias, React/TanStack dedupe,
5-
// error logger plugins, and sandbox detection (port/host/strictPort).
6-
// You can pass additional config via defineConfig({ vite: { ... }, etc... }) if needed.
7-
import { defineConfig } from "@lovable.dev/vite-tanstack-config";
1+
import { defineConfig } from "vite";
2+
import react from "@vitejs/plugin-react";
3+
import tailwindcss from "@tailwindcss/vite";
4+
import tsconfigPaths from "vite-tsconfig-paths";
5+
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
86

7+
// Static SPA build for GitHub Pages.
8+
// If deploying under a sub-path like https://<user>.github.io/<repo>/,
9+
// set VITE_BASE=/<repo>/ in the build environment.
910
export default defineConfig({
10-
tanstackStart: {
11-
// Redirect TanStack Start's bundled server entry to src/server.ts (our SSR error wrapper).
12-
// nitro/vite builds from this
13-
server: { entry: "server" },
11+
base: process.env.VITE_BASE ?? "/",
12+
plugins: [
13+
TanStackRouterVite({
14+
target: "react",
15+
autoCodeSplitting: true,
16+
routesDirectory: "src/routes",
17+
generatedRouteTree: "src/routeTree.gen.ts",
18+
}),
19+
react(),
20+
tailwindcss(),
21+
tsconfigPaths(),
22+
],
23+
server: {
24+
host: "::",
25+
port: 8080,
26+
strictPort: true,
27+
},
28+
build: {
29+
outDir: "dist",
30+
sourcemap: false,
1431
},
1532
});

0 commit comments

Comments
 (0)