/framefox

๐ŸฆŠ Python web framework that makes development enjoyable - FastAPI + MVC + SQLModel + Interactive CLI. Ship fast without sacrificing quality.

Primary LanguagePythonMIT LicenseMIT

Framefox Logo

๐ŸฆŠ Framefox

Swift, smart, and a bit foxy!

The Python web framework that makes development enjoyable and productive

Python Version License: MIT FastAPI SQLModel Pydantic

๐Ÿš€ Quick Start โ€ข ๐Ÿ“– Documentation โ€ข ๐ŸŽฏ Examples โ€ข ๐Ÿ’ฌ Contact โ€ข ๐Ÿค Contributing


๐ŸŒŸ Why Framefox?

Framefox combines the speed of FastAPI with clean MVC architecture, type-safe SQLModel, robust Pydantic validation, and developer-friendly tooling. Built for developers who want to ship fast without sacrificing code quality.

โœจ What makes it special?

๐ŸŽฏ MVC Architecture - Clean separation with Controllers, Templates, and Repositories
๐Ÿ—๏ธ Interactive CLI - Generate components instantly with framefox create
โšก FastAPI Foundation - Built on FastAPI with async support out of the box
๐Ÿ—„๏ธ SQLModel Integration - Type-safe database models with automatic validation
๐Ÿ“‹ Pydantic Validation - Robust data validation and serialization everywhere
๐Ÿ”’ Security First - CSRF protection, XSS prevention, and secure authentication
๐Ÿง  Developer Friendly - Jinja2 templates, hot reload, and comprehensive debugging
๐Ÿ“ฑ Modern Stack - Python 3.12+, async/await, dependency injection everywhere

Un petit mot en franรงais

Framefox est bien un outils de l'hexagone ๐Ÿ‡ซ๐Ÿ‡ท N'hesitez pas ร  communiquer avec nous directement en franรงais pour toute questions (de prรฉfรฉrence sur linkedin). Une version de la documentation en franรงais est รฉgalement prรฉvu !


Demo

๐Ÿš€ Quick Start

Get a full web application running in 30 seconds:

# Install Framefox
pip install framefox

# Init your project
framefox init

# Start developing
framefox run

That's it! ๐ŸŽ‰ Your app is running on http://localhost:8000

Demo

๐ŸŽฏ Examples

๐Ÿ’จ Controllers with Routes

from framefox.core.routing.decorator.route import Route
from framefox.core.controller.abstract_controller import AbstractController

class UserController(AbstractController):
    
    @Route("/users", "user.index", methods=["GET"])
    async def index(self):
        users = await self.user_repository.find_all()
        return self.render("user/index.html", {"users": users})
    
    @Route("/users/{id}", "user.show", methods=["GET"])
    async def show(self, id: int):
        user = await self.user_repository.find(id)
        return self.render("user/show.html", {"user": user})

๐ŸŽจ Jinja2 Templates with Built-in Functions

<!-- templates/user/index.html -->
<!DOCTYPE html>
<html>
<head>
    <title>Users</title>
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">
</head>
<body>
    <h1>Users</h1>
    
    {% for user in users %}
        <div class="user-card">
            <h3>{{ user.name }}</h3>
            <a href="{{ url_for('user.show', id=user.id) }}">View Profile</a>
        </div>
    {% endfor %}
</body>
</html>

๐Ÿ—๏ธ Architecture That Scales

my-project/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ ๐ŸŽฎ controllers/     # Handle HTTP requests and business logic
โ”‚   โ”œโ”€โ”€ ๐Ÿ›๏ธ entity/          # Database models and entities  
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ form/           # Form types and validation
โ”‚   โ””โ”€โ”€ ๐Ÿ—„๏ธ repository/     # Data access layer
โ”œโ”€โ”€ ๐ŸŽจ templates/          # Jinja2 templates with template inheritance
โ”œโ”€โ”€ โš™๏ธ config/             # YAML configuration files
โ”œโ”€โ”€ ๐ŸŒ public/            # Static assets (CSS, JS, images)
โ””โ”€โ”€ ๐Ÿ“‹ main.py            # Application entry point

Clean MVC separation means your code stays maintainable as your team and project grow.

๐Ÿ”ฅ Core Features

๐Ÿš„ Performance

  • FastAPI foundation
  • Async/await support
  • Built-in template caching
  • Dependency injection container
  • Repository pattern for data access

๐Ÿ›ก๏ธ Security

  • CSRF token generation
  • XSS prevention in templates
  • Secure session management
  • User authentication system
  • Role-based access control

๐Ÿงฐ Developer Experience

  • Interactive CLI commands
  • Component generators
  • Hot reload development server
  • Comprehensive error pages
  • Built-in profiler and debugger

๐Ÿ—ƒ๏ธ Database & ORM

  • SQLModel integration for type safety
  • Pydantic validation everywhere
  • Entity-Repository pattern
  • Database migrations with Alembic
  • Relationship mapping
  • Query builder integration
  • Multi-database support

๐Ÿ› ๏ธ Interactive CLI

Framefox includes a powerful CLI for rapid development:

# Generate components instantly
framefox create controller
framefox create entity
framefox create crud       # Full CRUD with templates

# Database management
framefox database create-migration
framefox database upgrade

