From 235238171bbcf8bc5a1a4fafb78f0833084372b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20=C4=B0pek?= Date: Thu, 20 Nov 2025 14:45:24 +0300 Subject: [PATCH] feat: Add README, refactor Cryptomus feature flag to use environment variable, and include GitHub link in header. --- README.md | 73 +++++++++++++++++++++++++++++++++++ src/app/page.tsx | 3 +- src/components/Header.tsx | 43 ++++++++++++--------- src/components/RepoHubApp.tsx | 10 ++--- 4 files changed, 105 insertions(+), 24 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..9d3ea37 --- /dev/null +++ b/README.md @@ -0,0 +1,73 @@ +# RepoHub - Cross-Platform Package Manager + +**Simplify software installation across Linux, Windows, and macOS with official repositories.** + +RepoHub provides a unified interface for package discovery and installation across different operating systems. + +## 🚀 Features + +- **Cross-Platform Support**: Works on Linux (Debian, Ubuntu, Arch, Fedora), Windows, and macOS. +- **Official Repositories**: Access software strictly from trusted, official sources. +- **Script Generation**: Generate idempotent installation scripts for your selected platform. +- **Smart Filtering**: efficiently browse and filter packages. + +## 🛠️ Technology Stack + +### Frontend +- **Framework**: Next.js 14+ (React) +- **Styling**: Tailwind CSS +- **Icons**: Lucide React +- **State Management**: React Query + Zustand + +### Backend +- **Runtime**: Node.js (TypeScript) +- **Database**: PostgreSQL +- **Infrastructure**: Docker + +## 🏁 Getting Started + +### Prerequisites + +- Node.js 18+ +- npm / pnpm / yarn +- Docker (optional, for database) + +### Installation + +1. **Clone the repository:** + ```bash + git clone https://github.com/yusufipk/RepoHub.git + cd RepoHub + ``` + +2. **Install dependencies:** + ```bash + npm install + # or + pnpm install + ``` + +3. **Set up Environment Variables:** + Copy `.env.example` to `.env` and configure your database connection. + ```bash + cp .env.example .env + ``` + +4. **Run the development server:** + ```bash + npm run dev + # or + pnpm dev + ``` + + Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +## 🤝 Contributing + +Contributions are welcome! Please feel free to submit a Pull Request. + +1. Fork the project +2. Create your feature branch (`git checkout -b feature/AmazingFeature`) +3. Commit your changes (`git commit -m 'Add some AmazingFeature'`) +4. Push to the branch (`git push origin feature/AmazingFeature`) +5. Open a Pull Request diff --git a/src/app/page.tsx b/src/app/page.tsx index ed6c968..a4c625b 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,5 +1,6 @@ import { RepoHubApp } from '@/components/RepoHubApp' export default function HomePage() { - return + const cryptomusEnabled = process.env.CRYPTOMUS_ENABLED !== 'false' + return } diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 8bbd134..659ce93 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -5,29 +5,17 @@ import { Button } from '@/components/ui/button' import { useTheme } from '@/hooks/useTheme' import { useLocale } from '@/contexts/LocaleContext' import { SupportModal } from '@/components/SupportModal' -import { Sun, Moon, Monitor, Globe, Heart } from 'lucide-react' +import { Sun, Moon, Monitor, Globe, Heart, Github } from 'lucide-react' import Image from 'next/image' -export function Header() { +export interface HeaderProps { + cryptomusEnabled: boolean +} + +export function Header({ cryptomusEnabled }: HeaderProps) { const { theme, isDark, toggleTheme } = useTheme() const { locale, toggleLocale, t } = useLocale() const [isSupportModalOpen, setIsSupportModalOpen] = useState(false) - const [cryptomusEnabled, setCryptomusEnabled] = useState(true) - - useEffect(() => { - const checkCryptomusStatus = async () => { - try { - const response = await fetch('/api/support/status', { cache: 'no-store' }) - const data = await response.json() - setCryptomusEnabled(data.cryptomus_enabled) - } catch (error) { - // Default to enabled if check fails - setCryptomusEnabled(true) - } - } - - checkCryptomusStatus() - }, []) const getThemeIcon = () => { switch (theme) { @@ -85,6 +73,25 @@ export function Header() { )} + {/* GitHub Link */} + + {/* Theme Toggle */}