Skip to content

kpg-anon/4chmg2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

29 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

4CHMG2 Mascot

4CHMG2

4chan Media Gallery 2.0 โ€” a cross-imageboard media aggregator and gallery viewer.
Search one keyword. Get every matching image and video from every board, merged into one fast gallery.

Version Next.js 16 License: MIT

React 19 TypeScript Tailwind CSS v4 Self-hosted

4CHMG2 homepage

The redesigned "deep space utility" homepage โ€” live source-status panel, neon accents, and a single search box.


Note

v1.3.0. New this release: a fully redesigned homepage, top navigation, an in-browser Board Configurator, a settings panel, a relative-time scrollbar, and a dock-style lightbox thumbnail strip. K-pop-oriented by default, general-purpose by design.

๐Ÿ“– Table of contents

โœจ Why 4CHMG2

Imageboards scatter the same media across a dozen boards and archives. Finding everything on a topic means opening tab after tab, scrolling thread after thread, and re-running the same search by hand. 4CHMG2 collapses that into one query.

Principle What it means
๐Ÿ”Ž Search once, see everything One keyword fans out across 4chan, 2ch.org, Mokachan, and Desuarchive in parallel.
๐Ÿ–ผ๏ธ One unified gallery All hits merge into a single grid, sorted newest-first by post timestamp.
โšก Fast by default A self-hosted proxy with aggressive thumbnail caching keeps scrolling smooth โ€” no skeleton flashes.
๐ŸŽ›๏ธ Yours to configure Add, hide, or remove boards right in the browser โ€” no source edits required.

๐Ÿš€ What's new in 1.3.0

  • ๐Ÿ›ฐ๏ธ Redesigned homepage โ€” a "deep space utility" command-center aesthetic with a subtle grid background, neon magenta/cyan accents, and feature cards. A live source-status panel pings each upstream and shows it as OK or down at a glance.
  • ๐Ÿงญ Top navigation โ€” Explore / Boards tabs, plus About and Settings, always within reach.
  • ๐ŸŽ›๏ธ In-browser Board Configurator (/boards) โ€” add your own boards to the selection row on the supported sites (4chan, Mokachan, 2ch) by entering a board id + label. Hide or delete boards too โ€” all persisted per-browser, no code changes.
  • โš™๏ธ Settings panel โ€” user preferences such as a default search term, persisted locally.
  • โฑ๏ธ Relative-time scrollbar โ€” on search results, a custom right-edge scrollbar shows the relative post time ("3 days ago") of your current position. Drag to scrub through the timeline, or hover the right edge to reveal it.
  • ๐Ÿ” Dock-style thumbnail magnify โ€” the lightbox thumbnail strip magnifies toward the cursor with smooth proximity falloff.
  • โ„น๏ธ About modal โ€” project info and version, now auto-tracked from package.json.

๐Ÿงฐ Features

Feature checklist
  • Multi-board search โ€” query 4chan, 2ch.org, Mokachan, and Desuarchive simultaneously
  • Unified gallery grid โ€” all results merged and sorted by timestamp
  • Batch ZIP downloads โ€” select gallery results and export them as a single archive
  • Quick save โ€” hover a result and press S to download it in place
  • Full-featured lightbox โ€” keyboard nav, zoom/pan, slideshow, flip, rotate, download, hotkeys
  • OR search โ€” separate keywords with | for multi-term matching
  • Auto-refresh โ€” load in fresh media without losing your place
  • Touch-friendly โ€” drag-to-pan, pinch-to-zoom, double-tap reset
  • Fast self-hosted proxy โ€” aggressive thumbnail caching for smooth, flash-free scrolling
  • In-browser Board Configurator โ€” add / hide / delete boards, persisted per-browser
  • Relative-time scrollbar โ€” scrub a result set by post time
  • Dock-style lightbox thumbnails โ€” cursor-following magnification

๐Ÿ–ผ๏ธ Showcase

Search results gallery
Unified search gallery โ€” every board's hits in one timeline-sorted grid.
Lightbox viewer
Lightbox viewer โ€” zoom, pan, slideshow, and a magnifying thumbnail dock.
๐ŸŽ›๏ธ In-browser Board Configurator

Board Configurator
Add your own boards by id + label, hide ones you don't use, or delete them โ€” all without editing source code.

๐ŸŒ Supported boards

Source Board(s) Cloudflare Format
4chan /mu/, /trash/, /gif/ No 4chan API
2ch.org (Dvach) /kpop/ No Dvach / Vichan
Mokachan /kr/ No Meguca
Desuarchive /mu/, /trash/ No Foolfuuka
Easychan (defunct) /kr/ Yes Meguca

Tip

Users can add their own boards on the supported sites via the in-app Board Configurator โ€” no source edits needed. Adding a new built-in default is still a single entry in src/lib/boards.ts.

A note on Cloudflare

Cloudflare-bypass support (FlareSolverr) is retained in code for future Cloudflare-fronted boards, but is not deployed in production โ€” the only board that ever needed it, Easychan, is defunct. It is dormant, not a headline feature.

๐ŸŽฎ Lightbox hotkeys

Key Action
โ† / โ†’ Navigate between media
Space Toggle slideshow
F Toggle fullscreen
H Flip image horizontally
R Rotate
S Download current media
T Toggle thumbnail strip
M Mute / unmute video
Esc Close lightbox

๐Ÿš€ Quick start

Local development

Run the app directly without pm2 โ€” ideal for development or quick testing:

git clone https://github.com/kpg-anon/4chmg2.git
cd 4chmg2
cp .env.example .env
nano .env                    # set your port, etc.
npm install
npm run build
npm start

Persistent server (pm2 + gulp)

Use pm2 for process management with automatic restarts and zero-downtime reloads:

git clone https://github.com/kpg-anon/4chmg2.git
cd 4chmg2
cp .env.example .env
nano .env                    # set your domain, port, etc.
npm install
npx gulp reset               # install, build, and start under pm2

VPS deployment (Debian 12)

For a full production setup with nginx, SSL (certbot), and pm2 autostart:

sudo ./install.sh

See docs/INSTALLATION.md for the complete walkthrough.

๐Ÿง‘โ€๐Ÿ’ป Usage

After making changes to the code:

npx gulp                     # build + reload (everyday command)
Command Description
npx gulp Build and reload the server
npx gulp build Build only
npx gulp restart Reload pm2 only
npx gulp reset Full setup from scratch (install + build + start)
npx gulp logs View application logs
npx gulp status Check pm2 process status

๐Ÿ› ๏ธ Tech stack

Layer Technology
Framework Next.js 16 (App Router)
Runtime React 19
Language TypeScript
Styling Tailwind CSS v4
Process manager pm2
Build runner gulp
Reverse proxy nginx + certbot

Cloudflare-bypass (FlareSolverr) support is retained in code for future Cloudflare-fronted boards, but is dormant and not deployed in production.

๐Ÿ“ฆ Deployment

4CHMG2 is designed to be self-hosted. Instance-specific configuration (domain, ports, etc.) lives in .env, which is gitignored. For full VPS deployment details, see docs/INSTALLATION.md.

๐Ÿ—บ๏ธ Roadmap

  • Additional imageboard sources
  • Media deduplication via perceptual hash
  • Gallery sharing via URL
  • Expanded settings (grid density, accent color)

๐Ÿ“œ License

MIT


Built with Next.js, React, and Tailwind CSS.

About

๐Ÿ€Multi-imageboard media aggregator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors