$ show soma-smart/framefox
Framefox is a full-stack Python web framework built on FastAPI and SQLModel, designed for building modern web applications with a focus on developer productivity. It follows an MVC architecture with clean separation of concerns, featuring a robust dependency injection container, comprehensive security system (including JWT, OAuth, CSRF protection, and brute force prevention), form handling and validation, session management, and a powerful CLI for code generation. The framework includes built-in profiling and debugging tools, task queuing capabilities, and email services. Its architecture emphasizes SOLID principles, with well-defined layers for controllers, services, repositories, and entities, making it suitable for both traditional web applications and API-driven projects.
The LLM identified 5 files worth highlighting for reuse:
A well-designed dependency injection container with service definitions, factory patterns, caching, and autowiring capabilities. Demonstrates strong understanding of DI principles with features like service tagging, runtime caching with invalidation, and support for various factory types. The container is reasonably isolated and could be extracted for use in other projects with minimal modification to remove framefox-specific dependencies.
An event dispatcher system implementing the observer pattern with automatic listener discovery and decoration-based event dispatching. Includes a clean separation between event dispatching and listening, with support for synchronous and asynchronous event handling. The system is self-contained and demonstrates good architectural thinking for decoupling components, making it suitable for extraction into other applications needing event-driven architecture.
A comprehensive profiling system that collects various metrics (SQL queries, timing, memory usage, etc.) and integrates with the request lifecycle via middleware. Features multiple specialized collectors, a web-based toolbar for viewing profiling data, and non-intrusive data collection. Shows sophisticated understanding of performance monitoring in web applications and could be adapted for use in other web frameworks with appropriate integration points.
A complete form processing system with extensible field types, validation, and handling of file uploads. Includes an abstract base class for field types, concrete implementations for common types (text, email, file, etc.), and a form builder pattern. Demonstrates thoughtful design for handling complex form scenarios while maintaining flexibility for extension, making it a reusable component for applications requiring robust form processing.
A set of security protectors including brute force protection, rate limiting, input validation, and timing attack prevention. Each protector is implemented as a focused, single-responsibility component that can be composed together. Shows deep understanding of web security threats and provides practical, configurable defenses that could be extracted for use in other web applications needing enhanced security beyond basic authentication.