Frappe Education Documentation

repository·develop·Indexed 20 days ago

https://github.com/frappe/education

An open-source Education Management System built on the Frappe Framework and ERPNext. It provides tools for managing students, teachers, admissions, fees, course scheduling, and exams, including a dedicated student portal. The system supports installation via bench, Docker, and the easy-install.py script, and includes a Vue 3 frontend starter template.

Tokens
2.9K
Snippets
15
Records
18
Agent score
69%

What's inside Frappe Education

  1. Set up Frappe Education using Docker

    develop

    Use Docker and Docker Compose to run Frappe Education locally. Ensure you have Docker, docker-compose, and git installed.

    1. Create a directory and download the required configuration files:
      mkdir frappe-education
      cd frappe-education
      wget -O docker-compose.yml https://raw.githubusercontent.com/frappe/education/develop/docker/docker-compose.yml
      wget -O init.sh https://raw.githubusercontent.com/frappe/education/develop/docker/init.sh
    2. Start the containers in detached mode:
      docker compose up -d

    Accessing the application:

    • URL: http://education.localhost:8000/
    • Default Username: Administrator
    • Default Password: admin
    mkdir frappe-education
    cd frappe-education
    
    # Download the docker-compose file
    wget -O docker-compose.yml https://raw.githubusercontent.com/frappe/education/develop/docker/docker-compose.yml
    
    # Download the setup script
    wget -O init.sh https://raw.githubusercontent.com/frappe/education/develop/docker/init.sh
    
    docker compose up -d
  2. Self-host Frappe Education in production

    develop

    To set up a production-ready instance of Frappe Education, use the easy-install.py script. This process automates the installation and configuration of the necessary components.

    1. Download the installation script:
      wget https://frappe.io/easy-install.py
    2. Run the deployment command with your specific configuration:
      python3 ./easy-install.py deploy \
          --project=education_prod_setup \
          --email=your_email.example.com \
          --image=ghcr.io/frappe/education \
          --version=stable \
          --app=education \
          --sitename subdomain.domain.tld

    Parameters:

    • --email: Your contact email address.
    • --sitename: The domain name where the Education module will be hosted.
    • --image: The container image to use (ghcr.io/frappe/education).
    • --app: The application to deploy (education).
    python3 ./easy-install.py deploy \
        --project=education_prod_setup \
        --email=your_email.example.com \
        --image=ghcr.io/frappe/education \
        --version=stable \
        --app=education \
        --sitename subdomain.domain.tld
  3. Install the Frappe UI Starter template

    develop

    To use this template, clone it into the root folder of an existing Frappe app using degit. This sets up a Vue 3 environment with Vue Router, TailwindCSS, and Frappe UI.

    Assuming your app is named todo, follow these steps:

    1. Navigate to your app directory.
    2. Clone the template into a frontend directory.
    3. Install dependencies and start the development server.
    cd apps/todo
    npx degit NagariaHussain/doppio_frappeui_starter frontend
    cd frontend
    yarn
    yarn dev
  4. Set up Frappe Education for local development

    develop

    To develop locally, you must first have bench installed and a frappe-bench directory configured. Follow these steps:

    1. Install ERPNext:
      bench get-app erpnext
    2. Install the Education app:
      bench get-app education
    3. Create a new site:
      bench new-site education.test
    4. Map the site to your localhost:
      bench --site education.test add-to-hosts
    5. Install the Education app on the site:
      bench --site education.test install-app education

    Accessing the application:

    • Main App: http://education.test:8000/education
    • Student Portal: http://education.test:8000/student-portal
    bench --site education.test install-app education
  5. Configure CSRF for local development

    develop

    To prevent CSRFToken errors when using the Vite dev server in a development environment, you must add the ignore_csrf key to your site's site_config.json file.

    Note: In production, the csrf_token is automatically attached to the window object in index.html, so this configuration is only required for local development.

    "ignore_csrf": 1
  6. Deploy Frappe Education using Docker Compose

    develop

    You can deploy the Frappe Education stack using the provided docker-compose.yml file. The setup includes a MariaDB database, a Redis instance, and the Frappe application container.

    By default, the application services are mapped to the following ports on your host machine:

    • 8000: Primary application port
    • 9000: Secondary application port

    The frappe service uses the frappe/bench:latest image and executes /workspace/init.sh upon startup. It mounts the current directory to /workspace inside the container to allow for local development and configuration persistence.

    version: '3.7'
    name: education
    services:
      mariadb:
        image: mariadb:10.8
        environment:
          MYSQL_ROOT_PASSWORD: 123
        volumes:
          - mariadb-data:/var/lib/mysql
        networks:
          - frappe-network
    
      redis:
        image: redis:alpine
        networks:
          - frappe-network
    
      frappe:
        image: frappe/bench:latest
        command: bash /workspace/init.sh
        environment:
          - SHELL=/bin/bash
        working_dir: /home/frappe
        volumes:
          - .:/workspace
        ports:
          - 8000:8000
          - 9000:9000
        networks:
          - frappe-network
    
    volumes:
      mariadb-data:
    
    networks:
      frappe-network:
        driver: bridge
  7. Frappe Education Compatibility Matrix

    develop

    When choosing a branch, ensure it is compatible with your Frappe Framework version:

    Education BranchCompatible Frappe Framework Version
    version-15.1version-15
    version-15.2version-15
    version-16version-16
    developdevelop branch
  8. Configure Global Search for Education DocTypes

    develop

    The global_search_doctypes dictionary defines which DocTypes from the Education module are indexed and prioritized in the Frappe global search bar. Each entry is a dictionary containing the doctype and an index value to control search priority.

    global_search_doctypes = {
    	"Education": [
    		{"doctype": "Article", "index": 1},
    		{"doctype": "Video", "index": 2},
    		# ... other doctypes
    	]
    }
  9. Configure MariaDB for Frappe Education

    develop

    The MariaDB service in the Docker setup is configured with specific flags to ensure compatibility with Frappe's requirements for character sets and collations.

    Key configurations include:

    • Character Set: utf8mb4
    • Collation: utf8mb4_unicode_ci
    • Handshake: --skip-character-set-client-handshake is used to ensure consistent encoding.
    • Compatibility: --skip-innodb-read-only-compressed is included as a temporary fix for MariaDB 10.6+ environments.
    services:
      mariadb:
        image: mariadb:10.8
        command:
          - --character-set-server=utf8mb4
          - --collation-server=utf8mb4_unicode_ci
          - --skip-character-set-client-handshake
          - --skip-innodb-read-only-compressed
        environment:
          MYSQL_ROOT_PASSWORD: 123
  10. Include JavaScript in the Desk header

    develop

    To include custom JavaScript in the header of the Frappe Desk (the administrative interface), use the app_include_js hook. In this module, it is configured to include education.bundle.js.

    app_include_js = "education.bundle.js"