Home

Awesome

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.

alt Enferno Demo

alt Users Management

alt Roles Management

http://enferno.io

Enferno Framework Update: OpenAI Integration

Enferno now includes powerful OpenAI integration! This feature allows for rapid generation of Flask Views, Templates, and Models using natural language. Streamline your development process by creating base code samples that can be customized to fit your needs.

New Commands:

This update boosts your productivity by reducing development time and making the coding process more intuitive.

Features

Core Features:

AI-Powered Features

Enferno comes with built-in AI commands that help you generate code using natural language:

  1. Generate a Model:
flask generate-model --class_name User --fields "name as string, email as string unique, age as integer, created_at as datetime"
  1. Generate an API:
flask generate-api --class_name Product --fields "name, description as text, price as decimal, stock as integer"
  1. Generate a Dashboard:
flask generate-dashboard --class_name Order --fields "order_number, customer_name, total_amount as decimal, status as string"

The AI commands use OpenAI's GPT models to generate boilerplate code while following best practices and project conventions. Make sure to set your OpenAI API key in the environment variables.

Prerequisites

Quick Start

Local Development

  1. Clone the repository:
git clone git@github.com:level09/enferno.git
cd enferno
  1. Set up environment and install dependencies:
python -m venv env
source env/bin/activate  # On Windows: env\Scripts\activate
pip install -r requirements.txt
./generate-env.sh  # Creates .env file with secure random keys
# Edit additional settings in .env
  1. Initialize the database:
flask create-db
flask install
  1. Run the development server:
flask run

Using Docker (Recommended for Production)

  1. Clone and configure:
git clone git@github.com:level09/enferno.git
cd enferno
./generate-env.sh  # Creates .env file with secure random keys
# Edit additional settings in .env
  1. Build and run with Docker Compose:
docker compose up --build

The application will be available at:

Running Background Tasks

Local Development

celery -A enferno.tasks worker -l info
# Add -b flag to enable Celery heartbeat (periodic tasks)

Docker Environment

Background tasks are automatically handled by the Celery container.

Environment Variables

Key configuration options in .env:

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

# Database
SQLALCHEMY_DATABASE_URI=postgresql://username:password@localhost/dbname

# Redis
REDIS_PASSWORD=your_redis_password
SESSION_REDIS=redis://:password@localhost:6379/1
CELERY_BROKER_URL=redis://:password@localhost:6379/2
CELERY_RESULT_BACKEND=redis://:password@localhost:6379/3

# OpenAI Integration
OPENAI_API_KEY=your_openai_key

# Security
SECURITY_PASSWORD_SALT=your_secure_salt
SECURITY_TOTP_SECRETS=your_totp_secrets

Security Notes

Contributing

Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.

License

MIT licensed.