Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

KanekiCraynet/komikstream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

398 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š KuroManga

Website untuk membaca komik (manhwa, manhua, manga) dan streaming anime dengan subtitle Indonesia.

CI E2E Tests Deploy Production codecov

Next.js TypeScript Tailwind CSS React Prisma


✨ Fitur

  • πŸ“š Baca Komik - Manhwa, Manhua, dan Manga dengan image viewer
  • 🎬 Streaming Anime - Nonton anime dengan berbagai resolusi
  • πŸ” Pencarian - Cari komik dan anime berdasarkan judul
  • πŸ”– Bookmark - Simpan favorit (localStorage, sync dengan DB jika login)
  • πŸ“œ History - Riwayat baca/tonton dengan progress tracking
  • πŸŒ™ Dark/Light Mode - Toggle tema sesuai preferensi
  • πŸ” Authentication - Login via Email atau Google (Clerk) - Optional!
  • πŸ“± Responsive - Mobile-first design
  • ✨ Animations - Smooth transitions dengan Framer Motion
  • πŸ“„ Pagination - Navigasi halaman untuk list yang panjang

πŸ› οΈ Tech Stack

Category Technology
Framework Next.js 16 (App Router)
Language TypeScript
Styling Tailwind CSS v4
State Zustand
Data Fetching TanStack Query
Forms React Hook Form + Zod
Animation Framer Motion
Auth Clerk (optional)
Database PostgreSQL + Prisma (optional)
API Source Sansekai API

πŸš€ Getting Started

Prerequisites

  • Node.js 20+
  • npm atau yarn
  • (Optional) Akun Clerk untuk autentikasi
  • (Optional) Akun Supabase untuk database

Quick Start (Tanpa Auth/Database)

# 1. Clone repository
git clone https://github.com/KanekiCraynet/komikstream.git
cd komikstream

# 2. Install dependencies
npm install

# 3. Run development server
npm run dev

# 4. Open browser
open http://localhost:3000

πŸ“ Note: Aplikasi dapat berjalan tanpa konfigurasi Clerk atau Supabase. Bookmark dan history akan tersimpan di localStorage.

Full Setup (Dengan Auth & Database)

# 1. Clone repository
git clone https://github.com/KanekiCraynet/komikstream.git
cd komikstream

# 2. Install dependencies
npm install

# 3. Setup environment variables
cp .env.example .env

# 4. Edit .env dengan kredensial Anda:
# - DATABASE_URL (dari Supabase)
# - NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY (dari Clerk)
# - CLERK_SECRET_KEY (dari Clerk)

# 5. Generate Prisma client & push schema
npx prisma generate
npx prisma db push

# 6. Run development server
npm run dev

Docker Setup

# Development dengan hot reload
docker-compose -f docker-compose.dev.yml up

# Production build
docker-compose up -d

# Build image only
docker build -t KuroManga .

πŸ“ Project Structure

β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ workflows/          # GitHub Actions CI/CD
β”‚   β”‚   β”œβ”€β”€ ci.yml          # Lint, test, build
β”‚   β”‚   β”œβ”€β”€ e2e.yml         # Playwright E2E tests
β”‚   β”‚   β”œβ”€β”€ lighthouse.yml  # Performance audits
β”‚   β”‚   β”œβ”€β”€ release.yml     # Auto-release
β”‚   β”‚   β”œβ”€β”€ deploy-*.yml    # Vercel deployments
β”‚   └── dependabot.yml      # Auto dependency updates
β”œβ”€β”€ e2e/                    # Playwright E2E tests
β”œβ”€β”€ __tests__/              # Jest unit tests
β”œβ”€β”€ prisma/
β”‚   └── schema.prisma       # Database schema
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ (auth)/         # Auth routes
β”‚   β”‚   β”œβ”€β”€ anime/          # Anime pages
β”‚   β”‚   β”œβ”€β”€ komik/          # Komik pages
β”‚   β”‚   β”œβ”€β”€ bookmark/       # Bookmark page
β”‚   β”‚   β”œβ”€β”€ history/        # History page
β”‚   β”‚   └── api/            # API routes
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ layout/         # Navbar, Footer, Sidebar
β”‚   β”‚   β”œβ”€β”€ ui/             # Reusable UI components
β”‚   β”‚   └── providers/      # Context providers
β”‚   β”œβ”€β”€ lib/                # Utilities & API client
β”‚   β”œβ”€β”€ stores/             # Zustand stores
β”‚   β”œβ”€β”€ types/              # TypeScript types
β”‚   └── hooks/              # Custom React hooks
β”œβ”€β”€ Dockerfile              # Production Docker image
β”œβ”€β”€ docker-compose.yml      # Production compose
└── docker-compose.dev.yml  # Development compose

