Case Study & Technical Details # brayantiwa.me — Architecture & Technical Specifications Welcome to the technical specifications of **brayantiwa.me**. This case study documents the architectural decisions, technology stack, design patterns, and engineering standards implemented to build this personal portfolio and project platform. --- ## 1. Project Vision & Goals The primary objective of this platform is to serve as a **living technical showcase** presenting web projects, software engineering insights, and comprehensive case studies while upholding modern development standards: - **Raw Performance & Efficiency**: Elimination of heavy Node.js bundling pipelines in production by leveraging native browser ES Module capabilities. - **Dynamic Documentation Engine**: A secure client-side interactive Markdown parser with automated syntax highlighting. - **Immersive User Experience**: Persistent dark mode, seamless navigation with Symfony UX Turbo, polished micro-interactions, and a clean responsive showcase window layout. - **SEO & Discoverability**: Complete OpenGraph metadata, Twitter Cards, semantic HTML structure, and automated `sitemap.xml` generation. - **Software Engineering Rigor**: Strict PHP 8.4 typing, adherence to official Symfony 7.4 architectural best practices, and a 100% autowired dependency injection container. --- ## 2. Technology Stack | Component | Technology | Role & Rationale | | :--- | :--- | :--- | | **Language** | PHP 8.4+ | Strict typing, readonly properties, performance enhancements, and OPcache optimization | | **Backend Framework** | Symfony 7.4 | Strict MVC architecture, PHP attribute-based routing, autowired service container | | **Database** | MariaDB / MySQL | Reliable transactional relational storage | | **ORM & Migrations** | Doctrine ORM 3.3 | Object-relational mapping, optimized queries, and strictly versioned migrations | | **Frontend Asset Pipeline** | Symfony AssetMapper | Zero Node.js build step in production; native dependency resolution via `importmap` | | **Reactive Components** | Symfony UX (Stimulus, Turbo) | Lightweight, modular JavaScript controllers without the complexity of a monolithic SPA | | **Markdown Engine** | Marked.js + Highlight.js | Safe client-side parsing and automatic syntax highlighting across programming languages | | **Design System** | Bootstrap 5.3 + Custom CSS | Responsive layout grid, dynamic CSS custom properties, and native dark mode support | | **File Upload Components** | Symfony UX Dropzone | Streamlined drag-and-drop interface for project visuals and screenshots | --- ## 3. Key Architectural Decisions ### 3.1. Symfony AssetMapper: The Buildless Alternative to Webpack / Vite Unlike conventional modern web applications that rely on complex Node.js build toolchains (`npm`, `webpack`, `vite`), this platform leverages Symfony 7's **AssetMapper**: - **Zero `node_modules` in Production**: JavaScript packages (such as `marked` and `highlight.js`) are vendor-managed directly under `assets/vendor/` via `php bin/console importmap:require`. - **Native ES Modules**: Modern browsers handle dependencies natively using the W3C standard `importmap`. - **Instant Deployment & Caching**: No compilation step is required on the production server. Assets are automatically versioned with content hashes (digest) and served with long-lived HTTP caching headers. ```javascript // Modular integration in markdown_controller.js import { Controller } from '@hotwired/stimulus'; import { marked } from 'marked'; import hljs from 'highlight.js'; export default class extends Controller { static targets = ["source", "output"]; connect() { this.renderMarkdown(); } renderMarkdown() { const rawMarkdown = this.sourceTarget.value || this.sourceTarget.textContent; this.outputTarget.innerHTML = marked.parse(rawMarkdown); this.outputTarget.querySelectorAll('pre code').forEach((block) => { hljs.highlightElement(block); }); } } ``` --- ### 3.2. Responsive Desktop Showcase Presentation Project showcases are framed within an authentic desktop browser mockup: - **Browser Mockup Window**: Rendered with window control buttons and a simulated domain header (`brayantiwa-me-specs.live`), presenting the application interface natively without distortion. - **Adaptive Layout**: Projects with multiple screens automatically split into a Bento grid (primary showcase on the left, stacked secondary workflow cards on the right). For projects with a single high-impact visual, the showcase expands cleanly across the full width (`col-12`). --- ### 3.3. Robust & Secure File Upload Management (`ProjectImageUploader`) Image upload handling and disk lifecycle management are encapsulated in `App\Service\ProjectImageUploader`: 1. **Filename Sanitization**: Slugging via `SluggerInterface` combined with collision-resistant unique identifiers (`uniqid()`). 2. **Strict Validation**: Constraints restricting uploads to valid formats (`image/png`, `image/jpeg`, `image/webp`). 3. **Automated Disk Cleanup**: When an image is replaced or removed, the service verifies whether other projects or gallery records reference the file before permanently deleting the physical file from the server. --- ### 3.4. Security & Access Control - **Two-Factor Authentication Recovery**: Standard password authentication complemented by a custom security questions recovery flow managed via `app:setup-security`. - **Granular Authorization**: Sensible administrative protection with PHP attributes (`#[IsGranted('ROLE_ADMIN')]`) restricting project creation and modification. --- ## 4. Performance & Engineering Standards - **PHP 8.4 Attributes**: Native attributes (`#[Route]`, `#[ORM\...]`, `#[IsGranted]`) throughout the codebase, eliminating redundant YAML/XML configurations. - **Autowired Services**: Direct dependency injection based on interface type-hints (`_defaults.autowire: true`). - **Comprehensive Automated Tests**: Functional (`WebTestCase`) and integration (`KernelTestCase`) test suites validating routes, sitemaps, upload services, and Markdown rendering. Loading project details... All Projects Visit Live Project