Skip to content

Crystal-Studio-Labs/Crystal-Comics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’Ž Crystal Comics (crystal-scans)

A Modern, Production-Ready, Self-Hostable Manga & Manhwa Scanlation Platform Template

Built with AI Powered by Antigravity AI React TypeScript Vite Supabase Cloudflare R2 Discord License: MIT

Live Demo โ€ข Deployment Guide โ€ข Design System โ€ข Architecture โ€ข Documentation Hub


๐Ÿค– Built with AI & Vibe Coded

โœจ 100% Vibe Coded with AI Engineering

Crystal Comics was architected, written, styled, and deployed using Google Antigravity AI in a pure Vibe Coding workflow!

  • โšก Autonomous Architecture: Full system design, dual-DB failover engines, and Cloudflare R2 storage integration generated iteratively via prompt engineering.
  • ๐ŸŽจ Vibe Aesthetics: Handcrafted obsidian glassmorphism UI, custom CSS animations, and responsive control docks tailored for manhwa/manga scanlation platforms.
  • ๐Ÿ› ๏ธ Zero-Error Build Pipeline: Complete TypeScript type safety, automated verification (npm run build), and GitHub CI readiness out-of-the-box.

๐ŸŒŸ Overview

Crystal Comics is an open-source, self-hostable manga/manhwa reading platform designed for scanlation teams, comic creators, and webtoon publishers. Inspired by industry-leading platforms like Asura Scans and Flame Comics, it combines high-impact dark glassmorphism UI with enterprise-grade cloud architecture.

Built to run 100% free of charge, Crystal Comics leverages Cloudflare R2 ($0 egress bandwidth fees), Supabase Auth & Dual-DB Failover, and Discord Linked Roles Integration to serve millions of chapter page views without cloud server bills.


๐Ÿ”ฅ Key Features Matrix

