This project is a custom-built portfolio and application platform designed using a hybrid architecture:
- 🧠 PHP (MVC-style) for routing, controllers, and server-side rendering
- ⚡ Vanilla JavaScript (Async/AJAX) for dynamic UI updates and SPA-like behavior
The goal is to create a lightweight, framework-free web application that combines:
- The simplicity of PHP
- The responsiveness of modern front-end apps
This application follows a Hybrid MVC + SPA pattern:
Client (Browser)
↓
JavaScript (AJAX / Fetch)
↓
PHP Router (index.php)
↓
Controller Logic (logic.php)
↓
View Rendering (templates)
/core
/controllers
routes.php # Route definitions
logic.php # Controller functions
/databases
Database.php
messages.sqlite
/security
Secrets.php
/templates
/regions
header.php
header-nav.php
footer.php
home.php
about.php
contact.php
projects.php
resume.php
index.php # Main application entry point
Routes are defined using a method + path key format:
'GET /projects' => ['handler' => 'projects'],
'POST /contact' => ['handler' => 'contactPost'],- Request enters
index.php - URI + method are parsed
- Route is matched from
$routes - Corresponding controller function is executed
Each route maps to a controller function:
function projects(): void {
view('projects');
}Controllers are responsible for:
- Handling request logic
- Passing data to views
- Returning JSON (for API-like responses)
Views are rendered using a shared layout:
function view(string $view_name, array $data = []): void {
extract($data);
require header;
require nav;
require view;
require footer;
}This ensures:
- Consistent layout
- Reusable components
- Clean separation of concerns
Although the app uses PHP rendering, it supports SPA-like navigation via JavaScript:
- Fetch content asynchronously
- Inject HTML into the DOM
- Avoid full page reloads
Example:
fetch('/projects')
.then(res => res.text())
.then(html => {
document.getElementById('app').innerHTML = html;
});Supports REST-like behavior via POST:
$_POST['_method'] = 'PUT';or
X-HTTP-Method-Override: PUT
function contactPost(): void {
echo json_encode(["message" => "Success"]);
}Returns JSON responses for async handling.
- Dedicated
/api/*route namespace - Authentication system
- Admin dashboard for content management
- Cartana price comparison engine integration
- Full client-side routing (history.pushState)
This project intentionally avoids heavy frameworks to:
- Demonstrate core engineering fundamentals
- Maintain full control over architecture
- Showcase custom-built solutions
Larry Mayers Data Engineer | Web Developer | System Designer
This is not just a portfolio — it is a living system designed to evolve into:
A data-driven platform combining web engineering, analytics, and real-world applications like Cartana.