Introduction
The definition for "Application" in
Fastberry
is basically a pythonmodule
.
The idea is to have "self-contained" blocks of code
that are reusable.
Also, easy to share and use inside other Fastberry
projects.
Command
Files Layout (Complex)
Files (Complex)
The example below represents a Complex Application that uses all of the internal tools
commands
path to create Internal commandsextension
path to create GraphQL's extensionspermissions
path to create GraphQL's permissionsmiddleware
path to create API's middlewareon_event
(optional) path to create middleware for server Events's
Name & Usage of on_event
are optional. You can name the file
anyway you want.
root/
|
|-- apps/
| `-- MY_APPLICATION/ --> <Directory> - Your App in HERE!
| |-- __init__.py
| |-- commands.py
| |-- extension.py
| |-- graphql.py
| |-- middleware.py
| |-- forms.py
| |-- permissions.py
| |-- on_event.py --> <Optional>
| |-- router.py
| `-- types.py
|
`-- etc...
Files Layout (Simple)
Files (Simple)
The example below represents a Simple Application that uses only the necessary tools to build an API
types
use to create the equivalent of a database Modelforms
use to create complex input formsmanager
use to create complex database Queries & Mutationsgraphql
use to create operations of the GraphQLrouter
(optional) used to create endpoints for FastAPI
root/
|
|-- apps/
| `-- MY_APPLICATION/ --> <Directory> - Your App in HERE!
| |-- __init__.py
| |-- forms.py
| |-- graphql.py
| |-- manager.py
| |-- router.py --> <Optional>
| `-- types.py
|
`-- etc...
Application Diagram
flowchart LR;
A[Types] --- D;
B[Forms] --- D;
C[Manager] --- D;
D[Operations] --- F;
E((Router)) --- F;
F{API} --- H{Client};
Demo
The example above shows the flow of the API but it also shows all the tools
you can use to build your projects.