Skip to content

Repository files navigation

Galay — Gas sampai Overlay

Sistem auto-edit video untuk tim kreatif. 15 cut, 30 detik, multi-platform siap upload. Free & open-source. Zero paid dependencies. Zero copyright risk.

Tech Stack

  • Framework: Next.js 16 (App Router) + TypeScript
  • Database: Prisma ORM + SQLite (free)
  • Auth: Custom cookie-based session with bcrypt + HMAC (no NextAuth needed)
  • UI: Tailwind CSS 4 + shadcn/ui (New York) + Lucide icons
  • State: Zustand
  • Music Library: 100% free sources (Pixabay, Mixkit, FMA CC0, YouTube Audio Library, platform-native)

Color Identity

  • Purple Haze: oklch(0.55 0.22 295) — primary
  • Gold: oklch(0.82 0.15 88) — accent
  • Shimmering Silver: oklch(0.78 0.02 280) — secondary

Quick Start

# 1. Install dependencies
bun install

# 2. Setup environment
cp .env.example .env
# Edit .env and set GALAY_SESSION_SECRET to a random 32+ char string

# 3. Initialize database
bun run db:push
bun run scripts/seed.ts

# 4. Run dev server
bun run dev

Open http://localhost:3000 (or check the Preview Panel).

Default Logins

Role Email Password
Super Admin admin@galay.local GalayAdmin2026!
Editor (demo) editor@galay.local EditorGalay2026!

⚠️ Change these passwords immediately in production via Super Admin → User Management.

System Architecture

3 Roles (Invitation-Only)

Role Akses
👑 Super Admin Full system: users, brands, music, overlays, audit
🎬 Editor Create projects, upload, edit, export
👁️ Viewer Read-only (shared projects)

Only Super Admin can create new accounts.

7-Stage Project Workflow

1. Create Project    — Pilih durasi, platform, template, mode
2. Upload Clips      — 15 cut (segmented 5+5+5 atau free)
3. Pre-Clean         — Otomatis: black frame, pre/post-roll, shake, duplicate
4. Review            — Editor accept/adjust/reject per clip
5. Music Selection   — Free library, filter by mood/BPM/source
6. Auto-Edit         — 5-tier scoring, beat-sync, hook from Payoff
7. Export            — Local drive atau auto-upload multi-platform

Galay Rules

  • Cut Formula: Cuts = Duration ÷ 2 (e.g., 30s = 15 cut)
  • Pacing: Adaptif per platform (TikTok 1.5s, Reels 2s, IG 3s, YouTube 4s)
  • Capture Mantra: 1-2-3 SIAP — 1-2-3 AKSI — 1-2-3 TAHAN (5-6s per cut)
  • Templates: Highlight (5s/cut) & Story (6s/cut)
  • Beat Sheet: Setup → Build → Payoff (hook dari Payoff)

Free Music Library (Zero Copyright Risk)

Source License Attribution
Platform-Native (TikTok/IG/YT) Official None
Pixabay Music Pixabay (CC0-like) None
Mixkit Music Mixkit Free None
FMA CC0 CC0 None
YouTube Audio Library YT Audio Lib Optional per track

Project Structure

src/
├── app/
│   ├── page.tsx                          # Main app shell (single route)
│   ├── layout.tsx                        # Root layout + theme provider
│   ├── globals.css                       # Galay design system
│   └── api/
│       ├── auth/{login,logout,me,change-password}/
│       ├── users/                        # Super Admin: user CRUD
│       ├── brands/                       # Brand library
│       ├── overlays/                     # PNG overlay management
│       ├── music/                        # Free music library
│       ├── projects/                     # Project CRUD
│       │   └── [id]/{clips,preclean,autoedit,export}/
│       └── audit/                        # Audit log
├── components/
│   ├── ui/                               # shadcn/ui (pre-installed)
│   └── galay/
│       ├── theme-provider.tsx
│       ├── login-screen.tsx
│       ├── sidebar.tsx
│       ├── galay-logo.tsx
│       ├── dashboard/
│       │   ├── dashboard.tsx
│       │   └── guide-page.tsx
│       ├── projects/
│       │   ├── create-project.tsx        # Stage 1
│       │   └── project-view.tsx          # Stages 2-7
│       └── admin/
│           ├── admin-users.tsx
│           ├── admin-brands.tsx
│           ├── admin-music.tsx
│           ├── admin-overlays.tsx
│           └── admin-audit.tsx
├── lib/
│   ├── db.ts                             # Prisma client
│   ├── utils.ts                          # cn() helper
│   └── galay/
│       ├── constants.ts                  # All Galay rules
│       └── auth.ts                       # Auth + session + audit log
└── stores/
    ├── session.ts                        # Zustand: user session
    └── ui.ts                             # Zustand: view routing

prisma/
└── schema.prisma                         # 8 models: User, Brand, Project, Clip, etc.

scripts/
└── seed.ts                               # Seed super admin + demo editor + 10 tracks

Production Deployment

Option A: Cloudflare Pages (Recommended — Free)

  1. Push to GitHub (see instructions below)
  2. Connect repo to Cloudflare Pages
  3. Build settings:
    • Build command: bun run build
    • Output directory: .next
    • Node version: 20+
  4. Environment variables:
    • DATABASE_URL → Cloudflare D1 (free SQLite-compatible)
    • GALAY_SESSION_SECRET → random 32+ char string
    • NODE_ENV=production
  5. Deploy

Option B: Vercel (Also Free)

  1. Push to GitHub
  2. Import repo at vercel.com
  3. Set environment variables (same as above)
  4. Deploy

GitHub Repository Setup

# 1. Initialize git (skip if already done)
git init
git add .
git commit -m "feat: Galay initial commit — auto-edit video system"

# 2. Create repo on GitHub (manual via web, OR via API)
# Replace YOUR_GITHUB_TOKEN with your PAT (do NOT commit the token!)
export GH_TOKEN="your_github_token_here"
curl -X POST -H "Authorization: token $GH_TOKEN" \
  -H "Accept: application/vnd.github+json" \
  https://api.github.com/user/repos \
  -d '{"name":"Galay","description":"Auto-edit video system — Gas sampai Overlay","private":true}'

# 3. Add remote & push
git remote add origin https://github.com/YOUR_USERNAME/Galay.git
git branch -M main
git push -u origin main

# 4. IMMEDIATELY revoke the GitHub PAT after push (security best practice)

⚠️ Security: Never commit .env, tokens, or credentials. The .gitignore in this repo already excludes them. After pushing, revoke & regenerate any PAT that was shared in chat or stored locally.

Security Features

  • ✅ Invitation-only account creation (Super Admin only)
  • ✅ Strong password policy (min 8 char, mixed case + symbol enforced on first login)
  • ✅ Failed login lockout (5 attempts → 15 min lock)
  • ✅ Session timeout (7 days, configurable)
  • ✅ HTTP-only session cookies with HMAC signature
  • ✅ Brand scoping (editor only sees assigned brands)
  • ✅ Project ownership (editor only sees own projects)
  • ✅ Full audit trail (all actions logged)

License

MIT — Free for commercial & personal use.

Credits

Built with Galay design system — Purple Haze × Gold × Shimmering Silver.

About

Galay — Gas sampai Overlay. Auto-edit video system untuk tim kreatif. Free & open-source.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages