Skip to content

This collection of modern libraries and tools, built on top of the Flask framework, allows you to quickly create any website or web-based application (SAAS) with impressive speed.

License

Notifications You must be signed in to change notification settings

level09/enferno

Repository files navigation

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:

  • flask generate-model: Instantly generate models with natural language
  • flask generate-dashboard: Create dashboards by describing your requirements
  • flask generate-api: Speed up API development with verbal descriptions
  • flask generate-env: Generate secure environment files with random keys

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

Features

Core Features:

  • Modern Stack: Built on Flask with Python 3.12 support
  • User Management: Built-in authentication, registration, and role-based access control
  • Frontend: Integrated Vue 3 and Vuetify 3 for modern, responsive UIs
  • Database: SQLAlchemy ORM with PostgreSQL support
  • Task Queue: Background job processing with Celery
  • Email: Easy email integration with Flask-Mail
  • Security: Best practices out of the box
  • Docker: Production-ready Docker configuration with non-root security
  • AI Integration: OpenAI-powered code generation tools
  • Internationalization: Multi-language support via Flask-Babel
  • CLI Tools: Powerful command-line utilities for common tasks

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

  • Python 3.12+
  • Redis
  • PostgreSQL
  • Node.js (for frontend development)

Quick Start

Local Development

  1. Clone the repository:
git clone [email protected]:level09/enferno.git
cd enferno
  1. Set up a virtual environment:
python -m venv env
source env/bin/activate  # On Windows: env\Scripts\activate
pip install -r requirements.txt
  1. Copy the sample environment file and generate secure configuration:
cp .env-sample .env  # Copy the sample environment file
flask generate-env  # Creates secure random keys in .env
# 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 [email protected]:level09/enferno.git
cd enferno
flask generate-env  # Creates secure .env file
# 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

  • All Docker services run as non-root users
  • Configuration files are mounted read-only
  • Sensitive data is managed through environment variables
  • Static files are served through Nginx
  • Redis is password-protected
  • Secure key generation via flask generate-env

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.

About

This collection of modern libraries and tools, built on top of the Flask framework, allows you to quickly create any website or web-based application (SAAS) with impressive speed.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published