The main key point to understand when looking at Frappe is how the database is declared and model-view building happens internally. It uses meta-data based declaration which is just a JSON file that creates the tables and fields in the database based on it and gives a rich user interface with its bindings to its corresponding database fields.
- Database: MariaDB and Postgres(no support for ERPnext)
- Webserver: Werkzeug
- Templating: Jinja
- Job Queues: Python RQ(Scheduler)
- CSS Framework: Bootstrap 3
- Caching: Redis(In-memory)
- Realtime: NodeJS + Socketio.js
- Webserver: gunicorn + NGINX (Production)
- Process Manager (Production): supervisord
- Process Manager (Develop): Honcho
- Command Line: Bench
- Wkhtmltopdf : Command line tool to process HTML in PDF (report generation)
django-admin startproject django-project
bench init frappe-bench
Creating a new app in the project
python manage.py startapp custom_app
bench new-app custom_app
Start the server
python manage.py runserver
The admin interface in Frappe is called Desk which is generated using the meta-data(JSON).DocTypes and automatically builds list views, form views, report views, etc for your DocTypes and allows the option to set permissions for users to view/modify it.
- DocType: DocType is responsible for models and views in Frappe, which holds the reason to be called as meta-based. It stores all the fields and its types of databases in JSON data. In short, it describes models and views.
Supports many-to-one relationship to the fields in the form of child DocType to a field.
It is a python package and should be under the directory
apps in the
frappe-bench directory. Each app should have an entry in
apps.txt file just like in Django settinngs.py to be considered.
4.Links: The fields between two tables can be mapped with each other through Links and we need to specify the target fields from the parent table. This acts more of a foreign key reference.
Note: Remember that Link fields are not automatically set as Foreign Keys in the MariaDB database, because that will implicitly index the column. This may not be optimum hence the Foreign Key validation is done by the Framework.
Report generation works out of the box for Frappe without the need for the developer to work on it. It also supports the scheduler to generate the reports and can be exported in many formats including PDF, XLSX.