This is the source code for tanhio.dev, a personal website and blog built with vanilla HTML/JS and Tailwind CSS. It is designed to be lightweight, secure, and privacy-focused.
- Static Architecture: Fast and secure static HTML files.
- Styling: Tailwind CSS for utility-first styling.
- Privacy First: No external trackers, local fonts/icons, strict Content Security Policy (CSP).
- Security:
- SRI (Subresource Integrity) hashes for external assets (if any).
- GPG Key distribution (
gpg.asc). security.txtand well-defined policies.
- Testing: Comprehensive test suite including Unit, E2E, Security, and Accessibility tests.
-
Install Dependencies:
npm install
-
Start Development Server:
npx serve . -l 5173The site will be available at
http://localhost:5173. -
Watch Mode (CSS): Recompile Tailwind CSS automatically on file changes:
npm run watch:css
Compile assets for production:
npm run build:cssThe project maintains a comprehensive test suite in the tests/ directory.
| Command | Description |
|---|---|
npm test |
Run all tests (Unit, E2E, Security, A11y) |
npm run test:unit |
Run unit tests |
npm run test:e2e |
Run end-to-end browser tests |
npm run test:security |
Run security checks (CSP, HTTP headers) |
npm run test:a11y |
Run accessibility audits |
- Server: Nginx on Linux (Debian/Ubuntu)
- Path:
/var/www/tanhio_site - Security: Behind Cloudflare/AWS WAF, strict HTTPS, and rate limiting.
Production Nginx configuration is available at infra/nginx.conf.
Key Features:
- Subdomains:
tanhio.dev,blog.tanhio.dev,cv.tanhio.dev - Security Headers: HSTS, CSP, X-Frame-Options
- Caching: Aggressive caching (1 year) for static assets
- Clone repository to
/var/www/tanhio_site. - Install dependencies (
npm ci) and build CSS (npm run build:css). - Symlink and reload Nginx:
sudo ln -s /var/www/tanhio_site/infra/nginx.conf /etc/nginx/sites-available/tanhio_site sudo ln -s /etc/nginx/sites-available/tanhio_site /etc/nginx/sites-enabled/ sudo nginx -t && sudo systemctl reload nginx
├── assets/ # Static assets (CSS, JS, Images)
│ ├── styles/ # Tailwind input/output CSS
│ └── components/ # Modular JS components
├── blog/ # Blog posts
├── files/ # Public downloads (CV, GPG keys)
├── infra/ # Server Infrastructure (Nginx)
├── partials/ # HTML inclusions (Header, Footer)
├── tests/ # Test suites (Unit, E2E)
├── index.html # Landing page
└── tailwind.config.js

