mitm.life - Cybersecurity Blog
September 6, 2025 ยท View on GitHub
A modern cybersecurity blog built with Astro featuring seamless Obsidian integration for content management.
๐ Quick Start
Prerequisites
- Node.js 18+ and npm
- Git
Installation
-
Clone the repository
git clone <repository-url> cd mitm -
Install dependencies
npm install -
Set up Git hooks
npm run prepare -
Start development server
npm run devOpen 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 servernpm run build- Build for productionnpm run preview- Preview production buildnpm run check- Run Astro type checking
Quality Assurance
npm run lint- Check code quality with ESLintnpm run lint:fix- Auto-fix ESLint issuesnpm run format- Format code with Prettiernpm run format:check- Check code formattingnpm run type-check- Run TypeScript checks
Testing
npm run test- Run unit testsnpm run test:watch- Run tests in watch modenpm run test:coverage- Generate test coverage reportnpm run e2e- Run end-to-end tests
Maintenance
npm run audit- Security auditnpm run update-deps- Update dependencies safelynpm run health-check- Comprehensive project health check
Performance & Content
npm run lighthouse- Performance auditnpm run bundle-analyze- Analyze bundle sizenpm run content-check- Validate content qualitynpm 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 scriptsguides/- Step-by-step tutorialsresearch/- Original research and analysisresources/- 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
- Write in Obsidian with proper frontmatter
- Validate with
npm run content-check - Test locally with
npm run dev - Build and verify with
npm run build - 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 systemfix(ui): resolve mobile navigation issuedocs: 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
- Check the CLAUDE.md file for AI assistant guidance
- Review PROJECT_MEMORY.md for current decisions and todos
- Run
npm run health-checkfor automated diagnostics - Review recent commits for breaking changes
- 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