Case Study: A Privacy-First Web Platform in Custom Vanilla PHP

Most of the web runs on data brokers and ad revenue. A platform that respects user privacy has to change both its business model and its technology stack. This case study covers the architecture and design of a subscription-based social platform built from scratch, with user data control and simple code as the main goals.

1. Privacy by design

The platform follows three rules.

  • No ads. Without ad networks, there is no need for tracking pixels or third-party cookies.
  • No data sales. The platform treats user data as a liability, and the database enforces data minimization.
  • Paid subscriptions. Revenue comes from users, so the platform's success depends on their experience and not on advertiser demands.

Privacy also applies to visitors who are not logged in. One of the first steps for a privacy-focused domain is a strict robots.txt file. Explicit crawler exclusion rules can block aggressive scrapers and AI training bots from indexing private community discussions and user-generated content.

2. Why custom Vanilla PHP

Frameworks speed up development, but a custom Vanilla PHP architecture, similar to the structure underlying systems has advantages for long-term stability.

Framework dependencies can introduce vulnerabilities and need constant maintenance. Custom PHP lets the developer control every line that runs. It is also fast: with no large routing engine or heavy ORM, scripts execute quickly, which lowers server load and improves Time to First Byte (TTFB).

Security code is written by hand too. CSRF tokens, secure session handling, and PDO prepared statements are implemented directly, so the developer understands them fully instead of leaving them inside a framework.

3. UI/UX

The frontend should be as disciplined as the backend, and the visual identity should read as clear and focused.

Dark, minimal theme. Solid dark backgrounds reduce eye strain and save battery on OLED screens.

Flat iconography. Logos, favicons, and UI elements use flat vector graphics in solid colors, with no gradients or complex shadows.

Content first. With no ad banners or sponsored sidebars, the whole screen goes to user content and interaction.

4. Field notes: mobile Safari and background execution

Interactive web apps with real-time updates, timers, or background notifications run into mobile browser limits. A common case is testing on an iPhone in Safari. iOS manages resources aggressively to save battery, so JavaScript is often suspended when Safari is minimized or the screen locks.

This breaks time-sensitive client-side features such as alarms and countdown timers, because setInterval and setTimeout cannot be trusted while the page is in the background.

The fix is to store a timestamp with Date.now() when the user starts an action or leaves the page. A visibilitychange listener detects when the browser returns to the foreground. The code then computes the difference between the stored timestamp and the current time and updates the UI immediately.

For alerts that must fire while the browser is minimized, use the Web Push API with service workers instead of running client-side JavaScript.

5. Architectural flow

Comments