4.3 KiB
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
-
Clone the repository
git clone <repository-url> cd akiyama-manga -
Install Go dependencies
go mod download -
Setup environment variables
cp .env.example .envEdit
.envwith your configuration:- Database credentials
- AWS S3 credentials
- Server port
- JWT secret
-
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 pageGET /api/mangas- Get all mangasGET /api/mangas/:id- Get manga detailsGET /api/mangas/:id/chapters/:chapterNum/pages- Get chapter pagesGET /api/search?q=query- Search mangas
Authentication Routes
POST /api/auth/signup- User registrationPOST /api/auth/signin- User login
Protected Routes (Requires JWT Token)
GET /api/library- Get user's manga libraryPOST /api/library/:id- Add manga to libraryDELETE /api/library/:id- Remove manga from libraryPOST /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
- Create an S3 bucket in AWS Console
- Create IAM user with S3 permissions
- Generate access keys
- 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
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
MIT License - see LICENSE file for details
Support
For issues and questions, please open an GitHub issue.