# Make Mvc Web Service

> Generate or modify MVC web services and server-rendered web applications. Use when Codex needs to scaffold or extend Model-View-Controller projects with models, views, controllers, services, repositories, validation, database access, configuration, security, Docker support, documentation, and tests across common web frameworks. Prefer this skill when the user explicitly asks for MVC, controllers with views/templates, route-based server-rendered screens, or a web service organized around model/view/controller responsibilities; avoid using it for API-only work unless the user requests MVC structure.

- Skill: `b-holanda/make-mvc-web-service` (Agent Skill, multi-file: 11 files)
- Install (CLI): `npx skillmds@latest add b-holanda/make-mvc-web-service`
- Raw SKILL.md: https://api.skillmd.com/api/skills/b-holanda/make-mvc-web-service/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: b-holanda (https://skillmd.com/u/b-holanda)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/b-holanda/make-mvc-web-service

---


# Make MVC Web Service

MVC is a software architecture pattern that separates an application into three primary responsibilities: Model, View, and Controller. This separation improves maintainability, testability, and clarity when the application grows beyond a single script or page.

- **Model**: Owns data structures, persistence-facing behavior, and business rules. A model may represent a domain concept, persisted entity, value object, or read model depending on the framework and application style.
- **View**: Presents data to the user. A view can be an HTML template, UI component, page, partial, or response representation.
- **Controller**: Receives input, invokes application behavior, and selects the response. Controllers should remain thin and delegate business workflows to models, services, or use-case handlers.

## Core Practices

1. **Separate Responsibilities**: Keep data behavior, presentation, and request handling in their own layers.
2. **Keep Controllers Thin**: Controllers should bind input, call services or model operations, and return a response.
3. **Use View Models or DTOs**: Pass purpose-built data structures between layers instead of exposing persistence entities everywhere.
4. **Validate at Boundaries**: Validate request input before it reaches business logic, and validate domain invariants inside the domain or service layer.
5. **Use Repositories Deliberately**: Introduce repositories when persistence details need to be isolated from business logic or controllers.
6. **Use Services for Workflows**: Use a service layer when a use case coordinates multiple models, repositories, policies, or external integrations.
7. **Avoid Business Logic in Views**: Views should render data and simple display conditions, not enforce business workflows.
8. **Handle Errors Consistently**: Map validation, not-found, authorization, conflict, and unexpected errors through predictable framework conventions.
9. **Secure by Default**: Use server-side validation, output escaping, CSRF protection, access control, and parameterized queries.
10. **Test by Layer**: Unit test models and services, integration test controllers and repositories, and add end-to-end tests for critical user flows.
11. **Externalize Configuration**: Store environment-specific settings and secrets outside the codebase.
12. **Document the Shape**: Document routes, models, services, repositories, environment variables, and deployment assumptions when scaffolding a project.

## MVC Fit Criteria

- **Web Applications**: MVC is a natural fit for applications that receive requests, load or change data, and render responses.
- **Small to Medium Applications**: MVC gives enough structure to prevent tangled code without requiring a heavy distributed architecture.
- **Server-Rendered Applications**: MVC works especially well for apps built around templates, forms, redirects, and route-based screens.
- **Applications with Multiple Contributors**: MVC gives developers clear areas of ownership across models, views, controllers, services, and repositories.
- **Applications Expected to Grow**: MVC makes it easier to add features without putting every concern in controllers or templates.

## Reference Guides

- [Controller Guidelines](references/controller-guidelines.md)
- [View Guidelines](references/view-guidelines.md)
- [Model Binding Guidelines](references/model-binding-guidelines.md)
- [Service Layer Guidelines](references/service-layer-guidelines.md)
- [Repository Pattern Guidelines](references/repository-pattern-guidelines.md)
- [Database Guidelines](references/database-guidelines.md)
- [Testing Guidelines](references/testing-guidelines.md)
- [Security Guidelines](references/security-in-classic-web-applications.md)
- [Environment Variables Guidelines](references/environment-variables.md)
- [Docker Guidelines](references/docker-guidelines.md)

