This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a personal blog deployment repository with three main components:
- Static Blog (
blog-static/) - Hugo-powered static site using the hugo-coder theme - Backend (
backend/) - Rust web server providing like functionality for blog posts - Infrastructure - NixOS-based deployment using OpenTofu for provisioning
The project uses Nix flakes for reproducible builds and development environments, with the root flake orchestrating all components.
nix develop- Enter development shell with all required dependenciesnix build- Build all componentsnix fmt- Format Nix filesnix flake check- Run all checks including backend tests and integration tests
hugo server- Start development server (run from blog-static/ directory)hugo- Build static site
cargo build- Build the backendcargo test- Run backend testscargo run- Run the backend serversqlx migrate run- Apply database migrations
tofu init- Initialize OpenTofutofu plan- Plan infrastructure changestofu apply- Apply infrastructure changesnixos-rebuild switch --target-host root@hetzner-blog --flake .#blog- Deploy NixOS configuration
- Root flake coordinates three sub-flakes: backend, blog-static, and infrastructure
- Integration tests run in KVM using NixOS test framework
- Development shell includes Hugo, OpenTofu, SQLx CLI, and Python tools
- Web server built with Axum web framework
- PostgreSQL database with SQLx for persistence
- Provides REST API endpoints for blog post like functionality
- Includes rate limiting and observability features
- Hugo static site generator with hugo-coder theme
- Content in Markdown format under
content/posts/ - Custom CSS and layouts for personalization
- Plausible analytics integration
- PostgreSQL database with migrations in
backend/migrations/ - Environment variables:
DATABASE_URL=postgresql://blog:blog@localhost:5432/blog
- NixOS configuration for production deployment
- Disko for disk partitioning
- OpenTofu for cloud infrastructure provisioning on Hetzner
- SSH access via
ssh root@hetzner-blog