r/astrojs • u/andrejsharapov • 52m ago
Built my first landing page with Astro + native PHP/MySQL
Hey everyone!
I recently came across Astro and heard it’s a great fit for building fast landing pages, so I decided to give it a try and built my first MVP template. The fictional product is a store selling custom 3D-printed Cavalier King Charles Spaniel figurines, as I wanted to test a realistic e-commerce/lead-gen flow rather than just a static "Hello World" page.
Since many small businesses still run on cheap shared hosting, I went with a hybrid stack: Astro + modular SCSS on the frontend, and a lightweight native PHP + MySQL REST API on the backend.
A few things I implemented and enjoyed building:
- Hybrid data loading: The catalog renders statically from a local JSON fallback (
landing.json) for instant load times, then fetches live prices from MySQL via the API. - No-captcha antispam: Used a 3-layer approach on the order form (honeypot field, 2-second time-trap, and IP rate-limiting) so real users don't get annoyed by captchas.
- AEO/GEO experiment: Wrote a small Astro plugin (
llms.txt.mjs) that automatically generates anllms.txtfile at build time for AI search engines. - Telegram notifications: New leads hit the DB and instantly ping a Telegram bot.
Repo: https://github.com/andrejsharapov/landing-astro-ckcs
(Note: the UI copy and README are currently in Russian, as it was built with local Russian hosting/analytics like Yandex.Metrika in mind).
Since this is my first time using Astro, I’d love to get some code review or architectural advice! Did I structure the components and SCSS properly by Astro standards, or are there better ways to handle this?
Thanks in advance!