--- import BaseLayout from "../layouts/BaseLayout.astro"; import { Header } from "../components/layout/Header"; import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "../components/ui/card"; import { Button } from "../components/ui/button"; import { Badge } from "../components/ui/badge"; import { Globe, Star, Users, TrendingUp, Zap, Server, GitFork, ShieldCheck, Network, ArrowRight, Sparkles, Layers, Code2 } from "lucide-react"; import { verifyToken } from "../lib/auth"; import { getDb } from "../lib/db"; import { instances, cachedRepos, communityUsers } from "../lib/db/schema"; import { sql, desc } from "drizzle-orm"; const token = Astro.cookies.get("community_session")?.value; const user = token ? await verifyToken(token) : null; const db = getDb() as any; const instancesCount = await db.select({ count: sql`count(*)` }).from(instances).then((res: any) => res[0].count).catch(() => 0); const reposCount = await db.select({ count: sql`count(*)` }).from(cachedRepos).then((res: any) => res[0].count).catch(() => 0); const usersCount = await db.select({ count: sql`count(*)` }).from(communityUsers).then((res: any) => res[0].count).catch(() => 0); // Fetch a few featured repos for the hero showcase const featuredRepos = await db.query.cachedRepos.findMany({ orderBy: [desc(cachedRepos.starCount), desc(cachedRepos.updatedAt)], limit: 3, with: { instance: true } }).catch(() => []); ---
{/* Ambient background glow */}
Decentralized & Self-Hosted Hub

Discover Open Source Beyond
Centralized Platforms

Aggregating public repositories, developers, and code from self-hosted OpenCodeHub nodes worldwide. Explore, star, follow, and federate without lock-in.

{instancesCount || 0}
Active Nodes
{reposCount || 0}
Public Repos
{usersCount || 0}
Community Users

Why the OpenCodeHub Network?

A truly open collaboration hub designed for self-hosters, sovereign developers, and private organizations.

Federated Discovery

Run your own instance on bare-metal or cloud. Submit your URL once, and your public projects become discoverable globally while remaining entirely on your server.

Global Social Graph

Star repositories, follow profiles, and track contributions across different nodes. Your activity seamlessly aggregates into your unified Community dashboard.

Privacy & Sovereignty

Only explicit visibility=public projects are indexed. Private repositories and credentials never leave your local infrastructure.

Simple Architecture

How It Works

From submitting your URL to global synchronization, the process is zero-configuration and automated.

1

Submit Node

Paste your instance URL (e.g. https://code.example.com) at the submission portal.

2

Verification

Our edge worker probes /api/instance to verify health and discover supported features.

3

Continuous Sync

Public repos, owner profiles, stars, and tags are cached in Turso and refreshed periodically.

4

Collaborate

Clone directly via httpCloneUrl, star locally, and open cross-node pull requests.

Ready to Connect Your Instance?

Join the federated network today. It only takes 5 seconds to submit your URL and get listed.