πŸ§ͺ Testing

# Unit tests
npm test                    # Run all tests
npm run test:watch          # Watch mode
npm run test:coverage       # With coverage report

# E2E tests (Playwright)
npm run test:e2e            # Run E2E tests
npm run test:e2e:ui         # With UI mode
npm run test:e2e:headed     # With browser visible
npm run test:e2e:report     # View last report

πŸ“Š CI/CD Pipeline

Pipeline otomatis yang berjalan di setiap push/PR:

Workflow Trigger Description
CI Push, PR Lint, TypeScript, Unit Tests, Build, Security
E2E Push, PR Playwright tests (Chrome, Firefox, Mobile)
Lighthouse Push, PR Performance, Accessibility, SEO audits
Deploy Preview PR Deploy preview ke Vercel
Deploy Production Push to main Deploy ke production
Deploy Staging Push to staging Deploy ke staging environment
Release Push to main Auto-versioning & changelog

Required Secrets

Setup secrets di GitHub repository settings:

Secret Description
VERCEL_TOKEN Vercel API token
VERCEL_ORG_ID Vercel organization ID
VERCEL_PROJECT_ID Vercel project ID
CODECOV_TOKEN (Optional) Codecov token

πŸ”Œ API Endpoints

External (Sansekai API)

Komik

  • GET /komik/recommended?type={manhwa|manhua|manga} - Rekomendasi
  • GET /komik/latest?type={project|mirror} - Terbaru
  • GET /komik/search?query={query} - Pencarian
  • GET /komik/popular?page={page} - Populer
  • GET /komik/detail?manga_id={id} - Detail
  • GET /komik/chapterlist?manga_id={id} - Daftar chapter
  • GET /komik/getimage?chapter_id={id} - Gambar chapter

Anime

  • GET /anime/latest - Terbaru
  • GET /anime/recommended?page={page} - Rekomendasi
  • GET /anime/search?query={query} - Pencarian
  • GET /anime/detail?urlId={id} - Detail
  • GET /anime/movie - List movie
  • GET /anime/getvideo?chapterUrlId={id}&reso={resolution} - Streaming

Internal (App API)

  • GET/POST/DELETE /api/bookmarks - Manage bookmarks
  • GET/POST/DELETE /api/history - Manage history
  • GET /api/health - Health check (for Docker/monitoring)
  • POST /api/webhooks/clerk - Clerk webhooks

πŸ“ Environment Variables

# Database (Optional - for user sync)
DATABASE_URL="postgresql://..."

# Clerk Authentication (Optional)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_..."
CLERK_SECRET_KEY="sk_..."
CLERK_WEBHOOK_SECRET="whsec_..."

# Clerk URLs (optional)
NEXT_PUBLIC_CLERK_SIGN_IN_URL="/sign-in"
NEXT_PUBLIC_CLERK_SIGN_UP_URL="/sign-up"

# API
NEXT_PUBLIC_API_URL="https://api.sansekai.my.id/api"

# Build (CI only)
SKIP_DB_CONNECTION="true"

🎨 Features Breakdown

Animations

  • Hero section fade-in animations
  • Card hover lift effects
  • Staggered grid animations
  • Page transition effects
  • Scroll-triggered animations

TanStack Query Hooks

  • useKomikLatest() - Fetch latest komik
  • useKomikPopular(page) - Fetch popular with pagination
  • useKomikSearch(query) - Search komik
  • useAnimeLatest() - Fetch latest anime
  • useAnimeRecommended(page) - Fetch recommended anime
  • ... and more!

🚒 Deployment

Vercel (Recommended)

  1. Push code ke GitHub
  2. Import project di Vercel
  3. Add environment variables
  4. Deploy!

Docker

# Build image
docker build -t komikstream .

# Run container
docker run -p 3000:3000 \
  -e DATABASE_URL="..." \
  -e NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="..." \
  -e CLERK_SECRET_KEY="..." \
  KuroManga

Manual

npm run build
npm start

πŸ“ˆ Monitoring (Optional)

Production Architecture

