Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesPull RequestsActionsSecurityInsightsSettings
✨ AI
More
Blame · Line-by-line history

app.tsx

Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.

app.tsxBlame119 lines · 1 contributor
79136bbClaude1import { Hono } from "hono";
2import { logger } from "hono/logger";
3import { cors } from "hono/cors";
4import { Layout } from "./views/layout";
5import gitRoutes from "./routes/git";
6import apiRoutes from "./routes/api";
7import authRoutes from "./routes/auth";
8import settingsRoutes from "./routes/settings";
9import issueRoutes from "./routes/issues";
10import repoSettings from "./routes/repo-settings";
11import compareRoutes from "./routes/compare";
0074234Claude12import pullRoutes from "./routes/pulls";
13import editorRoutes from "./routes/editor";
c81ab7aClaude14import forkRoutes from "./routes/fork";
15import webhookRoutes from "./routes/webhooks";
16import exploreRoutes from "./routes/explore";
17import tokenRoutes from "./routes/tokens";
43de941Claude18import contributorRoutes from "./routes/contributors";
2c34075Claude19import healthRoutes from "./routes/health";
16b325cClaude20import insightRoutes from "./routes/insights";
f1ab587Claude21import dashboardRoutes from "./routes/dashboard";
79136bbClaude22import webRoutes from "./routes/web";
23
24const app = new Hono();
25
26// Middleware
27app.use("*", logger());
28app.use("/api/*", cors());
29
30// Git Smart HTTP protocol routes (must be before web routes)
31app.route("/", gitRoutes);
32
33// REST API
34app.route("/", apiRoutes);
35
36// Auth routes (register, login, logout)
37app.route("/", authRoutes);
38
39// Settings routes (profile, SSH keys)
40app.route("/", settingsRoutes);
41
c81ab7aClaude42// API tokens
43app.route("/", tokenRoutes);
44
79136bbClaude45// Repo settings (description, visibility, delete)
46app.route("/", repoSettings);
47
c81ab7aClaude48// Webhooks management
49app.route("/", webhookRoutes);
50
79136bbClaude51// Compare view (branch diffs)
52app.route("/", compareRoutes);
53
54// Issue tracker
55app.route("/", issueRoutes);
56
0074234Claude57// Pull requests
58app.route("/", pullRoutes);
59
c81ab7aClaude60// Fork
61app.route("/", forkRoutes);
62
0074234Claude63// Web file editor
64app.route("/", editorRoutes);
65
43de941Claude66// Contributors
67app.route("/", contributorRoutes);
68
2c34075Claude69// Health dashboard
70app.route("/", healthRoutes);
71
16b325cClaude72// Insights (time-travel, dependencies, rollback)
73app.route("/", insightRoutes);
74
f1ab587Claude75// Command center dashboard
76app.route("/", dashboardRoutes);
77
c81ab7aClaude78// Explore page
79app.route("/", exploreRoutes);
80
79136bbClaude81// Web UI (catch-all, must be last)
82app.route("/", webRoutes);
83
84// Global 404
85app.notFound((c) => {
86 return c.html(
87 <Layout title="Not Found">
88 <div class="empty-state">
89 <h2>404</h2>
90 <p>Page not found.</p>
91 <a href="/" style="margin-top: 12px; display: inline-block">
92 Go home
93 </a>
94 </div>
95 </Layout>,
96 404
97 );
98});
99
100// Global error handler
101app.onError((err, c) => {
102 console.error("[error]", err);
103 return c.html(
104 <Layout title="Error">
105 <div class="empty-state">
106 <h2>Something went wrong</h2>
107 <p>An unexpected error occurred.</p>
108 {process.env.NODE_ENV !== "production" && (
109 <pre style="margin-top: 16px; text-align: left; font-size: 12px; color: var(--red)">
110 {err.message}
111 </pre>
112 )}
113 </div>
114 </Layout>,
115 500
116 );
117});
118
119export default app;