The full-stack pick for shared hosting - everything you need is already installed.
This trio has powered a huge share of the web for decades, and on shared hosting it's still the path of least resistance: PHP and MySQL are pre-installed, deployment means uploading files, and there's no build step anywhere.
You'll see this stack when you're on shared hosting and you're not building a real-time app (real-time projects get React + Node.js + Firebase, which also works on shared hosting).
This "server-rendered first, JavaScript second" approach is called progressive enhancement. It's fast, accessible and search-engine friendly by default.
A PHP endpoint that updates a like count and returns JSON:
<?php
// like.php
require __DIR__ . '/db.php';
$id = (int) ($_POST['id'] ?? 0);
$pdo->prepare('UPDATE posts SET likes = likes + 1 WHERE id = ?')->execute([$id]);
$stmt = $pdo->prepare('SELECT likes FROM posts WHERE id = ?');
$stmt->execute([$id]);
header('Content-Type: application/json');
echo json_encode(['likes' => (int) $stmt->fetchColumn()]);
And the JavaScript that calls it without reloading the page:
document.querySelectorAll(".like-btn").forEach((btn) => {
btn.addEventListener("click", async () => {
const res = await fetch("like.php", {
method: "POST",
body: new URLSearchParams({ id: btn.dataset.id }),
});
const data = await res.json();
btn.textContent = `♥ ${data.likes}`;
});
});
db.php) used above.password_hash() and sessions) to create and edit events.fetch and updating the count in place.Shared hosting is inexpensive and usually includes the database, a free SSL certificate and email addresses for your domain. Check the backup policy, pick the newest PHP version in the control panel, and you're done - there's nothing else to provision.
include.htmlspecialchars() on every output, CSRF tokens on forms that change data.When you find yourself writing the same routing, validation and login code repeatedly, it's time for Laravel, which still runs on many shared hosts. And if one page needs a rich, app-like interface, you can drop Vue onto just that page with a script tag.