Introduction
This tutorial guides you through creating your first custom app using Frappe Framework v15—a full-stack, low-code platform that powers ERPNext.
Whether you’re a Python developer, ERP consultant, or a tech entrepreneur, this guide offers hands-on experience with Frappe’s modular architecture, DocType creation, scripting, and backend logic.
You’ll create a basic app to manage “Books” and understand how DocTypes, permissions, REST APIs, and front-end forms work in unison.
Core Sections
Overview
In this tutorial, you will:
- Create a custom Frappe app (library_management)
- Create a site and install the app
- Define custom DocTypes like Book and Library Member
- Add fields, relationships, and permissions
- Build backend logic and test APIs
By the end, you’ll have a functioning app with both backend and UI, powered by Frappe’s out-of-the-box features.
Installation / Setup
Prerequisites
Ensure you’ve followed the Frappe v15 Installation Guide.
Create and Setup Bench
bench init my-bench --frappe-branch version-15
cd my-bench
bench new-site library.local
Create Your First App
bench new-app library_management
Follow the CLI prompts:
- App Name: Library Management
- App Title: Library Management
- App Description: App for managing library resources
- App Publisher: Your name/company
- Email, license, etc.
Install App on Site
bench --site library.local install-app library_management
Start Development Server
bench start
Access: http://localhost:8000
Login with Administrator credentials you set during new-site.
Configuration
Navigate to Library Management > Library Management > DocType in the UI.
Create a New DocType: Book
- Name: Book
- Module: Library Management
- Check “Is Submittable”
- Add Fields:
- title → Data
- author → Data
- isbn → Data
- status → Select (Available, Issued)
Save and reload.
Create Another DocType: Library Member
- first_name → Data
- last_name → Data
- email_id → Data
- membership_expiry_date → Date
Functional Use
Now your app has two main DocTypes:
- Book: Manages book inventory
- Library Member: Tracks members
You can:
- Add records using the web UI
- Link them together
- Assign roles and permissions
Frappe auto-generates forms, list views, and REST APIs.
Developer Reference / API
To fetch records via REST:
GET /api/resource/Book
To create a new Book via API:
curl -X POST https://library.local/api/resource/Book \
-H "Authorization: token <api_key>:<api_secret>" \
-H "Content-Type: application/json" \
-d '{
"title": "The Alchemist",
"author": "Paulo Coelho",
"isbn": "978-0061122415",
"status": "Available"
}'
To add custom server logic, use hooks like:
# in library_management/library_management/book/book.py
def before_insert(self):
if not self.title:
frappe.throw("Title is required")