Convert Figma logo to code with AI

frappe logofrappe

Low code web framework for real world applications, in Python and Javascript

8,611
3,973
8,611
2,226

Top Related Projects

44,816

Odoo. Open Source Apps To Grow Your Business.

84,447

The Web framework for perfectionists with deadlines.

81,347

Laravel is a web application framework with expressive, elegant syntax. We’ve already laid the foundation for your next big idea — freeing you to create without sweating the small things.

30,457

The Symfony PHP framework

8,757

CakePHP: The Rapid Development Framework for PHP - Official Repository

14,284

Yii 2: The Fast, Secure and Professional PHP Framework

Quick Overview

Frappe is an open-source, modern web application framework and low-code platform written in Python and JavaScript. It provides a full-stack development environment for building business applications quickly and efficiently, with features like database management, user authentication, and a powerful admin interface.

Pros

  • Rapid application development with low-code approach
  • Highly customizable and extensible architecture
  • Built-in features for common business needs (e.g., user management, reporting)
  • Active community and regular updates

Cons

  • Steeper learning curve compared to some other web frameworks
  • Documentation can be inconsistent or outdated in some areas
  • Performance may be slower compared to more lightweight frameworks
  • Limited third-party integrations compared to more popular frameworks

Code Examples

  1. Creating a new DocType (database model):
from frappe.model.document import Document

class Customer(Document):
    def validate(self):
        if not self.customer_name:
            self.customer_name = self.first_name + " " + self.last_name
  1. Defining a new API endpoint:
import frappe

@frappe.whitelist()
def get_customer_info(customer_id):
    customer = frappe.get_doc("Customer", customer_id)
    return {
        "name": customer.customer_name,
        "email": customer.email,
        "phone": customer.phone
    }
  1. Creating a custom report:
from frappe import _

def execute(filters=None):
    columns = [
        {"label": _("Customer"), "fieldname": "customer", "fieldtype": "Link", "options": "Customer"},
        {"label": _("Total Sales"), "fieldname": "total_sales", "fieldtype": "Currency"}
    ]
    
    data = frappe.db.sql("""
        SELECT customer, SUM(grand_total) as total_sales
        FROM `tabSales Invoice`
        GROUP BY customer
    """, as_dict=1)
    
    return columns, data

Getting Started

  1. Install Frappe Bench:
pip install frappe-bench
  1. Initialize a new Frappe project:
bench init frappe-project
cd frappe-project
  1. Create a new app:
bench new-app myapp
  1. Install the app on your site:
bench --site mysite.local install-app myapp
  1. Start the development server:
bench start

Competitor Comparisons

44,816

Odoo. Open Source Apps To Grow Your Business.

Pros of Odoo

  • More comprehensive out-of-the-box functionality, including CRM, accounting, and manufacturing modules
  • Larger community and ecosystem with numerous third-party apps and integrations
  • Better suited for larger enterprises with complex business processes

Cons of Odoo

  • Steeper learning curve due to its extensive feature set
  • Less flexibility for customization compared to Frappe's framework approach
  • Higher resource requirements, which may impact performance on smaller servers

Code Comparison

Odoo (Python):

class SaleOrder(models.Model):
    _name = 'sale.order'
    _description = 'Sales Order'

    name = fields.Char(string='Order Reference', required=True, copy=False, readonly=True, index=True, default=lambda self: _('New'))

Frappe (Python):

class SalesOrder(Document):
    def validate(self):
        self.validate_order_type()
        self.validate_max_discount()
        self.set_status()
        self.set_items_qty()

Both frameworks use Python and follow an object-oriented approach. Odoo uses a more declarative style with field definitions, while Frappe focuses on method implementations within document classes. Frappe's code tends to be more concise and flexible, allowing for easier customization, while Odoo's structure provides a more standardized approach across its modules.

84,447

The Web framework for perfectionists with deadlines.

Pros of Django

  • More mature and widely adopted web framework with a larger community
  • Extensive documentation and third-party packages available
  • Built-in admin interface for quick backend management

Cons of Django

  • Steeper learning curve for beginners
  • Less flexibility in project structure compared to Frappe
  • Monolithic architecture may be overkill for smaller projects

Code Comparison

Django:

from django.db import models

