← Projects

Beto CenterHow I ran it

Beto Center is a lenses and hair-care store with an AR lens try-on. This page covers what runs where, how the front-end is built to load fast, and how updates ship.

Every detail on this page was checked against the live server and site on 14 Oct 2026.

Beto Center is offline now. This page describes how it ran in production.

The setup

Beto Center production architecture Visitors reach Cloudflare over HTTPS. Cloudflare forwards to one VPS running Nginx, which serves the pre-built React front-end and passes API and upload requests to an Express API managed by PM2. The API stores its data in MongoDB Atlas, a managed database outside the server. Visitors HTTPS Cloudflare TLS · edge cache for static files One VPS · Ubuntu 24.04 Nginx HTTP/2 · gzip · serves the front-end passes /api and /uploads to the API React front-end pre-built bundles cached for a year Express API PM2 · this server only restarts on crash MongoDB Atlas managed database
How a request reaches the database. The database is a managed service outside the server.
  • One VPS running Ubuntu 24.04 hosts the web server and the API.
  • Cloudflare sits in front of pingdrop.world. It handles TLS and caches static files at the edge.
  • Nginx serves the pre-built front-end over HTTP/2 with gzip compression, and passes /api and /uploads to the API.
  • The Express API runs under PM2 and only listens on the server itself. PM2 restarts it if it crashes and is set to start it again when the server boots.
  • The database is MongoDB Atlas, a managed cloud database, so it doesn't live on the server.
  • The firewall only allows SSH and web traffic.

How the front-end is built to load fast

  • The build compiles every component into three bundles: one for the first page load, one for the admin dashboard and one for the AR try-on. That replaces about 40 separate script requests.
  • The admin dashboard and the AR try-on, with heavy libraries such as TensorFlow.js, are only downloaded when someone opens them.
  • Every JS and CSS file name carries a content hash, so browsers cache those files for a year and a deploy can never serve a stale one. The page itself is always revalidated.
  • Fonts are self-hosted, and the hero photo ships as WebP: about 144 KB on desktop and 116 KB on mobile, instead of a 7.3 MB original.
  • Uploaded images are resized to at most 1600 px, rotated correctly, and stripped of metadata such as GPS location before they're saved.

How updates are deployed

  1. Build and test locally. The front-end is built with npm run build and the build is served and checked before it ships.
  2. Package. The front-end and the back-end are packaged separately. Secrets, uploaded images and logs are never included.
  3. Upload and restart. The packages are extracted on the server, production dependencies are installed, and PM2 restarts the API.
  4. Check. The API's health endpoint must answer before the deploy counts as done.

Web server changes go through a script that backs up the current Nginx config, validates the new one with nginx -t, and restores the backup if validation fails.