Files

4.3 KiB

Akiyama Manga

A modern manga hosting and reading platform written in Go with S3 integration for manga storage.

Features

  • 📚 Browse and search manga titles
  • 👤 User authentication with JWT
  • 📖 Chapter reading interface
  • Rating and review system
  • 📚 Personal manga library
  • ☁️ S3 integration for manga storage
  • 🎨 Dark mode UI similar to yorai.io

Project Structure

akiyama-manga/
├── cmd/
│   └── server/           # Main application entry point
├── internal/
│   ├── models/          # Database models
│   ├── handlers/        # HTTP request handlers
│   ├── services/        # Business logic
│   ├── storage/         # S3 integration
│   ├── database/        # Database initialization
│   ├── middleware/      # HTTP middleware
│   └── auth/           # Authentication logic
├── web/
│   └── frontend/        # HTML, CSS, JS files
│       ├── templates/   # HTML templates
│       └── static/      # CSS, JS, images
├── migrations/          # Database migrations
├── go.mod
├── go.sum
└── .env.example         # Environment variables template

Prerequisites

  • Go 1.21 or higher
  • PostgreSQL database
  • AWS S3 bucket (or compatible S3 service)
  • Node.js (optional, for frontend development)

Installation

  1. Clone the repository

    git clone <repository-url>
    cd akiyama-manga
    
  2. Install Go dependencies

    go mod download
    
  3. Setup environment variables

    cp .env.example .env
    

    Edit .env with your configuration:

    • Database credentials
    • AWS S3 credentials
    • Server port
    • JWT secret
  4. Initialize the database

    # The application will auto-migrate tables on startup
    

Running the Application

go run cmd/server/main.go

The application will start on the configured port (default: 8080).

API Endpoints

Public Routes

  • GET / - Home page
  • GET /api/mangas - Get all mangas
  • GET /api/mangas/:id - Get manga details
  • GET /api/mangas/:id/chapters/:chapterNum/pages - Get chapter pages
  • GET /api/search?q=query - Search mangas

Authentication Routes

  • POST /api/auth/signup - User registration
  • POST /api/auth/signin - User login

Protected Routes (Requires JWT Token)

  • GET /api/library - Get user's manga library
  • POST /api/library/:id - Add manga to library
  • DELETE /api/library/:id - Remove manga from library
  • POST /api/upload/manga - Upload new manga (admin only)
  • POST /api/upload/chapter/:id - Upload chapter to S3 (admin only)

Environment Variables

# Database
DB_HOST=localhost
DB_PORT=5432
DB_USER=manga_user
DB_PASSWORD=your_password
DB_NAME=akiyama_manga

# AWS S3
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_REGION=us-east-1
S3_BUCKET_NAME=your_bucket_name
S3_ENDPOINT=https://s3.amazonaws.com

# Server
PORT=8080
GIN_MODE=debug
JWT_SECRET=your_jwt_secret_key

# Upload
MAX_FILE_SIZE=524288000
ALLOWED_FORMATS=jpeg,jpg,png,gif,webp

S3 Configuration

AWS S3

  1. Create an S3 bucket in AWS Console
  2. Create IAM user with S3 permissions
  3. Generate access keys
  4. Add credentials to .env

Custom S3 (MinIO, DigitalOcean Spaces, etc.)

Update S3_ENDPOINT in .env:

S3_ENDPOINT=https://your-custom-endpoint.com

Database Models

  • User - User accounts with authentication
  • Manga - Manga metadata (title, author, description, etc.)
  • Chapter - Chapters within a manga
  • Page - Individual pages stored in S3
  • Review - User reviews and ratings
  • Tag - Genre/category tags

Design Features

The UI is inspired by yorai.io with:

  • Dark theme with accent colors
  • Responsive grid layout
  • Search functionality
  • Manga card previews
  • Navigation bar with branding
  • Featured and recently updated sections
  • Rating system
  • User authentication flows

Building for Production

# Build the application
go build -o akiyama-manga cmd/server/main.go

# Run the binary
./akiyama-manga

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT License - see LICENSE file for details

Support

For issues and questions, please open an GitHub issue.