From 9e02eefbe072b6908506fc1fe72085276a3ec816 Mon Sep 17 00:00:00 2001 From: latte Date: Tue, 23 Dec 2025 11:36:55 +0100 Subject: [PATCH] Init Astro site with Docker and AI workflows - Add landing page and base layout with cozy theme - Configure Astro, TypeScript, and project settings - Add Dockerfile, Nginx config, and docker-compose - Include favicon and site metadata - Add documentation: README, DEVELOPMENT, PROJECT_CONTEXT, TODO, CLAUDE - Add Gitea workflows for AI chat, PR review, issue triage, and codebase review --- .gitea/workflows/ai-chat.yml | 42 ++++ .gitea/workflows/ai-codebase-review.yml | 58 +++++ .gitea/workflows/ai-comment-reply.yml | 41 +++ .gitea/workflows/ai-issue-triage.yml | 36 +++ .gitea/workflows/enterprise-ai-review.yml | 53 ++++ BaseLayout.astro | 93 +++++++ CLAUDE.MD | 236 +++++++++++++++++ DEVELOPMENT.md | 292 +++++++++++++++++++++ Dockerfile | 28 +++ PROJECT_CONTEXT.md | 123 +++++++++ README.md | 107 +++++++- TODO.md | 121 +++++++++ astro.config.mjs | 6 + docker-compose.yml | 11 + favicon.svg | 4 + index.astro | 294 ++++++++++++++++++++++ nginx.conf | 31 +++ package.json | 15 ++ tsconfig.json | 3 + 19 files changed, 1593 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/ai-chat.yml create mode 100644 .gitea/workflows/ai-codebase-review.yml create mode 100644 .gitea/workflows/ai-comment-reply.yml create mode 100644 .gitea/workflows/ai-issue-triage.yml create mode 100644 .gitea/workflows/enterprise-ai-review.yml create mode 100644 BaseLayout.astro create mode 100644 CLAUDE.MD create mode 100644 DEVELOPMENT.md create mode 100644 Dockerfile create mode 100644 PROJECT_CONTEXT.md create mode 100644 TODO.md create mode 100644 astro.config.mjs create mode 100644 docker-compose.yml create mode 100644 favicon.svg create mode 100644 index.astro create mode 100644 nginx.conf create mode 100644 package.json create mode 100644 tsconfig.json diff --git a/.gitea/workflows/ai-chat.yml b/.gitea/workflows/ai-chat.yml new file mode 100644 index 0000000..b23191f --- /dev/null +++ b/.gitea/workflows/ai-chat.yml @@ -0,0 +1,42 @@ +name: AI Chat (Bartender) + +on: + issue_comment: + types: [created] + +# CUSTOMIZE YOUR BOT NAME: +# Change '@ai-bot' below to match your config.yml mention_prefix +# Examples: '@bartender', '@uni', '@joey', '@codebot' + +jobs: + ai-chat: + # Only run if comment mentions the bot + if: contains(github.event.comment.body, '@codebot') # <-- Change this to your bot name + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/checkout@v4 + with: + repository: Hiddenden/openrabbit + path: .ai-review + token: ${{ secrets.AI_REVIEW_TOKEN }} + + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - run: pip install requests pyyaml + + - name: Run AI Chat + env: + AI_REVIEW_TOKEN: ${{ secrets.AI_REVIEW_TOKEN }} + AI_REVIEW_REPO: ${{ gitea.repository }} + AI_REVIEW_API_URL: https://git.hiddenden.cafe/api/v1 + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} + OLLAMA_HOST: ${{ secrets.OLLAMA_HOST }} + SEARXNG_URL: ${{ secrets.SEARXNG_URL }} + run: | + cd .ai-review/tools/ai-review + python main.py comment ${{ gitea.repository }} ${{ gitea.event.issue.number }} "${{ gitea.event.comment.body }}" diff --git a/.gitea/workflows/ai-codebase-review.yml b/.gitea/workflows/ai-codebase-review.yml new file mode 100644 index 0000000..32ab58f --- /dev/null +++ b/.gitea/workflows/ai-codebase-review.yml @@ -0,0 +1,58 @@ +name: AI Codebase Quality Review + +on: + # Weekly scheduled run + schedule: + - cron: "0 0 * * 0" # Every Sunday at midnight + + # Manual trigger + workflow_dispatch: + inputs: + report_type: + description: "Type of report to generate" + required: false + default: "full" + type: choice + options: + - full + - security + - quick + +jobs: + ai-codebase-review: + runs-on: ubuntu-latest + + steps: + # Checkout the repository + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Full history for analysis + + # Checkout central AI tooling + - uses: actions/checkout@v4 + with: + repository: Hiddenden/openrabbit + path: .ai-review + token: ${{ secrets.AI_REVIEW_TOKEN }} + + # Setup Python + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + + # Install dependencies + - run: pip install requests pyyaml + + # Run AI codebase analysis + - name: Run AI Codebase Analysis + env: + AI_REVIEW_TOKEN: ${{ secrets.AI_REVIEW_TOKEN }} + AI_REVIEW_REPO: ${{ gitea.repository }} + AI_REVIEW_API_URL: https://git.hiddenden.cafe/api/v1 + + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} + OLLAMA_HOST: ${{ secrets.OLLAMA_HOST }} + run: | + cd .ai-review/tools/ai-review + python main.py codebase ${{ gitea.repository }} diff --git a/.gitea/workflows/ai-comment-reply.yml b/.gitea/workflows/ai-comment-reply.yml new file mode 100644 index 0000000..edfa31d --- /dev/null +++ b/.gitea/workflows/ai-comment-reply.yml @@ -0,0 +1,41 @@ +name: AI Comment Reply + +on: + issue_comment: + types: [created] + +# CUSTOMIZE YOUR BOT NAME: +# Change '@ai-bot' below to match your config.yml mention_prefix +# Examples: '@bartender', '@uni', '@joey', '@codebot' + +jobs: + ai-reply: + runs-on: ubuntu-latest + if: contains(github.event.comment.body, '@codebot') # <-- Change this to your bot name + steps: + - uses: actions/checkout@v4 + + - uses: actions/checkout@v4 + with: + repository: Hiddenden/openrabbit + path: .ai-review + token: ${{ secrets.AI_REVIEW_TOKEN }} + + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - run: pip install requests pyyaml + + - name: Run AI Comment Response + env: + AI_REVIEW_TOKEN: ${{ secrets.AI_REVIEW_TOKEN }} + AI_REVIEW_REPO: ${{ gitea.repository }} + AI_REVIEW_API_URL: https://git.hiddenden.cafe/api/v1 + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} + OLLAMA_HOST: ${{ secrets.OLLAMA_HOST }} + run: | + cd .ai-review/tools/ai-review + python main.py comment ${{ gitea.repository }} ${{ gitea.event.issue.number }} \ + "${{ gitea.event.comment.body }}" diff --git a/.gitea/workflows/ai-issue-triage.yml b/.gitea/workflows/ai-issue-triage.yml new file mode 100644 index 0000000..1cb54b3 --- /dev/null +++ b/.gitea/workflows/ai-issue-triage.yml @@ -0,0 +1,36 @@ +name: AI Issue Triage + +on: + issues: + types: [opened, labeled] + +jobs: + ai-triage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/checkout@v4 + with: + repository: Hiddenden/openrabbit + path: .ai-review + token: ${{ secrets.AI_REVIEW_TOKEN }} + + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - run: pip install requests pyyaml + + - name: Run AI Issue Triage + env: + AI_REVIEW_TOKEN: ${{ secrets.AI_REVIEW_TOKEN }} + AI_REVIEW_REPO: ${{ gitea.repository }} + AI_REVIEW_API_URL: https://git.hiddenden.cafe/api/v1 + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} + OLLAMA_HOST: ${{ secrets.OLLAMA_HOST }} + run: | + cd .ai-review/tools/ai-review + python main.py issue ${{ gitea.repository }} ${{ gitea.event.issue.number }} \ + --title "${{ gitea.event.issue.title }}" diff --git a/.gitea/workflows/enterprise-ai-review.yml b/.gitea/workflows/enterprise-ai-review.yml new file mode 100644 index 0000000..7b224ff --- /dev/null +++ b/.gitea/workflows/enterprise-ai-review.yml @@ -0,0 +1,53 @@ +name: Enterprise AI Code Review + +on: + pull_request: + types: [opened, synchronize] + +jobs: + ai-review: + runs-on: ubuntu-latest + + steps: + # Checkout the PR repository + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # Checkout the CENTRAL AI tooling repo + - uses: actions/checkout@v4 + with: + repository: Hiddenden/openrabbit + path: .ai-review + token: ${{ secrets.AI_REVIEW_TOKEN }} + + # Setup Python + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + + # Install dependencies + - run: pip install requests pyyaml + + # Run the AI review + - name: Run Enterprise AI Review + env: + AI_REVIEW_TOKEN: ${{ secrets.AI_REVIEW_TOKEN }} + AI_REVIEW_REPO: ${{ gitea.repository }} + AI_REVIEW_API_URL: https://git.hiddenden.cafe/api/v1 + AI_REVIEW_PR_NUMBER: ${{ gitea.event.pull_request.number }} + + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} + OLLAMA_HOST: ${{ secrets.OLLAMA_HOST }} + run: | + cd .ai-review/tools/ai-review + python main.py pr ${{ gitea.repository }} ${{ gitea.event.pull_request.number }} \ + --title "${{ gitea.event.pull_request.title }}" + + # Fail CI on HIGH severity (optional) + - name: Check Review Result + if: failure() + run: | + echo "AI Review found HIGH severity issues. Please address them before merging." + exit 1 diff --git a/BaseLayout.astro b/BaseLayout.astro new file mode 100644 index 0000000..eafde98 --- /dev/null +++ b/BaseLayout.astro @@ -0,0 +1,93 @@ +--- +interface Props { + title: string; +} + +const { title } = Astro.props; +--- + + + + + + + + + + {title} + + + + + + + diff --git a/CLAUDE.MD b/CLAUDE.MD new file mode 100644 index 0000000..49e4de0 --- /dev/null +++ b/CLAUDE.MD @@ -0,0 +1,236 @@ +# CLAUDE.MD - AI Assistant Guide + +This file provides guidance for Claude Code and other AI assistants when working with the Cozy Den project. + +## Project Quick Reference + +**Project:** Cozy Den - Personal landing page for hiddenden.cafe +**Owner:** Mats (gay furry developer, values self-hosting and privacy) +**Tech Stack:** Astro 4.x, TypeScript, Vanilla CSS, Docker + Nginx +**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 + +``` +src/ +├── layouts/ +│ └── BaseLayout.astro # Base HTML layout + global styles + CSS variables +├── pages/ +│ └── index.astro # Main landing page (all sections here) +└── components/ # Empty - ready for future components +public/ +└── favicon.svg # Coffee emoji favicon +``` + +**Key Files:** +- `src/layouts/BaseLayout.astro` - CSS variables, global styles, base HTML structure +- `src/pages/index.astro` - All page content and section-specific styles +- `astro.config.mjs` - Astro configuration +- `Dockerfile` - Multi-stage build (Node builder + Nginx server) +- `docker-compose.yml` - Local Docker Compose setup +- `nginx.conf` - Production Nginx configuration + +## Color System + +All colors use CSS custom properties in `src/layouts/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 +
+
+
+

