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.tsxBlame115 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";
79136bbClaude21import webRoutes from "./routes/web";
22
23const app = new Hono();
24
25// Middleware
26app.use("*", logger());
27app.use("/api/*", cors());
28
29// Git Smart HTTP protocol routes (must be before web routes)
30app.route("/", gitRoutes);
31
32// REST API
33app.route("/", apiRoutes);
34
35// Auth routes (register, login, logout)
36app.route("/", authRoutes);
37
38// Settings routes (profile, SSH keys)
39app.route("/", settingsRoutes);
40
c81ab7aClaude41// API tokens
42app.route("/", tokenRoutes);
43
79136bbClaude44// Repo settings (description, visibility, delete)
45app.route("/", repoSettings);
46
c81ab7aClaude47// Webhooks management
48app.route("/", webhookRoutes);
49
79136bbClaude50// Compare view (branch diffs)
51app.route("/", compareRoutes);
52
53// Issue tracker
54app.route("/", issueRoutes);
55
0074234Claude56// Pull requests
57app.route("/", pullRoutes);
58
c81ab7aClaude59// Fork
60app.route("/", forkRoutes);
61
0074234Claude62// Web file editor
63app.route("/", editorRoutes);
64
43de941Claude65// Contributors
66app.route("/", contributorRoutes);
67
2c34075Claude68// Health dashboard
69app.route("/", healthRoutes);
70
16b325cClaude71// Insights (time-travel, dependencies, rollback)
72app.route("/", insightRoutes);
73
c81ab7aClaude74// Explore page
75app.route("/", exploreRoutes);
76
79136bbClaude77// Web UI (catch-all, must be last)
78app.route("/", webRoutes);
79
80// Global 404
81app.notFound((c) => {
82 return c.html(
83 <Layout title="Not Found">
84 <div class="empty-state">
85 <h2>404</h2>
86 <p>Page not found.</p>
87 <a href="/" style="margin-top: 12px; display: inline-block">
88 Go home
89 </a>
90 </div>
91 </Layout>,
92 404
93 );
94});
95
96// Global error handler
97app.onError((err, c) => {
98 console.error("[error]", err);
99 return c.html(
100 <Layout title="Error">
101 <div class="empty-state">
102 <h2>Something went wrong</h2>
103 <p>An unexpected error occurred.</p>
104 {process.env.NODE_ENV !== "production" && (
105 <pre style="margin-top: 16px; text-align: left; font-size: 12px; color: var(--red)">
106 {err.message}
107 </pre>
108 )}
109 </div>
110 </Layout>,
111 500
112 );
113});
114
115export default app;