AI prompt to generate code and docs to stand up and run a production enviornment of enterprise-worthy servers that run macos locally.
NOTE: Content here are my personal opinions, and
not intended to represent any employer (past or present).
“PROTIP:” here highlight information I haven’t seen elsewhere on the internet
because it is hard-won, little-know but significant facts
based on my personal research and experience.
Why this?
https://www.youtube.com/watch?v=OL9ckcSkwtg
sovereignty
https://www.youtube.com/watch?v=xBIowQ0WaR8
Build your own cloud by NetworkChuck
$6/mo Filecloud CE or NextCloud GmbH FOSS
https://www.youtube.com/watch?v=lsuj1blTRoo
https://www.youtube.com/watch?v=6gyOBE-n2UY can’t recommend
Below is a prompt for AI:
Create a new project called “backend” containing all that is needed to stand up and run a production enviornment of enterprise-worthy servers that run macos locally on a macos M3 machine (which runs systemd).
External:
- Email server (instead of Gmail or MS Exchange)
- Cloudflare.DDNS for stable external IP address to internet provider’s IP address.
- CDN edge locations to reduce latency
- 3G Network router from T-Mobile
- Firewall to
Self-hosted servers installed locally:
- Time server
- Ad blocker
- DNS to resolve host names to IP addresses
- Reverse proxy server to compress SSL & cache same static responses (NGINX, Envoy, Caddy, HAproxy)
- Load balancer to distribute load among workers with least connections with session affinity
- Tailscale VPN
-
API gateway auth, rate limiting (Kong)
- VaultWarden password manager. See https://www.youtube.com/watch?v=EtHpkMlyMHE
- Portainer GUI (instead of Docker Compose or Kubernetes, Unrail, or TruNAS SCALE)
- Gitea (GitHub clone) install using brew
- HomeBrew server
-
PyPi package mirror
- Nextcloud (linuxserver.io) store of Google Drive, Contacts https://www.youtube.com/watch?v=yxfyvxwfLqw&t=33s https://www.youtube.com/watch?v=3HukNx5k3x4 (Alt: OwnCloud)
- Nextcloud Talk (instead of Zoom & Slack)
- Immach $100 photo storage. https://immich.app/ VIDEO
- Papra (https://papra.app/en/) for photo tagging
- Jellyfin https://jellyfin.org/ FOSS media streaming server to store and serve video (mp4) files. See https://www.youtube.com/watch?v=Z1qxr2b0-VA&pp=ugUEEgJlbg%3D%3D
-
Music
- HomeAssistant FOSS IOT server
- PostgreSQL database to index of my movie DVD collection
- Redis server for caching
- Ollama to use downloaded LLMs.
- Firewall to dynamically block outgoing traffic when running batch jobs.
- Prometheus observability server to serve a dashboard and alerts about request counts, latency, business metrics over time.
- Test coverage tracking
Apps are written in Python with centralized config and secretes out of code.
- Use Modular Monolith: Scale Without Microservices
- Custom apps contain structured logging with structlog, Typer, dependency injection, and tests.
- Calls to APIs have retry, exponential backoff, timeout, and circuit-breaker policies.
- Service interfaces can replace real HTTP calls with a fake in tests.
- EuroOffice compitible
Build it to be scalable, reliant, and secure.
- Dockerfile for each service to work in Kubernetes to use more storage classes and for future scaling on clouds
- Local Kubernetes uses Weave CNI (don’t use docker-compose)
- ci.yml GitHub workflow CI/CD build CLI has linting, type checking, and security scanning.
- Full test suite with unit, integration, and contract tests.
- Release automation for wheel publishing.
- Backup services on a separate cloud with write-only (no delete) access.
Files generated include:
- README with detailed instructions for newbie SREs describe the manual actions needed to setup, operate,and troubleshoot all aspects.
- .gitignore containing all temporary folders and files created by the system
- pyproject.toml define current versions of all dependencies
- ClI scripts to create chaos and break-in conditions (to test organizational response)
Observability metrics and alerts include:
- P95/P99 latency (not just average)
- Error rate spikes
- Database connection exhaustion
- CPU/memory saturation
References:
- https://www.youtube.com/watch?v=DlzkIjhJ18o&pp=ugUEEgJlbg%3D%3D
MacOS client software:
- MakeMKV to extract DVD to .mkv container. This preserves all audio/subtitle tracks; open format
- In HandBrake transcode .mkv to .mpr. This optimizes file size; universal compatibility; has macOS preset “Fast 720p30” or “Fast 480p30” preset (DVDs are 480p max, don’t upscale) → Export as .mp4
- Jellyfin for Netflix-like UI. It auto-fetches metadata (posters, ratings, descriptions) from TheMovieDB if files follow this convention:
Movies/
└── The Devil Wears Prada (2006)/
└── The Devil Wears Prada (2006) 1. 720p.mp4
- $22.99 Movie Explorer Pro ($50/year) server catalogs mp4 video files and physical DVD library. https://apps.apple.com/us/app/movie-explorer/id802224528?mt=12
https://www.youtube.com/watch?v=DlzkIjhJ18o
12 Self-Hosted Apps to Finally Quit Big Tech.