Skip to main content

Create App, Site & Doctype

How To Create an App

After installing the bench, we can create an app to proceed. Creating a custom app in Frappe (or Frappe Framework) is a straightforward process. Below is a step-by-step manual to create a custom app in Frappe, but first, if you cannot find you bench directory, you can run below command to find it.

bench find

Example output:

image-1739927580296.png

Now go to your directory and execute below command to create a new app:

bench new-app library_management

You will be prompted with details of your app, fill them up and an app that you named will be created in the apps folder.

 

Create a New Site

Each site comes with a database. They may be customized through site specific scripting or Apps may be installed on them. To create a new site, run the following command from the frappe-bench directory:

bench new-site <your-site-name>

This command will create a new database, so you need to enter your MySQL root password. It will also ask to set the password for the Administrator user, just set a password that you won't forget. This will be useful later.

Now, you will have a new folder that you named in the sites directory.

To make your site as default site, run this command:

bench use-site <your-site-name>

 

Install App on the Site

To install your app on the site, run the following command:

bench --site <your-site-name> install-app <your-app-name>

To confirm if the app was installed, run the following command:

bench --site <your-site-name> list-apps

Note: When you create a new site, the frappe app is installed by default.

 

Login and Create Doctype

To create DocTypes in our app, we must log in to Desk. Go to http://localhost:8000 and it should show you a login page.

Enter Administrator as the user and password that you set while creating the site.

After successful login, you will see the setup wizard. This is a one-time setup wizard used to set up localization details for your site. Go ahead, select your language, and complete the wizard.

Enable Developer Mode

Before creating the doctype, enable the developer mode by execute this command:

bench set-config -g developer_mode true

Creating a DocType

While in Desk, navigate to the DocType List using the Awesomebar. This list will include DocTypes bundled with the framework, those that are a part of the installed Frappe apps and custom ones, which you can create specific to each site.

image-1739947647795.png

Click "Add Doctype" to start creating you own CRUD