Feature Description Inspired By / Tech
๐ŸŽจ Dark Glassmorphism UI Sleek obsidian surfaces (#050508), neon violet accents (#8B5CF6), and floating glass control docks. Asura Scans
๐Ÿ“– Dual Reader Engine Instant toggle between Vertical Continuous Webtoon Scroll and Horizontal Paged Spread with panel preloading. Flame Comics
๐Ÿ–ผ๏ธ Serialized Chapter Ingestion Batch upload 30โ€“50 panels with natural alphanumeric sorting (01, 02...) and drag-and-drop re-ordering. Admin Console
โ˜๏ธ Zero Egress Image CDN Cloudflare R2 integration for uploading and serving high-res chapter panels with $0 egress fees. Cloudflare R2 S3 API
๐Ÿ†” Discord Profile Sync Full extraction and sync of Discord Avatar URL, @username, and Display Name (Global Name) across profiles and comments. Discord OAuth 2.0
๐Ÿ’ณ Guild Payment Portal Multi-gateway checkout portal supporting Lemon Squeezy, Stripe Checkout, PayPal, and instant test unlocks. Payment Webhooks
๐Ÿ” Supabase OAuth & DB Discord OAuth authentication, PostgreSQL catalog storage, and Row Level Security (RLS) policies. Supabase Auth
๐Ÿ›ก๏ธ Dual-DB Failover Engine Automatic primary/secondary Supabase connection resolver that switches DB instances if primary is paused or full. Custom Failover
โฐ 24/7 Auto-Keep-Alive Background 48-hour heartbeat scheduler preventing free-tier Supabase projects from auto-pausing after inactivity. Express Scheduler
๐Ÿค– Discord Linked Roles Direct synchronization of user site ranks (S-Rank, Knight, Sovereign) onto Discord profile cards (role_connections.write). Discord API v10
โœจ Gemini AI Assistant AI-powered manhwa recommendation assistant (components/CrystalAI.tsx) analyzing tags and reading history. Gemini AI
๐ŸŽฎ Gamification & XP User level progression (+50 XP/chapter), S-Rank gameplay badges, unlockable achievements, and reading history tracking. Gamified UX

๐Ÿš€ Quickstart (Zero Configuration)

Get Crystal Comics running locally in 3 simple commands. If Supabase keys are not present, the app automatically falls back to an out-of-the-box local mock database (services/mockBackend.ts).

# 1. Clone the repository
git clone https://github.com/your-org/crystal-comics.git
cd crystal-comics

# 2. Install dependencies
npm install

# 3. Start local development server
npm run dev

Open http://localhost:5173/ in your browser to view the application live!


๐Ÿ“‚ Repository Sitemap & Architecture

Crystal-Comics/
โ”œโ”€โ”€ .env.example                          # ๐Ÿ“„ Template environment variables configuration
โ”œโ”€โ”€ DEPLOYMENT.md                         # ๐ŸŒ Step-by-step 100% free hosting guide
โ”œโ”€โ”€ SECURITY.md                           # ๐Ÿ›ก๏ธ Vulnerability disclosure & RLS security policies
โ”œโ”€โ”€ CODE_OF_CONDUCT.md                    # ๐Ÿค Contributor Covenant v2.1 community guidelines
โ”œโ”€โ”€ CONTRIBUTING.md                       # ๐Ÿ› ๏ธ Contribution guide & PR workflow
โ”œโ”€โ”€ LICENSE                               # ๐Ÿ“œ MIT License
โ”œโ”€โ”€ docs/                                 # ๐Ÿ“š Technical Specification Documents
โ”‚   โ”œโ”€โ”€ architecture.md                   # ๐Ÿ—๏ธ System architecture & data flow specification
โ”‚   โ”œโ”€โ”€ design.md                         # ๐ŸŽจ UI/UX design system, color tokens & reader specs
โ”‚   โ”œโ”€โ”€ memory.md                         # ๐Ÿง  Self-contained Architectural Decision Records (ADRs)
โ”‚   โ”œโ”€โ”€ phases.md                         # ๐Ÿš€ Multi-phase implementation roadmap
โ”‚   โ””โ”€โ”€ rules.md                          # ๐Ÿ“œ Engineering standards & anti-patterns checklist
โ”œโ”€โ”€ bot/                                  # ๐Ÿค– Discord Bot Daemon
โ”‚   โ””โ”€โ”€ keep-alive.js                     # Auto-role member join & bot status presence script
โ”œโ”€โ”€ scripts/                              # ๐Ÿ› ๏ธ CLI Setup Utility Scripts
โ”‚   โ””โ”€โ”€ register-discord-linked-roles.js   # Discord Linked Roles metadata setup script
โ”œโ”€โ”€ server/                               # โšก Express Backend Server (R2 + Discord + Keep-Alive)
โ”‚   โ”œโ”€โ”€ config.js                         # Server environment configuration loader
โ”‚   โ”œโ”€โ”€ index.js                          # Express API backend server entry point
โ”‚   โ”œโ”€โ”€ keep-alive-db.js                  # Background 48h Supabase keep-alive ping engine
โ”‚   โ””โ”€โ”€ routes/
โ”‚       โ”œโ”€โ”€ discord.js                    # Discord Linked Roles OAuth code exchange
โ”‚       โ””โ”€โ”€ storage.js                    # Cloudflare R2 presigned upload URL endpoints
โ”œโ”€โ”€ services/                             # ๐Ÿ’พ Frontend Cloud Adapters & Data Services
โ”‚   โ”œโ”€โ”€ dbService.ts                      # Dual-DB failover database adapter
โ”‚   โ”œโ”€โ”€ discordConfig.ts                  # Discord role mapping & Edge Function bridge
โ”‚   โ”œโ”€โ”€ discordLinkedRoles.ts             # Discord Linked Roles client API helper
โ”‚   โ”œโ”€โ”€ mockBackend.ts                    # LocalStorage fallback database & API mock
โ”‚   โ”œโ”€โ”€ storageService.ts                 # Cloudflare R2 S3 storage adapter
โ”‚   โ””โ”€โ”€ supabase.ts                       # Primary & Secondary Supabase client manager
โ””โ”€โ”€ supabase/                             # โšก Supabase Cloud Infrastructure
    โ”œโ”€โ”€ schema.sql                        # Complete PostgreSQL DDL & RLS security policies
    โ””โ”€โ”€ functions/
        โ””โ”€โ”€ discord-role-sync/
            โ””โ”€โ”€ index.ts                  # Deno Edge Function for Discord server roles

๐Ÿ› ๏ธ Environment Variables Configuration

Copy .env.example to .env and configure your credentials:

Environment Variable Service Description
VITE_SUPABASE_URL Supabase Primary Supabase project URL
VITE_SUPABASE_ANON_KEY Supabase Primary Supabase anon public API key
VITE_SUPABASE_SECONDARY_URL Supabase Secondary Supabase failover project URL (Optional)
VITE_SUPABASE_SECONDARY_ANON_KEY Supabase Secondary Supabase failover anon key (Optional)
VITE_CLOUDFLARE_R2_PUBLIC_URL Cloudflare R2 Public CDN domain (e.g. https://cdn.yourdomain.com)
CLOUDFLARE_R2_ACCESS_KEY_ID Cloudflare R2 S3 API Access Key ID
CLOUDFLARE_R2_SECRET_ACCESS_KEY Cloudflare R2 S3 API Secret Access Key
DISCORD_CLIENT_ID Discord Application Client ID from Discord Dev Portal
DISCORD_CLIENT_SECRET Discord Application Client Secret from Discord Dev Portal
DISCORD_BOT_TOKEN Discord Bot User Authentication Token

๐Ÿ“š Documentation Index


๐Ÿ“„ License

This project is open-source software licensed under the MIT License. Free to use, modify, and host for personal, scanlation, or commercial projects.

Releases

Packages

Contributors

Languages