Files

5.9 KiB

Quick Start Guide

Get started with Akiyama Manga in minutes!

Prerequisites

  • Go 1.21+
  • PostgreSQL 12+
  • Docker & Docker Compose (optional)
  • AWS S3 account (or compatible S3 service)

Option 1: Local Development (Quick)

1. Clone and Setup

cd d:\Projects\akiyama-manga

# Copy environment file
copy .env.example .env

# Edit .env with your details
notepad .env

2. Configure Database

Windows with PostgreSQL:

psql -U postgres

# In psql:
CREATE DATABASE akiyama_manga;
CREATE USER manga_user WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE akiyama_manga TO manga_user;
\q

Or use Docker:

docker run -d `
  --name postgres `
  -e POSTGRES_DB=akiyama_manga `
  -e POSTGRES_USER=manga_user `
  -e POSTGRES_PASSWORD=your_password `
  -p 5432:5432 `
  postgres:15-alpine

3. Configure S3

  1. Go to S3_SETUP.md for detailed instructions
  2. Create AWS S3 bucket
  3. Add credentials to .env:
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
S3_BUCKET_NAME=your_bucket_name

4. Install Dependencies and Run

go mod download
go run cmd/server/main.go

Application is now running at http://localhost:8080

Option 2: Docker (Easiest)

# Create environment file
copy .env.example .env

# Start everything
docker-compose up

# View logs
docker-compose logs -f app

Access:

Option 3: Production Deployment

See DEPLOYMENT.md for detailed deployment instructions.

Project Structure Overview

akiyama-manga/
├── cmd/
│   └── server/          # Main application
├── internal/
│   ├── auth/           # JWT authentication
│   ├── database/       # Database initialization
│   ├── handlers/       # HTTP handlers
│   ├── middleware/     # HTTP middleware
│   ├── models/         # Data models
│   ├── services/       # Business logic
│   └── storage/        # S3 integration
├── web/
│   └── frontend/
│       ├── static/     # CSS, JavaScript, images
│       └── templates/  # HTML templates
├── migrations/         # Database migrations
├── .env.example        # Example environment file
├── docker-compose.yml  # Docker setup
├── Dockerfile          # Container image
├── go.mod/go.sum       # Dependencies
├── Makefile            # Build automation
├── README.md           # Main documentation
├── API.md              # API documentation
├── DATABASE_SETUP.md   # Database setup guide
├── S3_SETUP.md         # S3 configuration guide
└── DEPLOYMENT.md       # Deployment guide

Key Features

Dark Theme UI - Modern design similar to yorai.io User Authentication - JWT-based auth system Manga Management - Create, read, update, delete mangas S3 Integration - Upload to AWS S3 or compatible services User Library - Users can save their favorite mangas Review System - Rate and review mangas Search & Filter - Find mangas easily Responsive Design - Works on all devices

Useful Commands

# Development with hot reload
make dev

# Build for production
make build

# Run tests
make test

# Database migrations (auto-run on startup)
go run cmd/server/main.go

# View API docs
# See API.md

# Docker operations
docker-compose up -d      # Start
docker-compose down       # Stop
docker-compose logs -f    # View logs

Configuration

All configuration is done through environment variables in .env:

# 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_key
AWS_SECRET_ACCESS_KEY=your_secret
AWS_REGION=us-east-1
S3_BUCKET_NAME=your_bucket
S3_ENDPOINT=https://s3.amazonaws.com

# Server
PORT=8080
GIN_MODE=debug
JWT_SECRET=your_jwt_secret

Development

API Endpoints

See API.md for complete API documentation.

Quick examples:

# Get all mangas
curl http://localhost:8080/api/mangas

# Search
curl "http://localhost:8080/api/search?q=action"

# Sign up
curl -X POST http://localhost:8080/api/auth/signup \
  -H "Content-Type: application/json" \
  -d '{"username":"user","email":"user@example.com","password":"pass"}'

Frontend

  • Modern dark theme inspired by yorai.io
  • Responsive grid layout
  • Search and filter capabilities
  • User authentication
  • Manga library management

Database Models

  • User - User accounts and profiles
  • Manga - Manga metadata
  • Chapter - Chapters with page count
  • Page - Individual pages stored in S3
  • Review - User ratings and comments
  • Tag - Genre/category tags

Troubleshooting

Port 8080 already in use

# Change port in .env
PORT=8081

Database connection error

# Verify database is running
psql -U manga_user -d akiyama_manga -h localhost

# Check credentials in .env

S3 upload fails

# Verify credentials
# Check bucket exists and region is correct
# See S3_SETUP.md for detailed troubleshooting

Application won't start

# Check logs
docker-compose logs app

# Or for local:
go run cmd/server/main.go  # See error output

Next Steps

  1. Read the README.md for detailed project information
  2. Check API.md for complete API documentation
  3. Review DATABASE_SETUP.md for database configuration
  4. See S3_SETUP.md for S3 storage setup
  5. Follow DEPLOYMENT.md to deploy to production

Support

  • Check relevant documentation files
  • Review error messages in logs
  • Verify environment variables are set correctly
  • Ensure database and S3 are properly configured

License

MIT License - see LICENSE file for details