Section Title

+

Content

+
+
+
+``` + +### Adding a Service +```astro +
+

🔧 Service Name

+

Description of the service

+
+``` + +### Adding a New Page +Create `src/pages/newpage.astro`: +```astro +--- +import BaseLayout from '../layouts/BaseLayout.astro'; +--- + + +
+

New Page

+
+
+``` + +## Development Workflow + +```bash +npm install # Install dependencies +npm run dev # Start dev server (http://localhost:4321) +npm run build # Build for production (output to dist/) +npm run preview # Preview production build +``` + +## Docker Workflow + +```bash +# Build image +docker build -t cozy-den . + +# Run locally +docker run -d -p 3000:80 --name cozy-den cozy-den + +# Or use Docker Compose +docker-compose up -d + +# Tag for Gitea registry +docker tag cozy-den git.hiddenden.cafe/mats/cozy-den:latest + +# Push to Gitea +docker login git.hiddenden.cafe +docker push git.hiddenden.cafe/mats/cozy-den:latest +``` + +## Important Implementation Guidelines + +### DO: +- Maintain the cozy, warm aesthetic (coffee theme) +- Keep the site lightweight and fast (static HTML/CSS) +- Use CSS custom properties for all colors +- Add `.fade-in` class for animations +- Test both dev and production builds +- Verify Docker build works after changes +- Use semantic HTML with consistent `.card` class styling +- Ensure responsive design works on mobile +- Be warm and friendly in communication (matches site vibe) +- Focus on practical implementation +- Respect the furry community context + +### DON'T: +- Add tracking or external dependencies +- Make the site heavy or complex +- Use JavaScript unless absolutely necessary (site is pure HTML/CSS) +- Create sterile or corporate design elements +- Add features not explicitly requested +- Break the coffee/warm color theme +- Ignore accessibility considerations + +## Astro-Specific Notes + +- **File Extensions:** `.astro` for components, `.mjs` for config +- **Frontmatter:** Code between `---` runs at build time +- **Styling:** ` diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..67a3ead --- /dev/null +++ b/nginx.conf @@ -0,0 +1,31 @@ +server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + + # Gzip compression + gzip on; + gzip_vary on; + gzip_min_length 1024; + gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml+rss application/javascript application/json; + + # Security headers + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-Content-Type-Options "nosniff" always; + add_header X-XSS-Protection "1; mode=block" always; + + # Cache static assets + location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + } + + # Main location + location / { + try_files $uri $uri/ /index.html; + } + + # Custom error pages + error_page 404 /404.html; +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..27457eb --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "cozy-den", + "type": "module", + "version": "0.0.1", + "scripts": { + "dev": "astro dev", + "start": "astro dev", + "build": "astro check && astro build", + "preview": "astro preview", + "astro": "astro" + }, + "dependencies": { + "astro": "^4.16.18" + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..bcbf8b5 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "astro/tsconfigs/strict" +}