# Development tools
framefox run            # Start development server
framefox debug router       # List all routes
framefox cache clear        # Clear application cache

๐ŸŽจ Template System

Framefox uses Jinja2 with powerful built-in functions:

๐Ÿ”ง Built-in Template Functions

  • {{ url_for('route.name', param=value) }} - Generate URLs from route names
  • {{ asset('path/file.css') }} - Asset management with versioning
  • {{ csrf_token() }} - CSRF protection
  • {{ current_user }} - Access authenticated user
  • {{ get_flash_messages() }} - Session-based notifications

๐Ÿ—๏ธ Template Inheritance

<!-- base.html -->
<!DOCTYPE html>
<html>
<head>
    <title>{% block title %}My App{% endblock %}</title>
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">
</head>
<body>
    <nav>
        <!-- Navigation with authentication -->
        {% if current_user %}
            <span>Welcome, {{ current_user.name }}!</span>
        {% endif %}
    </nav>
    
    <main>
        {% block content %}{% endblock %}
    </main>
</body>
</html>

๐Ÿ“š Learn More

๐Ÿ“– Resource ๐ŸŽฏ Perfect For
๐Ÿ“‹ Installation Guide Getting up and running
๐ŸŽฎ Controllers Guide Building your application logic
๐ŸŽจ Templates Guide Creating beautiful views
๐Ÿ” Security Guide Securing your application
๐Ÿš€ Deployment Guide Going to production

๐Ÿ’ฌ Contact

LinkedIn SOMA

Need help or have questions? Contact us directly!


๐Ÿค Contributing

We โค๏ธ contributors! Here's how you can help:

๐Ÿ†• For New Contributors

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฟ Create a feature branch: git checkout -b feature/amazing-feature
  3. ๐Ÿ’พ Commit your changes: git commit -m 'Add amazing feature'
  4. ๐Ÿ“ค Push to the branch: git push origin feature/amazing-feature
  5. ๐Ÿ”„ Open a Pull Request

๐ŸŽฏ Good First Issues

  • ๐Ÿ“ Improve documentation
  • ๐Ÿ› Fix small bugs
  • โœจ Add examples
  • ๐Ÿงช Write tests

For any questions about contributing, feel free to contact us directly on LinkedIn!


๐Ÿ† Support the Project

If Framefox helps you build amazing things:

โญ Star this repository
๐Ÿฆ Share on social media
๐Ÿ“ Write a blog post
๐Ÿ”— Share with friends

Your support means the world to us! ๐Ÿ™

๐Ÿ“ˆ Star History

Follow our journey and see how Framefox is growing with the community

Star History Chart

Each star motivates us to improve Framefox further! โญ


๐Ÿ›ฃ๏ธ Roadmap

๐Ÿšง What's Coming Next

Framefox is actively developed with exciting features on the horizon!

In Progress

  • Advanced Testing Suite - Built-in testing utilities and fixtures (we know Framefox lack of more tests)
  • Internationalization (i18n) - Multi-language support with automatic translation management
  • WebSocket Support - Real-time features with integrated WebSocket handling
  • Enhanced Profiler - Advanced performance monitoring and optimization tools
  • Better Security control - Role Hierachy, rate limiting, Security Header configuration
  • Functional Worker - Background task with a command to generation task

๐Ÿš€ Future Vision

  • โ˜๏ธ Cloud Deploy Tools - Built-in deployment to AWS, GCP, and Azure
  • ๐ŸŽจ Visual Admin Panel - Auto-generated admin interface for your models
  • ๐Ÿ“ฑ Mobile API Generator - Automatic REST API generation for mobile apps

๐Ÿ‡ซ๐Ÿ‡ท Documentation franรงaise

  • ๐Ÿ“š Documentation complรจte en franรงais - Guide complet et tutoriels
  • ๐ŸŽฅ Tutoriels vidรฉo - Sรฉrie de vidรฉos explicatives

๐Ÿ“ข Want to Influence the Roadmap?

Your feedback shapes Framefox's future! Contact us on LinkedIn to:

  • ๐Ÿ’ก Suggest new ideas
  • ๐Ÿค Collaborate on development
  • ๐Ÿงช Beta test upcoming features
  • ๐Ÿ—ณ๏ธ Vote on priority features (maybe!)

Contact Us

๐Ÿ‘ฅ Core Team

๐Ÿข Backed by SOMA Smart

SOMA Smart

Framefox is proudly backed by SOMA Smart, a technology company focused on data transformation and building innovative development tools.

Rayen Raphaรซl
Rayen BOUMAZA Raphaรซl LEUROND
Framework Architect Core Developer
๐Ÿ—๏ธ Architecture & Performance ๐Ÿ”ง Features & DevX

๐ŸŒŸ About SOMA Smart

SOMA Smart is committed to empowering developers with cutting-edge tools and frameworks. Framefox represents our vision of making Python web development more productive, secure, and enjoyable.

  • ๐Ÿš€ Innovation-driven development approach
  • ๐Ÿ”ง Open-source commitment and community focus
  • ๐ŸŒ Global team of passionate developers
  • ๐Ÿ“ˆ Long-term support and continuous improvement

Learn more about SOMA Smart โ†’

---

๐ŸฆŠ Swift, smart, and a bit foxy!

Framefox makes Python web development enjoyable and productive.

โญ Star us on GitHub โญ

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.