tokuhirom の個人的なブログサービスです。
# Install Docker and Docker Compose
# Then run the entire stack
docker-compose up
# The services are available at:
# - Admin Interface: http://localhost:8181/admin/entries/search
# - Backend API: http://localhost:8181
# - MariaDB: localhost:3306
# - LocalStack (S3): http://localhost:4566- Docker and Docker Compose
# Start all services with Docker Compose
docker-compose up
# Start in background
docker-compose up -d
# Stop all services
docker-compose down
# View logs
docker-compose logs -f [service-name]
# Build production Docker image
make docker-build
# Access MariaDB console
make db # as blog4user
make db-root # as rootWhen running with Docker Compose, the following ports are exposed:
| Service | Port | Description |
|---|---|---|
| Backend | 8181 | Go API server with admin interface |
| MariaDB | 3306 | Database |
| LocalStack | 4566 | S3-compatible storage (LocalStack) |
blog4/
├── cmd/
│ └── blog4/ # Main application entry point
├── db/ # Database schemas and queries
│ ├── admin/ # Admin database (write operations)
│ └── public/ # Public database (read operations)
├── internal/
│ ├── admin/ # Admin handlers and routes (Preact-based)
│ ├── public/ # Public handlers
│ └── middleware/ # HTTP middleware
├── admin/
│ ├── templates/ # HTML templates for admin interface
│ └── static/ # Static assets (CSS, JS, icons)
├── markdown/ # Markdown processing
└── scripts/ # Build and utility scripts
For detailed development instructions, see CLAUDE.md.
Key points:
- Database queries: Add SQL to
/db/*/queries/, then runmake sqlc-adminormake sqlc-public - Admin interface: HTML templates in
/admin/templates/with Preact apps - Static assets: CSS, JavaScript, icons in
/admin/static/ - Handlers: Go handlers in
/internal/admin/and/internal/public/ - PWA: Manifest and Service Worker for Web Share Target support
This project uses goimports for consistent Go code formatting:
# Format Go files
goimports -w .
# Install pre-commit hooks (optional)
pre-commit installImport ordering follows goimports style:
- Standard library imports
- Third-party imports
- Local imports (github.com/tokuhirom/blog4)
This project uses Biome for JavaScript linting and formatting:
# Check JavaScript files
make biome-check
# Fix JavaScript files
make biome-fix# Run all tests
go test ./...
# Run specific test
go test -run TestFunctionName ./path/to/package
# Run with race detector
go test -race ./...- Create a feature branch
- Make your changes
- Run tests and linters
- Create a pull request
For AI-assisted development with Claude Code, refer to CLAUDE.md for specific workflow instructions.
The application is deployed on Sakura Cloud App Run using Docker. See Dockerfile for the build configuration.
This project is licensed under the MIT License - see the LICENSE file for details.