Skip to main content

daw.club — Gitea Frontend

Custom React frontend for browsing and managing Songbird projects hosted on the Gitea instance at git.daw.club. Live: https://daw.club (Cloudflare Pages) API backend: https://git.daw.club (Gitea 1.22.6 on GCE)

Stack

  • Vite + React 19 + TypeScript
  • Tailwind CSS v4 with @tailwindcss/vite plugin
  • Design tokens: Zinc (dark) + Emerald (accent) palette, Inter font — matches Songbird’s design system
  • shadcn/ui-style components (Button, Card, Input) using class-variance-authority
  • Lucide React for icons
  • React Router v7 for client-side routing

Pages

Quick Start

The dev server starts at http://localhost:5173. By default it talks to https://git.daw.club.

Environment Variables

Copy .env.example to .env to configure:

Build

Production build outputs to dist/ (~285 KB JS, ~90 KB gzipped).

Deploy to Cloudflare Pages

The frontend is deployed as a static site on Cloudflare Pages.

Prerequisites

  • Wrangler CLI: npm install -g wrangler
  • Cloudflare API token with Cloudflare Pages: Edit + Zone DNS: Edit permissions
  • Set environment variables:

Deploy

The site is available at:

First-time setup (already done)

If setting up from scratch:

API Layer

The API client lives in src/lib/api.ts. It wraps the Gitea REST API and handles:
  • Auth: Token creation via HTTP Basic Auth (POST /users/:username/tokens), stored in localStorage
  • Repos: Search, get, update, delete
  • Contents: File/directory listing, archive download (fetch-based, no token in URL)
  • Users: Get user profile, list user repos

Auth flow

  1. User enters username/password on /login
  2. Frontend creates an API token via Gitea’s basic auth endpoint
  3. Token stored in localStorage as gitea_token
  4. All subsequent API calls include Authorization: token <sha1> header
  5. Registration redirects to Gitea’s native sign-up page at git.daw.club/user/sign_up

CORS

Gitea must have CORS enabled in /etc/gitea/app.ini on the server:

Project Structure

Design Notes

  • Dark theme: Uses color-scheme: dark on :root plus !important on html/body/#root background to override Tailwind v4’s base layer cascade. Inline style on <body> in index.html as an additional fallback.
  • Inter font: Loaded from Google Fonts CDN. Falls back to system-ui if unavailable.
  • Auth state: Lives in module-level variables + localStorage, not React state. UI reactivity depends on navigation re-renders after login/logout.
  • No automated tests: All behavior is verified via manual E2E testing against the live Gitea instance.