Self-Hosted Lab
Personal Projects | | Links: Check it out here!
Introduction
This project is an experimental initiative focused on self-hosting, primarily targeting a web application. However, due to architectural and security considerations, only the API component was self-hosted. The API retrieves the machine’s status, while the frontend is deployed via Cloudflare Pages. Instead of exposing the API directly, a Cloudflare Worker serves as an intermediary, preventing the frontend from directly accessing the self-hosted server. Although the tunnel remains exposed, all requests are routed through the Worker, which then forwards them to the API. To reduce machine load, the design leverages Cloudflare KV for caching; in high-traffic scenarios, responses are served from KV storage, with updates scheduled via Cron jobs. The Worker also enforces access control, applies caching, and filters requests at the edge, thereby reducing the attack surface. Overall, the setup illustrates a hybrid hosting approach that combines the control and flexibility of self-hosted backends with the scalability and global reach of serverless frontend delivery.
Technologies Used
- Cloudflare
- Pages
 - Tunnels
 
 - Python
- FastAPI
 
 - HTML
 - CSS
 - JavaScript