Full-stack Next.js 15 web application for creating mycro-zines: Features: - Text or voice input for concept description - Style/tone selection (punk-zine, minimal, collage, etc.) - AI-powered outline generation via Gemini - 8-page image generation with refinement loop - Print-ready PNG download (300 DPI) - Shareable zine URLs (/z/[id]) Tech stack: - Next.js 15 with App Router - Tailwind CSS v4 + Radix UI - Gemini API for text and image generation - Sharp for print layout assembly - Docker + Traefik for deployment 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| backlog | ||
| examples | ||
| src | ||
| web | ||
| .gitignore | ||
| Dockerfile | ||
| README.md | ||
| docker-compose.yml | ||
| package-lock.json | ||
| package.json | ||
README.md
MycroZine
A toolkit for creating print-ready mycro-zines - 8-page mini folded zines that fit on a single 8.5" x 11" sheet.
What is a MycroZine?
A mycro-zine is a tiny, foldable magazine made from a single sheet of paper. When folded correctly, it creates an 8-page booklet perfect for:
- Punk zines and manifestos
- Educational mini-guides
- Event programs
- DIY instructions
- Art projects
Features
- Single-page print layout: All 8 pages arranged on one 8.5" x 11" sheet (2 cols x 4 rows)
- High-resolution output: 300 DPI for crisp printing
- Prompt templates: Ready-to-use prompts for AI content/image generation
- Multiple styles: punk-zine, minimal, collage, retro, academic
- US Letter & A4 support: Works with common paper sizes
Installation
npm install
Usage
CLI - Create Print Layout
# Using example pages
npm run example
# Or specify your own 8 pages
node src/layout.mjs page1.png page2.png page3.png page4.png page5.png page6.png page7.png page8.png
# With custom output path
node src/layout.mjs page1.png ... page8.png --output my_zine_print.png
Programmatic API
import { createPrintLayout } from 'mycro-zine';
// Create print-ready layout from 8 page images
await createPrintLayout({
pages: [
'page1.png', 'page2.png', 'page3.png', 'page4.png',
'page5.png', 'page6.png', 'page7.png', 'page8.png'
],
outputPath: 'my_zine_print.png',
background: '#ffffff'
});
Prompt Templates (for AI generation)
import { getContentOutlinePrompt, getImagePrompt, STYLES, TONES } from 'mycro-zine/prompts';
// Generate content outline prompt
const outlinePrompt = getContentOutlinePrompt({
topic: 'The Undernet',
style: 'punk-zine',
tone: 'rebellious',
sourceContent: 'Reference text here...'
});
// Generate image prompt for a page
const imagePrompt = getImagePrompt({
pageNumber: 1,
zineTopic: 'The Undernet',
pageOutline: {
title: 'THE UNDERNET',
keyPoints: ['Own your data', 'Run local servers'],
hashtags: ['#DataSovereignty', '#Mycopunk'],
imagePrompt: 'Bold cover with mycelial network imagery...'
},
style: 'punk-zine'
});
Print Layout
The output is a single PNG image arranged for traditional mini-zine folding:
┌──────────┬──────────┬──────────┬──────────┐
│ 1↺ │ 8↺ │ 7↺ │ 6↺ │ Top row (upside down)
│ (cover) │ (cta) │ │ │
├──────────┼──────────┼──────────┼──────────┤
│ 2 │ 3 │ 4 │ 5 │ Bottom row (right side up)
│ │ │ │ │
└──────────┴──────────┴──────────┴──────────┘
Paper: 11" x 8.5" landscape (US Letter rotated)
Panel size: 7cm x 10.8cm (~2.76" x 4.25")
Total: 3300 x 2550 pixels at 300 DPI
Folding Instructions
After printing, fold your zine:
- Fold in half along the long edge (hotdog fold) - brings top row to bottom
- Fold in half again along the short edge
- Fold once more to create a small booklet shape
- Unfold completely and lay flat
- Cut the center slit - cut along the middle crease between pages 3-6 and 4-5
- Refold and push - fold hotdog style, then push the ends together so the cut opens into a booklet
- Flatten - pages should now be in order 1→2→3→4→5→6→7→8
Examples
See the examples/undernet/ directory for a complete 8-page zine about The Undernet project.
Styles
| Style | Description |
|---|---|
punk-zine |
Xerox texture, high contrast B&W, DIY collage, hand-drawn typography |
minimal |
Clean lines, white space, modern sans-serif, subtle gradients |
collage |
Layered imagery, mixed media textures, vintage photographs |
retro |
1970s aesthetic, earth tones, groovy typography, halftone patterns |
academic |
Diagram-heavy, annotated illustrations, infographic elements |
Web App
MycroZine includes a full web application at zine.jeffemmett.com that allows anyone to create zines through a browser interface.
Features
- Text or voice input - Describe your zine concept naturally
- AI-powered generation - Gemini generates outlines and page images
- Interactive refinement - Adjust any page with feedback
- Shareable links - Share your zine with a unique URL
- Print-ready download - 300 DPI PNG for home printing
Local Development
# Install web dependencies
npm run web:install
# Create .env.local in web/ directory
cp web/.env.example web/.env.local
# Edit web/.env.local and add your GEMINI_API_KEY
# Start development server
npm run web:dev
Visit http://localhost:3000 to use the app locally.
Docker Deployment
# Build and start the container
GEMINI_API_KEY=your-key docker compose up -d --build
# View logs
docker compose logs -f
# Stop
docker compose down
The docker-compose.yml includes Traefik labels for automatic HTTPS routing.
Deployment to Netcup
- Push to Gitea:
git push origin main - SSH to Netcup:
ssh netcup - Pull and deploy:
cd /opt/websites/mycro-zine git pull export GEMINI_API_KEY=$(cat ~/.gemini_credentials) docker compose up -d --build - Add to Cloudflare tunnel if not already configured
Integration with Gemini MCP
This library is designed to work with the Gemini MCP Server for AI-powered content and image generation:
- Use
getContentOutlinePrompt()withgemini_generatefor zine planning - Use
getImagePrompt()withgemini_generate_imagefor page creation - Use
createPrintLayout()to assemble the final print-ready file
License
MIT