This document provides comprehensive information about the Casa4 project for AI assistants like Claude Code.
Casa4 is a personal portfolio/business card website for Casa4 Ltd - a freelance IT engineering consultancy. The project is intentionally "overengineered" for learning and training purposes, showcasing modern DevOps and infrastructure practices.
- Live Site: https://casa4.co.uk/
- Type: Static website with terminal/shell theme
- Purpose: Professional portfolio showcasing IT engineering services
- Hugo (v0.95.0+) - Static site generator (extended version required for SCSS)
- Hugo Theme: Shell theme (terminal-style UI) - managed as git submodule
- CSS/SCSS: Custom styling with Molokai color scheme
- JavaScript: Custom typewriter animation for terminal effects
- Terraform (v1.0+) - Infrastructure as Code
- AWS S3 - Static site hosting (us-east-1 region)
- Cloudflare - DNS management and HTTPS enforcement
- GitHub Actions - CI/CD pipeline
- Two S3 buckets (apex domain + www subdomain)
- S3 website configuration with public read access
- www bucket redirects to main domain
- DNS CNAME records pointing to S3 endpoints
- Page rules for HTTPS redirect (301)
- Custom redirect for
/learnpath
casa4/
├── .github/workflows/
│ └── deploy-all.yml # CI/CD pipeline
├── casa4-website/ # Hugo site root
│ ├── config.toml # Hugo configuration (extensive comments)
│ ├── content/ # Markdown content
│ │ ├── description.md # Main profile/bio
│ │ ├── description2.md # Secondary description
│ │ ├── projects.md # Projects showcase
│ │ └── posts/ # Blog posts
│ ├── data/
│ │ └── themes.json # Terminal color schemes
│ ├── layouts/partials/
│ │ ├── style.html # Terminal color CSS
│ │ └── typeIndex.html # Typewriter animation
│ ├── themes/shell/ # Git submodule (Hugo theme)
│ ├── public/ # Generated static files (not in git)
│ └── resources/_gen/ # Hugo generated assets
├── main.tf # Terraform AWS/Cloudflare resources
├── providers.tf # Terraform provider configuration
├── variables.tf # Terraform input variables
├── outputs.tf # Terraform outputs
├── terraform.tfvars # Terraform variable values (not in git)
├── upload-to-s3.sh # Manual S3 upload script
└── README.md # User-facing documentation
Start Hugo development server:
cd casa4-website && hugo server -w -D- Runs on http://localhost:1313
- Auto-reloads on file changes (-w)
- Shows draft posts (-D)
Build static site locally:
cd casa4-website && hugo- Generates site to
public/directory - Use for testing before deployment
Add new blog post:
cd casa4-website
hugo new posts/my-new-post.md- Creates post with front matter template
- Edit in
content/posts/my-new-post.md - Set
draft: falseto publish
Edit existing content:
- All content in
casa4-website/content/ - Markdown format with YAML front matter
- Can use online editors like Prose.io
Terminal color scheme:
- Defined in
casa4-website/data/themes.json - Current: Molokai (dark theme)
- Other options: Shell-PowerShell, Shell-Ubuntu, Shell-Retro, Gogh themes
Animation speeds (in config.toml):
ps1Delay: Prompt typing speed (default: 1ms)stdoutDelay: Output typing speed (default: 1ms)commandDelay: Command typing speed (default: 50ms)- Set to 0 to disable animations
The Hugo theme is a git submodule:
# Clone with submodules
git clone --recursive <repo-url>
# Or initialize after clone
git submodule update --init --recursive
# Update theme to latest
cd casa4-website/themes/shell
git pull origin main
cd ../../..
git add casa4-website/themes/shell
git commit -m "Update Hugo theme"Current state: Remote backend in Terraform Cloud
- Organization:
iosifv - Workspace:
casa4
Common Terraform commands:
# Format code
terraform fmt
# Validate configuration
terraform validate
# Plan changes
terraform plan
# Apply changes (use with caution)
terraform apply
# Show current state
terraform showImportant: Infrastructure changes are typically deployed via GitHub Actions, not manually.
S3 Buckets:
- Main:
casa4.co.uk(hosts the site) - WWW:
www.casa4.co.uk(redirects to main) - Region: us-east-1
- Public read access enabled
- Website hosting enabled
Required AWS credentials:
- Stored as GitHub Secrets:
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY - Used by GitHub Actions for deployment
DNS Records:
- CNAME for apex domain → S3 endpoint
- CNAME for www → S3 endpoint
Page Rules:
- HTTPS enforcement (HTTP → HTTPS 301 redirect)
- Custom redirect for
/learnpath
Location: .github/workflows/deploy-all.yml
Trigger: Runs on every push to repository
Jobs:
-
Validation Job (terraform-validation)
- Checks Terraform formatting
- Validates Terraform configuration
- Runs before deploy
-
Build & Deploy Job (build-and-deploy)
- Checks out code with submodules
- Sets up Hugo (extended version v0.115.4)
- Builds static site with
hugocommand - Syncs
public/to S3 bucket - Uses AWS credentials from secrets
Required GitHub Secrets:
AWS_ACCESS_KEY_ID- AWS access keyAWS_SECRET_ACCESS_KEY- AWS secret keyTF_API_TOKEN- Terraform Cloud API token (if modifying Terraform)
Using the upload script:
./upload-to-s3.sh- Builds Hugo site
- Uploads to S3 bucket
- Requires AWS CLI configured locally
- Edit markdown files in
casa4-website/content/ - Test locally with
hugo server -w -D - Commit and push changes
- GitHub Actions automatically deploys
- Edit
casa4-website/data/themes.jsonto add new theme - Update
casa4-website/config.toml→[Params]→colorscheme - Test with Hugo server
- Commit and push
- Edit
casa4-website/config.toml - Key settings:
baseURL- Site URLtitle- Site title[Params]- Terminal behavior, theme, delays[[Params.tree.list]]- Navigation links
- Test locally before pushing
- Modify Terraform files (
main.tf,variables.tf, etc.) - Run
terraform fmtto format - Run
terraform validateto check - Run
terraform planto preview changes - Commit and push (validation runs in CI)
- Apply changes manually or via CI (be careful!)
Common issues:
- "Hugo not found" - Install Hugo extended version
- SCSS errors - Requires Hugo extended (not standard)
- Submodule missing - Run
git submodule update --init --recursive - Old content showing - Clear
public/andresources/_gen/, rebuild
Common issues:
- State lock - Check Terraform Cloud workspace
- Provider version - Check
.terraform.lock.hcl - AWS credentials - Ensure correct credentials in environment
- Remote state - Ensure
providers.tfhas correct cloud config
Key sections:
baseURL- Must match production domaintheme = "shell"- References theme in themes/ directory[Params]- Terminal appearance and behaviorps1Delay,stdoutDelay,commandDelay- Animation speedscolorscheme- Terminal color themedescription- Shell prompt textstartxLocation- Path shown in prompt
[[Params.tree.list]]- Navigation links (directory tree style)
Defines:
- Two S3 buckets with website configuration
- Bucket policies for public read access
- Cloudflare DNS records (CNAME)
- Cloudflare page rules (HTTPS, redirects)
Configures:
- Terraform Cloud backend (remote state)
- AWS provider (region: us-east-1)
- Cloudflare provider
- Random provider
CI/CD pipeline that:
- Validates Terraform on every push
- Builds Hugo site
- Deploys to S3 automatically
- Content changes: Edit files in
casa4-website/content/, test with Hugo server - Theme changes: Prefer editing
data/themes.jsonorconfig.tomlover theme files - Infrastructure changes: Run
terraform validatebefore committing - Always test locally before committing (use
hugo server -w -D)
- Never commit
public/directory (generated files) - Never commit
.terraform/directory - Never commit
terraform.tfvars(may contain secrets) - Do commit
.terraform.lock.hcl(dependency lock file) - Be careful with
casa4-website/themes/shell/(it's a submodule)
- Start with:
README.mdandconfig.tomlfor user-facing docs - For content: Check
casa4-website/content/directory - For infrastructure: Review
main.tfandvariables.tf - For deployment: Check
.github/workflows/deploy-all.yml
- Use clear, descriptive commit messages
- Test Hugo build locally before committing
- Remember: every push triggers deployment
- Follow branch naming convention:
claude/<branch-name>-<session-id>
- Never expose AWS credentials or Terraform tokens
- Check that no secrets are in code before committing
- Verify S3 bucket policies don't over-expose data
- Test Cloudflare page rules to ensure HTTPS enforcement
From project README:
- Separate staging and production environments
- Move S3 bucket to eu-west-2 (currently us-east-1)
- Add Google Analytics integration
- Add favicon
- Implement second description section
- Add additional contact methods (phone/WhatsApp/email)
- Separate GitHub Actions workflows for different branches
The site uses a unique terminal/shell aesthetic:
- Prompt simulation:
iosif@laptop:~/casa4_files$ - Typewriter animation: Text types out like terminal output
- Directory tree navigation: Links displayed as file tree
- Molokai color scheme: Dark theme with syntax highlighting colors
- Command-style interaction: Navigation feels like shell commands
- Hugo Documentation: https://gohugo.io/documentation/
- Hugo Shell Theme: https://github.com/Yukuro/hugo-theme-shell
- Terraform AWS Provider: https://registry.terraform.io/providers/hashicorp/aws/latest/docs
- Terraform Cloudflare Provider: https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs
# Local development
cd casa4-website && hugo server -w -D
# Build site
cd casa4-website && hugo
# Create new post
cd casa4-website && hugo new posts/my-post.md
# Update git submodules
git submodule update --init --recursive
# Terraform validation
terraform fmt && terraform validate
# Manual deploy (if needed)
./upload-to-s3.shThis is a personal project for Casa4 Ltd. For questions about the project structure or implementation, refer to the README.md or examine the code directly.
Last Updated: 2025-11-18 Project Status: Production (live at casa4.co.uk) Maintained By: Iosif