KuroManga uses a dual-environment architecture for optimal performance and reliability:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        User Request                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Cloudflare Worker (Edge Proxy)                     β”‚
β”‚  β€’ Global edge locations (low latency)                          β”‚
β”‚  β€’ L1 Cache: CF Cache API (5-15 min TTL)                        β”‚
β”‚  β€’ API Proxy: Bypasses origin IP blocks                         β”‚
β”‚  β€’ Analytics: CF Analytics Engine                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚               Azure App Service (Origin)                        β”‚
β”‚  β€’ Next.js SSR with full Node.js runtime                        β”‚
β”‚  β€’ L2 Cache: PostgreSQL (Supabase) with TTL                     β”‚
β”‚  β€’ L3: External API (sankavollerei.com)                         β”‚
β”‚  β€’ L4: Stale fallback (expired DB cache)                        β”‚
β”‚  β€’ Observability: Azure Application Insights                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Caching tiers:

Tier Location TTL Purpose
L1 CF Cache API 5-15 min Edge caching, reduces origin load
L2 PostgreSQL 30 min DB cache with structured data
L3 External API ISR Fresh data from source
L4 Stale DB ∞ Fallback when API is blocked/down

Azure Application Insights

The app tracks comprehensive metrics via Azure App Insights:

Events tracked:

  • cache_hit / cache_miss / cache_stale β€” Per-tier cache performance
  • api_success / api_error / api_retry / api_timeout β€” External API health
  • rate_limit_hit β€” 429 responses from external API
  • db_error β€” Database connection/query failures

KQL Queries for App Insights:

// Cache hit rate by tier (last 24h)
customEvents
| where timestamp > ago(24h)
| where name in ("cache_hit", "cache_miss", "cache_stale")
| summarize count() by name, tostring(customDimensions.cacheTier)
| render piechart

// API latency percentiles (last 1h)
customMetrics
| where timestamp > ago(1h)
| where name endswith "_duration_ms"
| summarize 
    p50=percentile(value, 50),
    p95=percentile(value, 95),
    p99=percentile(value, 99)
  by name
| order by p95 desc

// External API error rate (last 6h)
customEvents
| where timestamp > ago(6h)
| where name in ("api_success", "api_error", "api_timeout", "rate_limit_hit")
| summarize count() by name, bin(timestamp, 15m)
| render timechart

// Stale fallback usage (indicates API issues)
customEvents
| where timestamp > ago(24h)
| where name == "cache_stale"
| summarize count() by tostring(customDimensions.contentType), bin(timestamp, 1h)
| render timechart

// Slowest endpoints (last 1h)
customEvents
| where timestamp > ago(1h)
| where name == "api_success"
| extend durationMs = toint(customMeasurements.durationMs)
| summarize avg(durationMs), max(durationMs), count() by tostring(customDimensions.context)
| order by avg_durationMs desc
| take 10

Recommended Alerts:

Alert Condition Severity
High API error rate api_error count > 50 in 15 min Warning
Stale fallback spike cache_stale count > 20 in 15 min Warning
Rate limiting rate_limit_hit count > 10 in 5 min Critical
Slow API response P95 latency > 3000ms Warning

UptimeRobot Setup

  1. Buat akun di UptimeRobot (free)
  2. Add new monitor:
    • Monitor Type: HTTP(s)
    • URL: https://your-domain.vercel.app/api/health
    • Monitoring Interval: 5 minutes
  3. Setup alert contacts (email/Telegram/Slack)

Health Check Endpoint

curl https://your-domain.vercel.app/api/health

Response:

{
  "status": "healthy",
  "timestamp": "2024-01-01T00:00:00.000Z",
  "uptime": 12345.67,
  "version": "0.1.0",
  "checks": {
    "database": "connected",
    "api": "operational"
  },
  "responseTime": "5ms"
}

πŸ“œ License

MIT License - feel free to use for personal projects.


πŸ™ Credits


🀝 Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feat/amazing-feature)
  3. Commit changes (git commit -m 'feat: add amazing feature')
  4. Push to branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

Commit Convention

We use Conventional Commits:

  • feat: - New feature
  • fix: - Bug fix
  • docs: - Documentation
  • style: - Formatting
  • refactor: - Code refactoring
  • test: - Adding tests
  • chore: - Maintenance

About

Website untuk membaca komik (manhwa, manhua, manga) dan streaming anime dengan subtitle Indonesia. Built with Next.js 16, TypeScript, Tailwind CSS, and Prisma.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages