mitm.life - Cybersecurity Blog

September 6, 2025 ยท View on GitHub

Build Status Lighthouse Score License: MIT

A modern cybersecurity blog built with Astro featuring seamless Obsidian integration for content management.

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Git

Installation

  1. Clone the repository

    git clone <repository-url>
    cd mitm
    
  2. Install dependencies

    npm install
    
  3. Set up Git hooks

    npm run prepare
    
  4. Start development server

    npm run dev
    

    Open http://localhost:4321 to view the site.

๐Ÿ“ Project Structure

mitm/
โ”œโ”€โ”€ .husky/                 # Git hooks for quality assurance
โ”œโ”€โ”€ obsidian-vault/         # Obsidian content (primary authoring)
โ”œโ”€โ”€ scripts/                # Maintenance and automation scripts
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/         # React components
โ”‚   โ”œโ”€โ”€ pages/              # Astro pages and routing
โ”‚   โ”œโ”€โ”€ styles/             # CSS and styling
โ”‚   โ”œโ”€โ”€ utils/              # Utility functions
โ”‚   โ””โ”€โ”€ types/              # TypeScript type definitions
โ”œโ”€โ”€ CLAUDE.md               # AI assistant configuration
โ”œโ”€โ”€ PROJECT_MEMORY.md       # Living log of decisions/todos
โ”œโ”€โ”€ PROJECT_SUMMARY.md      # High-level project snapshot
โ”œโ”€โ”€ astro.config.mjs        # Astro configuration
โ”œโ”€โ”€ tsconfig.json           # TypeScript configuration
โ””โ”€โ”€ package.json            # Dependencies and scripts

๐Ÿ› ๏ธ Development Commands

Essential Commands

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build
  • npm run check - Run Astro type checking

Quality Assurance

  • npm run lint - Check code quality with ESLint
  • npm run lint:fix - Auto-fix ESLint issues
  • npm run format - Format code with Prettier
  • npm run format:check - Check code formatting
  • npm run type-check - Run TypeScript checks

Testing

  • npm run test - Run unit tests
  • npm run test:watch - Run tests in watch mode
  • npm run test:coverage - Generate test coverage report
  • npm run e2e - Run end-to-end tests

Maintenance

  • npm run audit - Security audit
  • npm run update-deps - Update dependencies safely
  • npm run health-check - Comprehensive project health check

Performance & Content

  • npm run lighthouse - Performance audit
  • npm run bundle-analyze - Analyze bundle size
  • npm run content-check - Validate content quality
  • npm run link-check - Check for broken links

๐ŸŽฏ Content Management

Obsidian Integration

Content is authored in the obsidian-vault/ directory using Obsidian. The system automatically syncs changes to the Astro site.

Content Categories

  • tools/ - Security tools and scripts
  • guides/ - Step-by-step tutorials
  • research/ - Original research and analysis
  • resources/ - Curated reference materials

Required Frontmatter

---
title: 'Your Post Title'
description: 'Brief description for SEO and previews'
pubDate: 2024-01-15
category: tools # or guides, research, resources
tags: ['security', 'tutorial']
---

Content Workflow

  1. Write in Obsidian with proper frontmatter
  2. Validate with npm run content-check
  3. Test locally with npm run dev
  4. Build and verify with npm run build
  5. Deploy after all checks pass

Example Content

๐Ÿ”ง Git Workflow

Automated Quality Gates

Git hooks automatically enforce quality standards:

  • Pre-commit: Runs linting, formatting, type checking, and tests
  • Pre-push: Runs build and security audit
  • Commit-msg: Enforces conventional commit format

Commit Message Format

<type>[optional scope]: <description>

Types: feat, fix, docs, style, refactor, test, chore, perf, ci, build

Examples:

  • feat: add user authentication system
  • fix(ui): resolve mobile navigation issue
  • docs: update installation guide

๐Ÿšฆ Quality Standards

Code Quality

  • ESLint: Enforces consistent code style and catches errors
  • Prettier: Automatic code formatting
  • TypeScript: Strict type checking with comprehensive configuration
  • Test Coverage: Minimum 80% coverage required

Performance Requirements

  • Lighthouse score >90 for all categories
  • Core Web Vitals compliance
  • Bundle size monitoring with alerts for >10% increases
  • Image optimization for all assets

Security Standards

  • Regular dependency audits with npm audit
  • No hardcoded secrets or API keys
  • HTTPS enforcement in production
  • Content Security Policy implementation

๐Ÿฅ Maintenance

Regular Health Checks

Run comprehensive health checks:

npm run health-check

Dependency Updates

Safely update dependencies:

npm run update-deps

Performance Monitoring

Monitor and analyze performance:

npm run lighthouse
npm run bundle-analyze

๐Ÿ” Troubleshooting

Common Issues

Development Server Won't Start

# Clear cache and restart
rm -rf .astro node_modules/.cache
npm install
npm run dev

Build Failures

# Run diagnostics
npm run type-check
npm run lint
npm run health-check

Content Sync Issues

# Validate content structure
npm run content-check
npm run link-check

Getting Help

  1. Check the CLAUDE.md file for AI assistant guidance
  2. Review PROJECT_MEMORY.md for current decisions and todos
  3. Run npm run health-check for automated diagnostics
  4. Review recent commits for breaking changes
  5. Check the development server logs for specific errors

๐Ÿค– AI Assistant Integration

This project is optimized for use with Claude Code. See CLAUDE.md for:

  • Development workflow guidelines
  • Context priming instructions
  • Task management best practices
  • Troubleshooting guides

Also see PROJECT_MEMORY.md for current project state.

๐Ÿ“ˆ Performance Metrics

The project maintains strict performance standards:

  • Build Time: < 30 seconds for full build
  • Dev Server: Hot reload < 500ms
  • Lighthouse Scores: >90 for all categories
  • Bundle Size: Monitored with automatic alerts
  • Test Coverage: Minimum 80% across all modules

๐Ÿ” Security

Security is built into every layer:

  • Automated vulnerability scanning with npm audit
  • Git hooks prevent committing secrets
  • Content validation prevents XSS
  • Regular dependency updates
  • HTTPS-only in production

๐Ÿ“„ License

This project is licensed under the MIT License. See LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Built with Astro
  • Content management via Obsidian
  • Performance monitoring with Lighthouse
  • Quality assurance powered by comprehensive tooling