class Book(models.Model):
    title = models.CharField(max_length=200)
    author = models.ForeignKey('Author', on_delete=models.CASCADE)
    pub_date = models.DateField()

Frappe:

from frappe.model.document import Document

class Book(Document):
    title = None
    author = None
    pub_date = None

Django uses a more traditional ORM approach with explicit field definitions, while Frappe employs a more flexible document-based model. Django's code is more verbose but provides clearer structure, whereas Frappe's approach allows for easier schema modifications.

Both frameworks offer powerful tools for web development, but Django is better suited for larger, more complex projects with established requirements, while Frappe excels in rapid development and customization for business applications.

81,347

Laravel is a web application framework with expressive, elegant syntax. We’ve already laid the foundation for your next big idea — freeing you to create without sweating the small things.

Pros of Laravel

  • More mature and established ecosystem with extensive documentation
  • Larger community and wider adoption, leading to more resources and third-party packages
  • Built-in features like Eloquent ORM and Artisan CLI for rapid development

Cons of Laravel

  • Steeper learning curve for beginners compared to Frappe's simplicity
  • Heavier framework with more overhead, potentially impacting performance
  • Less focus on business applications and ERP functionality out of the box

Code Comparison

Laravel route definition:

Route::get('/users', [UserController::class, 'index']);

Frappe route definition:

@frappe.whitelist()
def get_users():
    return frappe.get_all('User')

Laravel emphasizes a more structured MVC approach, while Frappe uses a simpler function-based routing system. Laravel's routing is more explicit, whereas Frappe relies on decorators and conventions.

Both frameworks offer powerful features for web application development, but Laravel is more general-purpose, while Frappe is tailored for business applications and ERPs. The choice between them depends on the specific project requirements and developer preferences.

30,457

The Symfony PHP framework

Pros of Symfony

  • More mature and established framework with a larger community and ecosystem
  • Highly modular architecture allowing for flexible and scalable applications
  • Extensive documentation and learning resources

Cons of Symfony

  • Steeper learning curve, especially for beginners
  • Can be overkill for smaller projects or simple applications
  • Slower performance compared to some lightweight frameworks

Code Comparison

Symfony routing example:

use Symfony\Component\Routing\Annotation\Route;

class ProductController extends AbstractController
{
    #[Route('/product/{id}', name: 'product_show')]
    public function show(int $id): Response
    {
        // ...
    }
}

Frappe routing example:

@frappe.whitelist()
def get_product(product_id):
    # ...
    return product_data

Symfony tends to use more annotations and object-oriented approaches, while Frappe often employs decorators and follows a more functional style. Symfony's routing is more explicit, whereas Frappe's routing is typically handled through configuration files and decorators.

Both frameworks offer powerful features, but Symfony is generally more suited for complex, enterprise-level applications, while Frappe excels in rapid development and business applications, particularly those requiring ERP functionality.

8,757

CakePHP: The Rapid Development Framework for PHP - Official Repository

Pros of CakePHP

  • More mature and established framework with a longer history
  • Extensive documentation and larger community support
  • Built-in security features like CSRF protection and SQL injection prevention

Cons of CakePHP

  • Steeper learning curve for beginners
  • Less flexible for customization compared to Frappe
  • Heavier framework with potentially slower performance for smaller projects

Code Comparison

CakePHP (Controller):

class ArticlesController extends AppController
{
    public function index()
    {
        $articles = $this->Articles->find('all');
        $this->set(compact('articles'));
    }
}

Frappe (Python):

@frappe.whitelist()
def get_articles():
    articles = frappe.get_all('Article', fields=['title', 'content'])
    return articles

CakePHP follows a more traditional MVC structure with separate controller files, while Frappe uses a more modular approach with Python functions. CakePHP's ORM is more tightly integrated into the framework, whereas Frappe's approach allows for more flexibility in data handling.

Both frameworks offer robust features for web application development, but cater to different preferences and project requirements. CakePHP might be better suited for developers familiar with traditional PHP frameworks, while Frappe could be more appealing to those seeking a more modern, Python-based approach.

14,284

Yii 2: The Fast, Secure and Professional PHP Framework

Pros of Yii2

  • More mature and established framework with a larger community
  • Excellent performance and caching mechanisms
  • Robust security features out-of-the-box

