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.tsxBlame123 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";
36b4cbdClaude22import legalRoutes from "./routes/legal";
79136bbClaude23import webRoutes from "./routes/web";
24
25const app = new Hono();
26
27// Middleware
28app.use("*", logger());
29app.use("/api/*", cors());
30
31// Git Smart HTTP protocol routes (must be before web routes)
32app.route("/", gitRoutes);
33
34// REST API
35app.route("/", apiRoutes);
36
37// Auth routes (register, login, logout)
38app.route("/", authRoutes);
39
40// Settings routes (profile, SSH keys)
41app.route("/", settingsRoutes);
42
c81ab7aClaude43// API tokens
44app.route("/", tokenRoutes);
45
79136bbClaude46// Repo settings (description, visibility, delete)
47app.route("/", repoSettings);
48
c81ab7aClaude49// Webhooks management
50app.route("/", webhookRoutes);
51
79136bbClaude52// Compare view (branch diffs)
53app.route("/", compareRoutes);
54
55// Issue tracker
56app.route("/", issueRoutes);
57
0074234Claude58// Pull requests
59app.route("/", pullRoutes);
60
c81ab7aClaude61// Fork
62app.route("/", forkRoutes);
63
0074234Claude64// Web file editor
65app.route("/", editorRoutes);
66
43de941Claude67// Contributors
68app.route("/", contributorRoutes);
69
2c34075Claude70// Health dashboard
71app.route("/", healthRoutes);
72
16b325cClaude73// Insights (time-travel, dependencies, rollback)
74app.route("/", insightRoutes);
75
f1ab587Claude76// Command center dashboard
77app.route("/", dashboardRoutes);
78
36b4cbdClaude79// Legal pages (terms, privacy, AUP)
80app.route("/", legalRoutes);
81
c81ab7aClaude82// Explore page
83app.route("/", exploreRoutes);
84
79136bbClaude85// Web UI (catch-all, must be last)
86app.route("/", webRoutes);
87
88// Global 404
89app.notFound((c) => {
90 return c.html(
91 <Layout title="Not Found">
92 <div class="empty-state">
93 <h2>404</h2>
94 <p>Page not found.</p>
95 <a href="/" style="margin-top: 12px; display: inline-block">
96 Go home
97 </a>
98 </div>
99 </Layout>,
100 404
101 );
102});
103
104// Global error handler
105app.onError((err, c) => {
106 console.error("[error]", err);
107 return c.html(
108 <Layout title="Error">
109 <div class="empty-state">
110 <h2>Something went wrong</h2>
111 <p>An unexpected error occurred.</p>
112 {process.env.NODE_ENV !== "production" && (
113 <pre style="margin-top: 16px; text-align: left; font-size: 12px; color: var(--red)">
114 {err.message}
115 </pre>
116 )}
117 </div>
118 </Layout>,
119 500
120 );
121});
122
123export default app;