Skip to content

Latest commit

 

History

History
177 lines (142 loc) · 4.46 KB

README.md

File metadata and controls

177 lines (142 loc) · 4.46 KB

Project Enferno

License: MIT Documentation Status

A modern Python web framework built on top of Flask, designed for rapid development of secure and scalable web applications. Enferno combines best practices with pre-configured components to help you build production-ready applications quickly.

Enferno Demo

Key Features

  • Modern Stack: Python 3.11+, Flask, Vue 3, Vuetify 3
  • Authentication: Flask-Security with role-based access control
  • OAuth Integration: Google and GitHub login via Flask-Dance
  • Database: SQLAlchemy ORM with PostgreSQL/SQLite support
  • Task Queue: Celery with Redis for background tasks
  • Frontend: Client-side Vue.js with Vuetify components
  • Security: CSRF protection, secure session handling
  • Docker Ready: Production-grade Docker configuration
  • AI Code Generation: OpenAI-powered code scaffolding

Frontend Features

  • Vue.js without build tools - direct browser integration
  • Vuetify Material Design components
  • Axios for API calls
  • Snackbar notifications pattern
  • Dialog forms pattern
  • Data table server pattern
  • Authentication state integration
  • Material Design Icons

AI Code Generation

Generate boilerplate code using natural language:

# Generate a model
flask generate-model --class_name User --fields "name:string, email:string:unique"

# Generate an API
flask generate-api --class_name Product --fields "name, price:decimal"

# Generate a dashboard
flask generate-dashboard --class_name Order --fields "order_number, total:decimal"

OAuth Integration

Supports social login with:

  • Google (profile and email scope)
  • GitHub (user:email scope)

Configure in .env:

# Google OAuth
GOOGLE_AUTH_ENABLED=true
GOOGLE_OAUTH_CLIENT_ID=your_client_id
GOOGLE_OAUTH_CLIENT_SECRET=your_client_secret

# GitHub OAuth
GITHUB_AUTH_ENABLED=true
GITHUB_OAUTH_CLIENT_ID=your_client_id
GITHUB_OAUTH_CLIENT_SECRET=your_client_secret

Prerequisites

  • Python 3.11+
  • Redis (for caching and sessions)
  • PostgreSQL (optional, SQLite works for development)
  • Git

Quick Start

Local Setup

  1. Clone and setup:
git clone git@github.com:level09/enferno.git
cd enferno
./setup.sh  # Creates Python environment, installs requirements, and generates secure .env
  1. Initialize application:
flask create-db  # Setup database
flask install    # Create admin user
  1. Run development server:
flask run

Docker Setup

One-command setup with Docker:

docker compose up --build

The Docker setup includes:

  • Redis for caching and session management
  • PostgreSQL database
  • Nginx for serving static files
  • Celery for background tasks

Configuration

Key environment variables (.env):

# Core
FLASK_APP=run.py
FLASK_DEBUG=1  # 0 in production
SECRET_KEY=your_secret_key

# Database (choose one)
SQLALCHEMY_DATABASE_URI=sqlite:///enferno.sqlite3
# Or for PostgreSQL:
# SQLALCHEMY_DATABASE_URI=postgresql://username:password@localhost/dbname

# Redis & Celery
REDIS_URL=redis://localhost:6379/0
CELERY_BROKER_URL=redis://localhost:6379/1
CELERY_RESULT_BACKEND=redis://localhost:6379/2

# Email Settings (optional)
MAIL_SERVER=smtp.example.com
MAIL_PORT=465
MAIL_USE_SSL=True
MAIL_USERNAME=your_email
MAIL_PASSWORD=your_password
SECURITY_EMAIL_SENDER=noreply@example.com

# OAuth (optional)
GOOGLE_AUTH_ENABLED=true
GOOGLE_OAUTH_CLIENT_ID=your_client_id
GOOGLE_OAUTH_CLIENT_SECRET=your_client_secret

GITHUB_AUTH_ENABLED=true
GITHUB_OAUTH_CLIENT_ID=your_client_id
GITHUB_OAUTH_CLIENT_SECRET=your_client_secret

# AI Features (optional)
OPENAI_API_KEY=your_openai_key

# Security Settings
SECURITY_PASSWORD_SALT=your_secure_salt
SECURITY_TOTP_SECRETS=your_totp_secrets

Security Features

  • Two-factor authentication (2FA)
  • WebAuthn support
  • OAuth integration
  • Password policies
  • Session protection
  • CSRF protection
  • Secure cookie settings
  • Rate limiting
  • XSS protection

For detailed documentation, visit enferno.readthedocs.io

Contributing

Contributions welcome! Please read our Contributing Guide.

License

MIT licensed.