Cons of Yii2

  • Steeper learning curve for beginners
  • Less flexibility for customization compared to Frappe
  • Slower development cycle and less frequent updates

Code Comparison

Yii2 (PHP):

use yii\web\Controller;

class SiteController extends Controller
{
    public function actionIndex()
    {
        return $this->render('index');
    }
}

Frappe (Python):

@frappe.whitelist()
def get_items(doctype, txt, searchfield, start, page_len, filters):
    return frappe.db.sql("""select item_code, item_name
        from `tabItem`
        where item_name like %(txt)s
        order by item_name limit %(start)s, %(page_len)s""",
        {'txt': "%%%s%%" % txt, 'start': start, 'page_len': page_len})

Yii2 focuses on MVC architecture with controllers and views, while Frappe uses a more modular approach with whitelisted functions and database queries. Yii2's code is typically more structured, while Frappe offers more flexibility in implementation.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Frappe Framework

Low Code Web Framework For Real World Applications, In Python And JavaScript

Hero Image

Frappe Framework

Full-stack web application framework that uses Python and MariaDB on the server side and a tightly integrated client side library. Built for ERPNext.

Motivation

Started in 2005, Frappe Framework was inspired by the Semantic Web. The "big idea" behind semantic web was of a framework that not only described how information is shown (like headings, body etc), but also what it means, like name, address etc.

By creating a web framework that allowed for easy definition of metadata, it made building complex applications easy. Applications usually designed around how users interact with a system, but not based on semantics of the underlying system. Applications built on semantics end up being much more consistent and extensible. The first application built on Framework was ERPNext, a beast with more than 700 object types. Framework is not for the light hearted - it is not the first thing you might want to learn if you are beginning to learn web programming, but if you are ready to do real work, then Framework is the right tool for the job.

Key Features

  • Full-Stack Framework: Frappe covers both front-end and back-end development, allowing developers to build complete applications using a single framework.

  • Built-in Admin Interface: Provides a pre-built, customizable admin dashboard for managing application data, reducing development time and effort.

  • Role-Based Permissions: Comprehensive user and role management system to control access and permissions within the application.

  • REST API: Automatically generated RESTful API for all models, enabling easy integration with other systems and services.

  • Customizable Forms and Views: Flexible form and view customization using server-side scripting and client-side JavaScript.

  • Report Builder: Powerful reporting tool that allows users to create custom reports without writing any code.

Screenshots

List View Form View Role Permission Manager

Production Setup

Managed Hosting

You can try Frappe Cloud, a simple, user-friendly and sophisticated open-source platform to host Frappe applications with peace of mind.

It takes care of installation, setup, upgrades, monitoring, maintenance and support of your Frappe deployments. It is a fully featured developer platform with an ability to manage and control multiple Frappe deployments.

Self Hosting

Docker

Prerequisites: docker, docker-compose, git. Refer Docker Documentation for more details on Docker setup.

Run following commands:

git clone https://github.com/frappe/frappe_docker
cd frappe_docker
docker compose -f pwd.yml up -d

After a couple of minutes, site should be accessible on your localhost port: 8080. Use below default login credentials to access the site.

  • Username: Administrator
  • Password: admin

See Frappe Docker for ARM based docker setup.

Development Setup

Manual Install

The Easy Way: our install script for bench will install all dependencies (e.g. MariaDB). See https://github.com/frappe/bench for more details.

New passwords will be created for the Frappe "Administrator" user, the MariaDB root user, and the frappe user (the script displays the passwords and saves them to ~/frappe_passwords.txt).

Local

To setup the repository locally follow the steps mentioned below:

  1. Setup bench by following the Installation Steps and start the server

    bench start
    
  2. In a separate terminal window, run the following commands:

    # Create a new site
    bench new-site frappe.localhost
    
  3. Open the URL http://frappe.localhost:8000/app in your browser, you should see the app running

Learning and community

  1. Frappe School - Learn Frappe Framework and ERPNext from the various courses by the maintainers or from the community.
  2. Official documentation - Extensive documentation for Frappe Framework.
  3. Discussion Forum - Engage with community of Frappe Framework users and service providers.
  4. buildwithhussain.com - Watch Frappe Framework being used in the wild to build world-class web apps.

Contributing

  1. Issue Guidelines
  2. Report Security Vulnerabilities
  3. Pull Request Requirements
  4. Translations