What Is SunMvc?
Every project built on SunMvc starts from the same blank template: routing, controllers/models/views, authentication, i18n, and error handling already wired up and tested, with zero application-specific code baked in. Instead of scaffolding a new stack from scratch each time, you build your next project directly on top of a foundation that already works - and every lesson from a previous project (routing fixes, the auth flow, the error page mechanism) gets folded back into the template for the next one.
How a Request Flows
A request enters through a single, traceable path: .htaccess rewrites every URL to index.php, which loads your environment, wires up the database, authentication, filtering, and localization services in a fixed order, then hands off to your controller. By the time your code runs, routing is already parsed, the language is already resolved, and CSRF protection is already checked on every POST - you write the feature, not the plumbing around it.
Controllers, Models, Views
Controllers, models, and views follow one predictable shape across the whole project: one controller class per URL segment, one model class for its data access, one view file per controller (not per screen). A controller's local variables are directly visible in its view - no separate view-data mechanism to learn, no template engine to fight.
Authentication and Security, Built In
Authentication ships complete, not as an exercise for the reader: login, registration, session management, password reset, and TOTP two-factor authentication all work out of the box against a documented database schema. CSRF protection runs automatically on every POST request. Sensitive folders are blocked from direct access at the web-server level, not left to application code to enforce.
Internationalization You're Reading Right Now
Every visible string in the framework runs through the same translation layer you're reading right now - this very page is rendered in whichever language you're viewing it in, using the framework's own _t()/_tr() functions and a flat, JSON-based translation table. Add a language by adding a code and a translation file; no code changes required.
The Sun* Class Library
A small library of framework-agnostic classes handles the things every project needs - authentication, a fluent database query builder, input sanitization, mail delivery, CAPTCHA, and sitemap generation - kept deliberately separate from the routing engine so either half can evolve independently.
SEO-Friendly URLs
Every URL is search-engine-friendly by default: .htaccess rewrites clean paths like /en/blog/show/42 straight to your controller, with no query-string clutter. For content that deserves a readable URL - a blog title, a product name - _s() and slugId() combine a row's id with a slugified title into one path segment (.../blog/show/42-hello-world); only the id is ever matched, so the link keeps working even after the title changes. SunSitemap, part of the Sun* class library, generates sitemap.xml, sitemap-index.xml, and robots.txt directly from your routes, so search engines can crawl and index your project without any extra tooling.
Documented, Folder by Folder
Every structural folder in the system - Core, System, App/Controllers, App/Models, App/Views, App/Lang, and Public - ships with its own README.md explaining exactly what's there and how to extend it, with real examples pulled from this template's own working code, not hypothetical snippets.
Built for AI-Assisted Coding
SunMvc is designed to be read by AI coding tools, not just humans: open the project folder in an editor like VS Code, point an AI assistant - Claude, GitHub Copilot, Cursor, Windsurf, Gemini CLI - at it, let it read the README.md files scattered through the tree, then describe the system you want built. It can scaffold your idea directly on top of the SunMvc foundation already open in your workspace.
One Query Builder, Any Database
Every database call in SunMvc goes through one custom-built class, SunDB - a single fluent query builder that speaks MySQL, MSSQL, and SQLite alike. Switch the driver in one config array and everything keeps working exactly as before: select()/insert()/update()/delete(),paginate() for paged results, backup() for a one-command SQL dump, maintenance() to analyze/check/optimize/repair every table, plus transactions and join helpers - no query rewrites, no separate driver-specific code paths.
Ready for SEO, GEO, AIO, SGE, LLMO & AEO
This page is built for full compatibility with SEO (Search Engine Optimization),GEO (Generative Engine Optimization),AIO (Artificial Intelligence Optimization),SGE (Search Generative Experience),LLMO (Large Language Model Optimization),and AEO (Answer Engine Optimization): a hreflang-tagged sitemap.xml and canonical URLs for traditional search, a robots.txt that explicitly welcomes GPTBot, ClaudeBot, PerplexityBot, and other AI crawlers, an llms.txt summary written for AI agents, and JSON-LD structured data that lets answer engines lift accurate facts instead of parsing prose.
Get Started
Clone the template, copy .env.example to .env with real database credentials, import the schema, and pick which languages to support. There's no build step, no package manager lock file to fight - a working authentication flow and a fully wired i18n system are there from the first request.
Download on GitHub