# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Quick Reference
**Project:** Cozy Den - Personal landing page for hiddenden.cafe
**Owner:** Latte (gay furry developer, values self-hosting and privacy)
**Tech Stack:** Astro 4.x (hybrid SSR), TypeScript, Vanilla CSS, SQLite, Docker + Node.js
**Aesthetic:** Warm coffee/cappuccino theme, cozy hidden den vibes
**Deployment:** Docker containers pushed to Gitea registry at git.hiddenden.cafe
## Core Design Principles
1. **Cozy Aesthetic** - Warm colors, coffee/cappuccino theme, hidden den vibes
2. **Self-Hosted** - Everything runs on personal infrastructure (homelab/VPS)
3. **Privacy First** - No tracking, no external dependencies
4. **Lightweight** - Static HTML/CSS, minimal JavaScript
5. **Docker-Ready** - Easy deployment via containers
## File Structure
```
cozy-den/
├── src/
│ ├── layouts/
│ │ └── BaseLayout.astro # Base layout + global styles
│ └── pages/
│ ├── index.astro # Main landing page
│ └── 404.astro # Custom 404 page
├── public/
│ ├── favicon.svg # Coffee emoji favicon
│ └── robots.txt # Search engine directives
├── astro.config.mjs # Astro config with sitemap
├── package.json # Dependencies (Astro 4.x, @astrojs/sitemap)
├── Dockerfile # Multi-stage: Node builder + Nginx
├── docker-compose.yml # Local container orchestration
└── nginx.conf # Production web server config
```
## Architecture Notes
Astro **hybrid SSR** site — most pages are statically pre-rendered, but guestbook and admin pages are server-rendered:
- Layouts in `src/layouts/` for reusable page templates
- Pages in `src/pages/` (routes automatically based on filename)
- Server-side lib code in `src/lib/` (db, auth, guestbook, spam)
- API routes in `src/pages/api/` for form handling and admin actions
- CSS custom properties centralized in `BaseLayout.astro` for theming
- `output: 'hybrid'` + `@astrojs/node` adapter — Node.js standalone server in production
- SQLite database (better-sqlite3) for guestbook entries and admin sessions
- Docker runtime is now Node.js (not Nginx); see `docs/guestbook.md` for setup
**Guestbook:** See `docs/guestbook.md` for full setup, token login, and deployment notes.
## Commands
```bash
# Development
npm install # Install dependencies
npm run dev # Start dev server at http://localhost:4321
npm run build # Build for production (runs astro check + astro build)
npm run preview # Preview production build
# Docker
docker build -t cozy-den .
docker run -d -p 3000:80 --name cozy-den cozy-den
docker-compose up -d
# Deployment to Gitea registry
docker tag cozy-den git.hiddenden.cafe/mats/cozy-den:latest
docker login git.hiddenden.cafe
docker push git.hiddenden.cafe/mats/cozy-den:latest
```
## Color System
All colors use CSS custom properties in `BaseLayout.astro`:
```css
--color-bg: #1a1410 /* Dark background (deep coffee) */
--color-bg-light: #2a1f18 /* Lighter background for cards */
--color-text: #f4e9d8 /* Cream text */
--color-text-dim: #c4b5a0 /* Dimmed text */
--color-accent: #d4a574 /* Warm accent (coffee with cream) */
--color-accent-bright: #e8bf8e /* Brighter accent for highlights */
--color-warm: #8b6f47 /* Warm brown for borders/accents */
```
**To change theme:** Edit these variables. All components update automatically.
## Common Modification Patterns
### Adding a Section
```astro
ContentSection Title
Description of the service