You are currently viewing the new Beta Editor Docs.
Switch to the Classic Editor Docs
You are currently viewing the Classic Editor Docs.
Switch to the Beta Editor Docs

Structuring your app

Anvil apps are made up of:

Client Side

  • Forms
  • Packages
  • Modules

Server Side

  • Server Packages
  • Server Modules

Packages

Your app can be organised using Packages . Packages can contain Forms, Modules, and other Packages.

You can nest things inside Packages.

You can nest things inside Packages.

Forms can contain things

Forms can contain other Forms, as well as Modules and Packages. Technically, Forms are just Python Packages.

You can nest things inside Forms.

You can nest things inside Forms.

Server Modules and Server Packages

There are also Server Modules and Server Packages. These are just like ordinary Modules and Packages, but they can only be run or imported on the server.

They are found in the ‘Server Code’ section of the App Browser.

Server Modules and Server Packages.

Server Modules and Server Packages.

Adding things

To add a new Form, Module or Package, click the + next to Client Code:

Adding things at the top level

Adding things at the top level

Or use the dropdown menu next to a Form or Package to add things inside it:

Adding things inside a Package

Adding things inside a Package

You can create new Server Modules and Server Packages in the same way:

Adding things inside a Server Package

Adding things inside a Server Package

Moving things

Drag-and-drop existing Forms, Packages and Modules to put them in a new place within your app structure:

Drag-and-drop to move things around.

Drag-and-drop to move things around.

If you move a Form, Module or Package, be sure to rewrite its imports and the imports of things that refer to it - the all-app search function can help you here.