API_Web is a backend-focused project designed to explore and apply clean architectural principles using a simple and well-defined domain.
The project prioritizes clarity, correctness, and maintainability over feature breadth, serving as an educational and evolvable foundation for backend development.
Many small backend projects grow without clear structure, leading to tightly coupled code, unclear responsibilities, and fragile tests.
This project was created to address those issues by:
- Applying a clear architectural pattern (MVC)
- Enforcing separation of concerns
- Treating the database as an explicit and controlled dependency
- Encouraging deterministic and understandable behavior
The purpose of this project is to provide a structured backend API that:
- Demonstrates clean separation between layers
- Uses explicit contracts between components
- Remains easy to reason about, test, and extend
- Serves as a learning vehicle for real-world backend practices
Correctness and architectural integrity are prioritized over rapid feature expansion.
The project follows the MVC (Model–View–Controller) architectural pattern, adapted for a backend API context.
- Model
- Domain entities (
models/entities) - Database connection and ORM base (
models/connection) - Repositories (
models/repositories)
- Domain entities (
- Controller
- Route handlers and request orchestration (
main/routes)
- Route handlers and request orchestration (
- View
- JSON responses returned by the API (no UI rendering)
This structure ensures that business logic, persistence, and request handling remain clearly separated.
src/ ├── database/ │ └── init/ │ └── schema.sql ├── main/ │ ├── routes/ │ │ └── user_route.py │ └── server/ │ └── server.py ├── models/ │ ├── connection/ │ │ ├── base.py │ │ └── db_connection_handler.py │ ├── entities/ │ │ └── users.py │ └── repositories/ │ └── users_repository.py ├── __init__.py run.py
Additional documentation lives in the docs/ directory.
The system focuses on a small and controlled domain .
- Handling HTTP requests via Flask
- Managing user data through a repository layer
- Interacting with a relational database (SQLite)
- Applying automated tests to persistence logic
- Enforcing architectural boundaries
- Frontend or UI rendering
- Authentication and authorization
- Distributed systems or messaging
- Performance optimization beyond correctness
- Production-scale deployment concerns
For more detail, see docs/scope.md.
- SQLite is used for simplicity and transparency
- Database schema is defined explicitly (
schema.sql) - The database is treated as an external dependency, not implicit state
- Tests may use either in-memory or file-based databases depending on intent
- Repository behavior is validated via automated tests
- Tests are written to highlight the importance of data isolation and state control
- Both isolated and persistent-database scenarios are intentionally explored
Testing decisions are documented and aligned with the project’s educational goals.
docs/architecture.md— Architectural decisions and layer responsibilitiesdocs/scope.md— Explicit definition of system scopeCHANGELOG.md— Versioned record of changesSECURITY.md— Security-related considerations
This project does not aim to:
- Be a production-ready system
- Replace full-featured frameworks
- Hide infrastructure complexity behind abstractions
- Optimize prematurely for scalability
This repository serves as:
- A learning artifact
- A reference for clean backend structure
- A controlled environment to explore architectural trade-offs
Any significant change in intent or scope must be reflected in the documentation .
This project was initially developed following the Clean Code course by Rocketseat as a learning reference.
At this stage, the structure and patterns closely align with the course material, with minor adaptations applied intentionally.
Future iterations of this project may diverge from the original course approach as architectural decisions evolve independently.